Hibernate version:
3.2.0-cr3
Mapping documents:
Files bundled with HHH-1849 :
http://opensource.atlassian.com/project ... e/HHH-1849
I have submitted a JIRA issue for version 3.2.0-cr2 (HHH-1849). It is a one-to-one related problem.
As version cr3 is released, I rerun my test on this version to see if my problem is solved. With cr3, I have another problem. As you in the code below I do two similar queries, one with the id of the related object and the other one with the related object itself. The first one works but not the second one.
Do I have to submit another issue or do I just add the cr3 stack trace to the previous one ?
Regards
Code between sessionFactory.openSession() and session.close():
Code:
Transaction tx = session.beginTransaction();
Slave slave = new Slave();
slave.setOid(1);
session.save(slave);
Master master = new Master();
master.setSlave(slave);
session.save(master);
Query query;
query = session.createQuery("from Master master where master.slave.oid=:oid");
query.setParameter("oid", 1);
System.out.println("Requete sur l'oid");
for (Object object : query.list())
{
System.out.println(object);
}
query = session.createQuery("from Master master where master.slave=:slave");
query.setParameter("slave", slave);
System.out.println("Requete sur l'objet");
for (Object object : query.list())
{
System.out.println(object);
}
tx.commit();
Full stack trace of any exception that occurs:Code:
Hibernate: select gen_id( hibernate_sequence, 1 ) from RDB$DATABASE
Requete sur l'oid
Hibernate: insert into Slave (libelle, oid) values (?, ?)
Hibernate: insert into Master (libelle, oid) values (?, ?)
Hibernate: select master0_.oid as oid0_, master0_.libelle as libelle0_ from Master master0_ where master0_.oid=?
Master@1fc6e42
Exception in thread "main" java.lang.NoClassDefFoundError: master (wrong name: Master)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:95)
at org.hibernate.util.ReflectHelper.getConstantValue(ReflectHelper.java:128)
at org.hibernate.hql.ast.QueryTranslatorImpl$JavaConstantConverter.handleDotStructure(QueryTranslatorImpl.java:569)
at org.hibernate.hql.ast.QueryTranslatorImpl$JavaConstantConverter.visit(QueryTranslatorImpl.java:564)
at org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(NodeTraverser.java:40)
at org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(NodeTraverser.java:41)
at org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(NodeTraverser.java:41)
at org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(NodeTraverser.java:42)
at org.hibernate.hql.ast.util.NodeTraverser.traverseDepthFirst(NodeTraverser.java:33)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:254)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
at Test.main(Test.java:32)