-->
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.  [ 2 posts ] 
Author Message
 Post subject: QueryTranslator problem with 3.2.0-cr3
PostPosted: Wed Jul 12, 2006 3:32 am 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
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)

_________________
Seb
(Please don't forget to give credits if you found this answer useful :)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 12, 2006 10:16 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Well, they are different issues, so a new JIRA case please...


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

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.