Hello everyone,
I'm having problems with a simple join. I have the following statement, from a createQuery:
Code:
from FichaTecnica as f join auge.bean.Produto as p where upper(p.descricao) like upper(?) order by descricao
and I get the error:
Code:
2005-09-30 14:47:32,328 ERROR StandardWrapper[/AugeProducao:action] -> Servlet.service() for servlet action threw exception
java.lang.NullPointerException
at org.hibernate.hql.ast.HqlSqlWalker.createFromJoinElement(HqlSqlWalker.java:264)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.joinElement(HqlSqlBaseWalker.java:3022)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:2841)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2719)
at
I don't know what's wrong, is it my HQL or my mapping files? I'll put them below:
Code:
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="auge.bean.FichaTecnica" table="FICHATECNICA" >
<id name="fichaTecnica" column="fichaTecnica" type="java.lang.String">
<generator class="assigned"/>
</id>
<property name="molde" column="molde" type="java.lang.String" />
<property name="tamanhoPiloto" column="tamanhoPiloto" type="java.lang.String" />
<many-to-one name="estilista" column="estilista" class="auge.bean.Pessoa"
not-null="false" lazy="false"/>
<many-to-one name="produto" column="produto" class="auge.bean.Produto"
not-null="false" lazy="false"/>
</class>
</hibernate-mapping>
Code:
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="auge.bean.Produto" table="PRODUTOS" >
<id name="produto" column="produto" type="java.lang.String">
<generator class="assigned"/>
</id>
<property name="descricao" column="descricao" type="java.lang.String" />
</class>
</hibernate-mapping>
Could someone help? What's the right way for the HQL? Is mine right? Is my mapping files right?
I thank you all for the help