Hibernate version:2.1.0
Mapping documents:Xdoclet 1.2
Full stack trace of any exception that occurs:<br/>
unindexed collection before []: licence0_.licensees [from au.edu.tlf.lips.model.Licence lic where lic.licensees=?]; nested exception is net.sf.hibernate.QueryException: unindexed collection before []: licence0_.licensees [from au.edu.tlf.lips.model.Licence lic where lic.licensees=?]
<p>
org.springframework.orm.hibernate.HibernateQueryException: unindexed collection before []: licence0_.licensees [from au.edu.tlf.lips.model.Licence lic where lic.licensees=?]; nested exception is net.sf.hibernate.QueryException: unindexed collection before []: licence0_.licensees [from au.edu.tlf.lips.model.Licence lic where lic.licensees=?]net.sf.hibernate.QueryException: unindexed collection before []: licence0_.licensees [from au.edu.tlf.lips.model.Licence lic where lic.licensees=?] at net.sf.hibernate.hql.PathExpressionParser.prepareForIndex(PathExpressionParser.java:308) at net.sf.hibernate.hql.PathExpressionParser.end(PathExpressionParser.java:292) at net.sf.hibernate.hql.WhereParser.doPathExpression(WhereParser.java:336) at net.sf.hibernate.hql.WhereParser.doToken(WhereParser.java:366) at net.sf.hibernate.hql.WhereParser.token(WhereParser.java:251) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87) at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:123) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:149) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:293) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1554) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1525) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39) at org.springframework.orm.hibernate.HibernateTemplate$22.doInHibernate(HibernateTemplate.java:417) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:176) at org.springframework.orm.hibernate.HibernateTemplate.executeFind(HibernateTemplate.java:196) at org.springframework.orm.hibernate.HibernateTemplate.find(HibernateTemplate.java:413) at au.edu.tlf.lips.persistence.hibernate.LicenceDAOHibernate.getAllLicencesForLicenceParty(LicenceDAOHibernate.java:76) at au.edu.tlf.lips.persistence.LicenceDAOTest.testGetLicencePartiesForALicences(LicenceDAOTest.java:130) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Name and version of the database you are using: MySQL 4
More of a query that I have and was hoping someone might be able to point out what I am doing incorrectly. I get the above resulting error due the trying to call a HQL query.
I have two classes, Licensor and Licence, linked as a many-to-many detailed as follows:
Code:
/**
* @return Returns the licensees.
*
* @hibernate.bag
* table="table_join_licences_licensees"
* cascade="all"
* inverse="true"
*
* @hibernate.collection-key
* column="fk_licence_id"
*
* @hibernate.collection-many-to-many
* class="au.edu.tlf.lips.model.Licensee"
* column="fk_lincensee_id"
*/
public List getLicensees() {
return licensees;
}
Code:
/**
* @return Returns the licences.
*
* @hibernate.bag
* table="table_join_licences_licensees"
* cascade="all"
* inverse="true"
*
* @hibernate.collection-key
* column="fk_lincensee_id"
*
* @hibernate.collection-many-to-many
* class="au.edu.tlf.lips.model.Licence"
* column="fk_licence_id"
*/
public List getLicences() {
return licences;
}
There error hightlighted above is of a result of calling for following method
Code:
public List getAllLicencesForLicenceParty(Agent agent) {
// return a list of licences where the agent is a licence party
List asLicenseeToLicence = getHibernateTemplate().find("from Licence lic where lic.licensees=?", agent);
}
Any ideas as to what I might be doing incorrectly? Thanks in advance.