12 Replies Latest reply on Apr 18, 2007 11:25 PM by Matt Drees

    Seam Framework EntityQuery restrictions does not work for My

    Kien Wah Lim Newbie

      Hi,

      I'm a newbie in Seam. Appreciate if someone can help on this.

      I run the contactlist example from Seam version 1.2.1 . Everything works if I use HSQLDB. I'm able to do pagination and restriction with the EntityQuery framework. However, the restrictions does NOT work when I switch to MySql database. Has anyone encounter this problem?

      My configuration is as below:

      components.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <components xmlns="http://jboss.com/products/seam/components"
       xmlns:fwk="http://jboss.com/products/seam/framework"
       xmlns:core="http://jboss.com/products/seam/core"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation=
       "http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-1.2.xsd
       http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.2.xsd
       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.2.xsd">
      
       <factory name="contact" value="#{contactHome.instance}"/>
       <fwk:entity-home name="contactHome"
       entity-class="Contact"/>
      
       <fwk:entity-query name="contacts"
       max-results="20">
       <fwk:ejbql>from Contact</fwk:ejbql>
       <fwk:order>lastName</fwk:order>
       <fwk:restrictions>
       <value>lower(firstName) like lower( #{exampleContact.firstName} + '%' )</value>
       <value>lower(lastName) like lower( #{exampleContact.lastName} + '%' )</value>
       </fwk:restrictions>
       </fwk:entity-query>
      
       <component name="exampleContact"
       class="Contact"/>
      
      </components>