Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Hibernate cross bundle mapping with annotations
Hibernate cross bundle mapping with annotations [message #501930] Fri, 04 December 2009 14:03 Go to next message
Sascha Zak is currently offline Sascha ZakFriend
Messages: 11
Registered: July 2009
Junior Member
Hi all,

I've got a problem using hibernate's AnnotationConfiguration with
annotated "persistence classes" and different bundles.

The goal is to have an abstract persistence bundle which offers a
service for other bundles to persist their (JPA annotated) model
classes. This abstract persistence bundle provides the necessary
interfaces and deletgates calls to a concrete persistence strategy,
e.g. a database using hibernate encapsulated in another bundle or
fragment.

Therefore there has to be an extension point where bundles publish
their persistence classes so that Hibernate (the AnnotationConfiguration
class) can create mappings and a SessionFactory.

The main problem is, that the subsequent methods of the
AnnotationConfiguration, although receiving the class objects from the
extension point, calls the classloader to process the mappings. This
naturally fails, because the persistence classes are defined in other
bundles.

A workaroud is to use the Eclipse buddy mechanism, which smells dirty
for me and has to be always kept in mind, otherwise one can spend much
time in finding out the reason of the mapping exceptions.

Does anyone knows a solution without using the buddy mechanism?
Any hint is welcome.

Thanks in advance.

Sascha
Re: Hibernate cross bundle mapping with annotations [message #502106 is a reply to message #501930] Sat, 05 December 2009 19:14 Go to previous messageGo to next message
Michael Golovanov is currently offline Michael GolovanovFriend
Messages: 37
Registered: October 2009
Member
Hi,
At this situation i use buddy loading and dont have problems.

You can see how this implemented in EclipseLink (http://wiki.eclipse.org/EclipseLink) and use this framework for JPA in Eclipse
Re: Hibernate cross bundle mapping with annotations [message #502216 is a reply to message #502106] Mon, 07 December 2009 09:25 Go to previous message
Sascha Zak is currently offline Sascha ZakFriend
Messages: 11
Registered: July 2009
Junior Member
Michael Golovanov wrote:
> Hi,
> At this situation i use buddy loading and dont have problems.
>
> You can see how this implemented in EclipseLink
> (http://wiki.eclipse.org/EclipseLink) and use this framework for JPA in
> Eclipse

Thanks, but as described I want to avoid buddy class loading...
Previous Topic:Check menu contribution items based upon object state
Next Topic:Interaction with browser widget
Goto Forum:
  


Current Time: Fri Apr 26 01:33:17 GMT 2024

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

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

Back to the top