2 Replies Latest reply on Aug 28, 2002 7:15 PM by Fabricio

    maybe a bug - cmp field - please read!

    Fabricio Newbie

      i have a 2.0 CMP entity bean which has a CMP field called booleanfield (java.lang.Boolean).

      I am using MS SQL Server 2000.

      i need to have a finder method which retrieves all CMPs which have this boolean field turned on (true).

      my ejb-ql query is, therefore:

      SELECT OBJECT (o) FROM Company AS o WHERE o.booleanfield=TRUE.

      i get a jdbc error. When i look into the log, the query has been translated to:

      SELECT t0_o.cod_company FROM company t0_o WHERE t0_o.booleanfield = true

      The mistake is obvious. The data type is a BIT (numerical value which only takes 0 or 1) in the data base. Hence, true makes no sense to SQL Server. I even tried the query in the query analyzer, just in case i was getting everything wrong.

      Is this a jboss bug or am i doing something wrong? Please answer if you have any ideas. Thanks in advance!

      ps: for the moment, i had to use an Integer field which takes value 0 or 1, and write the query according to that data type.