2 Replies Latest reply on Oct 22, 2012 6:04 AM by raidri

    EntityQuery with or statement

    raidri

      Hi,

       

      i need the following SQL Statement with seam.

       

      SELECT * from table WHERE (state = 'A' or state = 'b') and value = 'hello';

       

      This restriction don't work. cause the or statement is not possible.

       

      private static final String[] RESTRICTIONS = {

        "(lending.state = #{lendingList.lendingState} or lending.displayState = #{lendingList.lendingState})",

        "lower(lending.event) like concat('%',lower(#{lendingList.event}),'%')",

        "lower(lending.username) in (#{lendingList.racfUsernames})",

        "lower(lending.costCenter) like concat(lower(#{lendingList.costCenter}),'%')",

        "lendingProduct.product.lendingGroup IN (#{lendingList.lendingGroup})",

        "lendingProduct.product.name like concat('%',lower(#{lendingList.productName}),'%')",

        "lendingItem.item.identifier like concat('%', lower(#{lendingList.itemIdentifier}),'%')",

        "lendingProduct.product.productGroup.id = #{lendingList.productGroupId}"};

       

      What i 've to change to make the statement valid ?

       

      Thanks a lot.

       

      raidri