Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.3.1 but it worked in 3.2.2
Mapping documents:
<class name="com.mdagen.rallie.model.Equipo" table="EQUIPOS" lazy="false">
<id name="idEquipo"
type="long">
<column name="ID_EQUIPO"/>
</id>
...
<set name="marcasEqus" cascade="save-update" outer-join="true"
table="EQUIPOS_MARCAS" lazy="false">
<key column="ID_EQUIPO"/>
<many-to-many class="com.mdagen.rallie.model.Marca" outer-join="true"
column="ID_MARCA" lazy="false"/>
</set>
</class>
<class name="com.mdagen.rallie.model.Marca" table="MARCAS" lazy="false">
<id name="idMarca"
type="long">
<column name="ID_MARCA"/>
</id>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
The hql is
"from com.mdagen.rallie.model.Equipo as ta where ta.marcasEqus.idMarca = ? "
Full stack trace of any exception that occurs:
Caused by: org.springframework.orm.hibernate3.HibernateQueryException: illegal attempt to dereference collection [equipo0_.ID_EQUIPO.marcasEqus] with element property reference [idMarca] [from com.mdagen.rallie.model.Equipo as ta where ta.marcasEqus.idMarca = ? ]; nested exception is org.hibernate.QueryException: illegal attempt to dereference collection [equipo0_.ID_EQUIPO.marcasEqus] with element property reference [idMarca] [from com.mdagen.rallie.model.Equipo as ta where ta.marcasEqus.idMarca = ? ]
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:642)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:917)
at com.mdagen.rallie.dao.hibernate.EquipoDAOHibernate.getEquipos(EquipoDAOHibernate.java:99)
Name and version of the database you are using:
MySQL 5.0.
The generated SQL (show_sql=true):
I have a little web application with struts 1 spring 2.5.5 and hibernate 3.2.2 who works fine (relatively). But when i have migrated to hibernate 3.3.1 i have and error in hql i can't understand.
I would appreciate any help
Rodolfo