3 Replies Latest reply on Sep 3, 2002 7:19 PM by Dain Sundstrom

    a Question for JBossQL!

    cnwy Newbie

      when using Jboss dynamic sql,I prefer to make the Ejb-QL instead of passing every parameter.
      so the qestion is how to deal with Date type condition.

      can somebody help?

        • 1. Re: a Question for JBossQL!
          Dain Sundstrom Master

          What do you mean by "Data type condition"?

          • 2. Re: a Question for JBossQL!
            cnwy Newbie

            for example(from JBoss CMP).
            g.hangout.state = 'CA' Legal
            'CA' = g.shippingAddress.state NOT Legal
            'CA' = 'CA' NOT Legal
            (r.amountPaid * .01) > 300 NOT Legal
            r.amountPaid > (300 / .01) Legal

            My question is how to do with date type?
            eg:
            g.begdate > '2000-12-22' is Legal or not?

            Thanks for future reply.

            • 3. Re: a Question for JBossQL!
              Dain Sundstrom Master

              > for example(from JBoss CMP).
              > g.hangout.state = 'CA' Legal
              > 'CA' = g.shippingAddress.state NOT Legal

              Now legal in JBossQL (Branch_3_0, Branch_3_2, HEAD)

              > 'CA' = 'CA' NOT Legal

              Now legal in JBossQL (Branch_3_0, Branch_3_2, HEAD)

              > (r.amountPaid * .01) > 300 NOT Legal

              Still not legal.

              > r.amountPaid > (300 / .01) Legal
              >
              > My question is how to do with date type?
              > eg:
              > g.begdate > '2000-12-22' is Legal or not?

              No. EJB-QL (JBossQL) is strongly typed. A date can not be compared to a String, and there are no date literals. You can compare the date to a date valued parameter, but you most likely knew that.