-->
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.  [ 1 post ] 
Author Message
 Post subject: Generic Hibernate DAO as Eclipse Plugin
PostPosted: Fri Nov 28, 2008 8:56 am 
Newbie

Joined: Fri Nov 28, 2008 8:28 am
Posts: 1
Hello there,

I have a classloading problem using hibernate in an Eclipse plugin:

I developed a more or less generic hibernate based DAO,
which is working fine. Now I want to provide it's functionality
in an Eclipse RCP application within an own plugin called
"persistence-plugin".

I want to enable other plugins to use it's functionality with
their own entity classes not known by the "persistence-plugin".
Therefore I defined an extension point to publish the entity classes
to the "persistence-plugin", which can update the hibernate
configuration at loadtime and create a sessionfactory containing the
mapping of the entity classes of the "client-plugin".

Via the extension point mechanism I can get an instance of the entity
classes to provide them to the hibernate configuration, but they can't
be loaded by the classloaders from the "persistence-plugin" because
the plugins are separated in OSGI bundles and the "persistence-plugin"
doesn't know about any client plugin.

So if I try to access objects from the database, I get a
MappingException. I think it's because hibernate is unable to
instantiate the entity classes without having them available via
classloaders.

If I could provide an "object factory" or something like that,
I could store the instances gotten from the extensions and create
new objects via Class.newInstance()...

Does anyone have an idea how provide such an "object factory" to
hibernate, or how to solve this problem?

Also thought about a way to store the instances temporarily as class
files... :-)

Thanks a lot!


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

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.