-->
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.  [ 3 posts ] 
Author Message
 Post subject: Help me with run-time built JavaBean persistence
PostPosted: Tue Feb 22, 2011 7:43 pm 
Beginner
Beginner

Joined: Mon Jun 28, 2010 1:02 pm
Posts: 21
I have to import a series of records from a file input. The schema of the data is only known during run-time. DynaBeans are dropped long time ago (https://forums.hibernate.org/viewtopic.php?t=937247), so let's say I build up a JavaBean dynamically from the data run-time. How can I persist that?
Hibernate documentation's chapter 4.4 on Dynamic models only talks about Hash property collections (http://docs.jboss.org/hibernate/core/3.3/reference/en/html/persistent-classes.html#persistent-classes-dynamicmodels), but the bigger problem is that even this example needs xml configuration compile time (if I undertsand it correctly)! Which is nonsense, because I don't know the schema in advance, that's why I'll have to use JavaBeans, and I also won't be able to provide a mapping in advance, I don't know the class property<->table columns in advance, only run-time!

So how can I do that? Can you give me some example codes, links? Explanation?
Thanks,
Csaba Toth


Top
 Profile  
 
 Post subject: Re: Help me with run-time built JavaBean persistence
PostPosted: Fri Feb 25, 2011 11:48 am 
Beginner
Beginner

Joined: Mon Jun 28, 2010 1:02 pm
Posts: 21
In another topic I've found some solution, which partially matches my needs:
http://www.infoq.com/articles/hibernate-custom-fields
The question is that is there any way to do this technique with code annotations (I mean the "dynamic-component" hibernate mapping XML tag specifically), and how to integrate the proposed thing into a Spring-Hibernate app, where EntityManager and other details are hidden/abstracted away from you.


Top
 Profile  
 
 Post subject: Re: Help me with run-time built JavaBean persistence
PostPosted: Fri Feb 25, 2011 11:50 am 
Beginner
Beginner

Joined: Mon Jun 28, 2010 1:02 pm
Posts: 21
Other related topics:
https://forum.hibernate.org/viewtopic.php?f=1&t=990780
https://forum.hibernate.org/viewtopic.php?f=9&t=950432


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.