-->
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: Eclipse RCP and Hibernate -> Error
PostPosted: Mon Feb 01, 2010 9:32 am 
Beginner
Beginner

Joined: Thu Nov 26, 2009 8:20 am
Posts: 23
Hello,
I am working on an editor based on GEF. I want to save and load the complete model from a database using hibernate.
I put the following libraries to the classpath of the plugin:


antlr-2.7.6.jar
commons-collections-2.1.1.jar
dom4j-1.6.1.jar
hibernate3.jar
javassist.jar
jta.jar
log4j-1.2.13.jar
mysql-connector-java-5.1.11-bin.jar
jb3-persistence.jar
asm-attrs.jar
asm.jar
c3p0-0.9.0.jar
cglib-2.1.3.jar
commons-logging-1.0.4.jar
dom4j-1.6.1.jar
hibernate-annotations.jar
hsqldb.jar
jboss-archive-browsing.jar
jta.jar

Now I tried to test some simple code but I always get an IllegalArgumentException:

Caused by: org.hibernate.hql.ast.QuerySyntaxException: DiagramElement is not mapped [delete from DiagramElement]
at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:158)
at org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:87)
at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:70)
at org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:265)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3056)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2945)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:688)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.deleteStatement(HqlSqlBaseWalker.java:417)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:245)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
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 org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:92)
... 44 more



I do not know how to solve the problem. It seems that something of the plugin-path is wrong because if I add a Class with a main and run its main with the same code as Java-Application everything works fine..

I would really appreciate any help!
Thanks in advance & best regards
Alex


Top
 Profile  
 
 Post subject: Re: Eclipse RCP and Hibernate -> Error
PostPosted: Mon Feb 01, 2010 11:01 am 
Beginner
Beginner

Joined: Thu Nov 26, 2009 8:20 am
Posts: 23
Hello,
I solved the problem, but the solution isn't nice at all.
Changing the Query
from DiagramElement
to
from my.example.package.DiagramElement
is the solution.

Now the question is how to get the classes withot the package-path in the queries?

All ideas welcome :D

Thanky in advance & best regards
Alex


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.