The search in collection using the compsiteid does not Work
Hibernate version: 3.1.3
Mapping documents:
Indisponibilidade.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 15/03/2006 10:52:39 by Hibernate Tools 3.1.0.beta4 -->
<hibernate-mapping>
<set name="indisppartesForIpIndisponibilidade" inverse="true">
<key>
<column name="Ip_Indisponibilidade" not-null="true" />
</key>
<one-to-many class="br.com.escriba.web.cenib.entity.Indispparte" />
</set>
</class>
</hibernate-mapping>
Indispparte.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 15/03/2006 10:52:40 by Hibernate Tools 3.1.0.beta4 -->
<hibernate-mapping>
<class name="br.com.escriba.web.cenib.entity.Indispparte" table="indispparte" catalog="cenib">
<composite-id name="indispparteId" class="br.com.escriba.web.cenib.entity.IndispparteId">
<key-many-to-one name="indisponibilidade" class="br.com.escriba.web.cenib.entity.Indisponibilidade" lazy="false">
<column name="Ip_Indisponibilidade" />
</key-many-to-one>
<key-many-to-one name="parte" class="br.com.escriba.web.cenib.entity.Parte" lazy="false">
<column name="Ip_Parte" />
</key-many-to-one>
</composite-id>
<many-to-one name="indisponibilidadeByIpIndispCanc" class="br.com.escriba.web.cenib.entity.Indisponibilidade" fetch="select">
<column name="Ip_IndispCanc" />
</many-to-one>
<property name="ipAtuacao" type="string">
<column name="Ip_Atuacao" length="50"/>
</property>
<property name="ipIndisp" type="int">
<column name="Ip_Indisp" not-null="true" />
</property>
<property name="ipValidacao" type="string">
<column name="Ip_Validacao" length="32" />
</property>
</class>
</hibernate-mapping>
Parte.xml
?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 15/03/2006 10:52:39 by Hibernate Tools 3.1.0.beta4 -->
<hibernate-mapping>
<class name="br.com.escriba.web.cenib.entity.Parte" table="parte" catalog="cenib">
<id name="paParte" type="int">
<column name="Pa_Parte" />
<generator class="increment" />
</id>
<property name="paNome" type="string">
<column name="Pa_Nome" length="200" not-null="true" />
</property>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
List<Indisponibilidade> retorno = session.createQuery("from Indisponibilidade ind where ind.indisppartesForIpIndisponibilidade.indispparteId.parte.paNome like :nome order by ind.inDataInclusao desc").setString("nome",nomeParte).list();
Full stack trace of any exception that occurs:
16:08:34,437 ERROR [PARSER] illegal syntax near collection: indispparteId
16:08:34,437 ERROR [PARSER] <AST>:0:0: unexpected end of subtree
16:08:34,437 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
javax.faces.FacesException: Error calling action method of component with id localizaIndisp:localizaIndispForm:_id32
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
at javax.faces.component.UICommand.broadcast(UICommand.java:106)
at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.faces.el.EvaluationException: Exception while invoking expression #{cenibLocalizaIndisponibilidade.localizar}
at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:153)
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
... 29 more
Caused by: java.lang.NullPointerException
at org.hibernate.hql.ast.HqlSqlWalker.lookupProperty(HqlSqlWalker.java:446)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.addrExpr(HqlSqlBaseWalker.java:4316)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:1211)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.exprOrSubquery(HqlSqlBaseWalker.java:4032)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3662)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1758)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:776)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:577)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:218)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:158)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:109)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:75)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:54)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1583)
at br.com.escriba.web.cenib.GenericIndisponibilidadeFace.getIndisponibilidadesByPartes(GenericIndisponibilidadeFace.java:142)
at br.com.escriba.web.cenib.LocalizaIndisponibilidadeFace.localizar(LocalizaIndisponibilidadeFace.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
... 30 more
Name and version of the database you are using:
MySQL 5.0.19 with Connector/J 3.1.12-ga
The generated SQL (show_sql=true):
none , the crash is instantly
Debug level Hibernate log excerpt:
none.
|