Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Eclipse plugin with Hibernate
Eclipse plugin with Hibernate [message #511342] Mon, 01 February 2010 11:38 Go to next message
Alexander Mack is currently offline Alexander Mack
Messages: 100
Registered: July 2009
Senior Member
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 a 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
Re: Eclipse plugin with Hibernate [message #511417 is a reply to message #511342] Mon, 01 February 2010 14:59 Go to previous messageGo to next message
Alexander Mack is currently offline Alexander Mack
Messages: 100
Registered: July 2009
Senior Member
Edit:
Sorry, thought I solved the problem but it still exists

[Updated on: Mon, 01 February 2010 15:13]

Report message to a moderator

Re: Eclipse plugin with Hibernate [message #511466 is a reply to message #511342] Mon, 01 February 2010 16:32 Go to previous message
Alexander Mack is currently offline Alexander Mack
Messages: 100
Registered: July 2009
Senior Member
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 Very Happy

Thanky in advance & best regards
Alex
Previous Topic:Pb with IInputValidator
Next Topic:Custom StatusHandler subclassing problem
Goto Forum:
  


Current Time: Thu Sep 18 01:50:15 GMT 2014

Powered by FUDForum. Page generated in 0.06356 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software