0 Replies Latest reply on Dec 1, 2008 12:58 AM by Thomas Barry

    Entity equality in 2.1.1CR1 components.xml query

    Thomas Barry Newbie

      This query worked in Seam 2.0.x:

      <factory name="availableServers" value="#{queryAvailableServers}"/>
          ejbql="select s from Server s
                  where s.organization = #{selectedDatabase.organization}
                    and s.active = true order by s.name"/>

      but throws this exception in 2.1.1CR1:

      Caused by: org.hibernate.QueryException: unexpected char: '@' [select s from com.twocoast.tcsc.model.Server s where s.organization = com.twocoast.tcsc.model.Organization@23e4f93 and s.active = true order by s.name]
           at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:204)
           at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)

      Everything is fine if I change the clause to:

      where s.organization.id = #{selectedDatabase.organization.id}

      Anyone have an idea why this might be happening?