Well, hmm... not sure where to go from here. This problem is most definitely happening and I can't think of much else that I could be doing wrong, except...
My hibernate output shows this:
Code:
00:23:08,529 INFO net.sf.hibernate.cfg.Environment - Hibernate 2.1 beta 5
Even though the readme.txt in my hibernate distribution shows this:
Code:
version 2.1 beta 6, 5 November 2003
And I didn't download beta 5, so there's no way I could be running against beta 5.
Here's my log & stack trace, I don't really understand why it's looking for an id on a composite-element, should I have one?
Code:
00:29:08,326 DEBUG net.sf.hibernate.impl.SessionImpl - iterate: select count(ad) from PlayerInGame defender join defender.attackDetails ad where ad.attacker = :attacker and defender = :defender
00:29:08,326 DEBUG net.sf.hibernate.engine.QueryParameters - named parameters: {defender=PlayerInGame#4, attacker=PlayerInGame#3}
00:29:08,336 DEBUG net.sf.hibernate.hql.QueryTranslator - compiling query
00:29:08,336 ERROR example.PlayerInGame - Exception during getNumAttacksBy()
net.sf.hibernate.QueryException: could not resolve property: id of: example.AttackDetails [select count(ad) from example.PlayerInGame defender join defender.attackDetails ad where ad.attacker = :attacker and defender = :defender]
at net.sf.hibernate.persister.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:35)
at net.sf.hibernate.collection.AbstractCollectionPersister.toType(AbstractCollectionPersister.java:701)
at net.sf.hibernate.hql.PathExpressionParser.getPropertyType(PathExpressionParser.java:242)
at net.sf.hibernate.hql.PathExpressionParser.end(PathExpressionParser.java:281)
at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30)
at net.sf.hibernate.hql.SelectParser.token(SelectParser.java:140)
at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87)
at net.sf.hibernate.hql.ClauseParser.end(ClauseParser.java:114)
at net.sf.hibernate.hql.PreprocessingParser.end(PreprocessingParser.java:143)
at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:151)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:140)
at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:291)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1501)
at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1531)
at net.sf.hibernate.impl.QueryImpl.iterate(QueryImpl.java:33)
at example.PlayerInGame.getNumAttacksOn(PlayerInGame.java:459)