-->
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: Use Hibernate in Karaf with External Model and Config Data
PostPosted: Thu Jul 06, 2017 5:23 pm 
Newbie

Joined: Thu Jul 06, 2017 5:07 pm
Posts: 2
Hello,

I am struggling with implementing some basic persistence as a service in Karaf using Hibernate.

I started with an example where all the hibernate annotated classes were contained in a "dto" folder which was part of the feature's bundle. I exported the dto package and everything worked fine.

My ultimate goal is to have several features that implement persistence using Hibernate. I would prefer to keep the dto classes where they are, in a library external to all the hibernate enabled features. I ran into issues when I tried to have two separate bundles manage different DTO files contained in the same package within an external library. It appears that the second kar loaded is wired to the first, since it exports the classes in this package.

I also have a need to provide the database properties that are typically in persistence.xml from an external file. I understand how to do this with blueprint, but it requires that I make each property part of the bean. Is there a way to load all the properties from an external file and use them to create the EntityManager instance?

Thanks


Top
 Profile  
 
 Post subject: Re: Use Hibernate in Karaf with External Model and Config Data
PostPosted: Wed Aug 09, 2017 9:44 am 
Newbie

Joined: Thu Jul 06, 2017 5:07 pm
Posts: 2
Still trying to figure out the external library.

I created a bundle from that library that exports the Hibernate annotated classes.

My other bundles that use these classes depend on that bundled library and import the classes. Hibernate however is not satisified with the imported classes and says that the classes are not mapped.

Anyone ever do this with an external library? Anyone out there?

Thanks


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.