-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Xdoclet mapping, HQL query
PostPosted: Tue Nov 30, 2004 2:25 am 
Beginner
Beginner

Joined: Thu Sep 23, 2004 6:03 am
Posts: 27
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.