0 Replies Latest reply on Aug 24, 2002 6:22 PM by Fabricio

    EJB-QL and boolean CMP

    Fabricio Newbie

      i have a 2.0 CMP entity bean which has a CMP field called booleanfield.

      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.

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