-->
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: Dynamic entities for hibernate
PostPosted: Wed Oct 19, 2011 1:00 pm 
Newbie

Joined: Fri Sep 02, 2011 11:41 am
Posts: 2
Hi everybody, I have some troubles and I need your help.

It turns out that I need to create run-time entities that adapt to user-defined structures, currently I build a runtime class with annotations, I compile the dynamic class and make the instance with the Class.forName method, in addition, I set the hibernate session to add the class using: configuration.addAnnotatedClass ( MyDinamicClass ) and after that I build it the session.

The problem is that although I can use the dynamic instance of my class, I cannot record anything whit it, because I get the error "Unknown entity", It should be mentioned that it does not generate an exception when I do the instance of the dynamic class and when I added to the configuration of the session. I checked the annotations in the dynamic class and apparently I cannot find any of them (using MyClass.getDeclaredAnnotations ()).

It runs on a Java Bean in Jboss 6, the same project runs as expected when it is out of a Java Bean in jboss, I can even read the annotations with which the class was created, also I used ReflectHelper.classForName instead of Class.forName, but the annotations are still missed.

Anyone knows why hibernate cannot recognize the annotations in my class? thanks in advance


Top
 Profile  
 
 Post subject: Re: Dynamic entities for hibernate
PostPosted: Tue Jan 17, 2017 7:38 am 
Newbie

Joined: Tue Jan 17, 2017 7:32 am
Posts: 3
Hi quintero85,

I have ended up with same problem. Did you find the solution if so please let me know how.

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.