-->
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: which is the best way to insert ?
PostPosted: Tue Aug 23, 2005 5:00 am 
Newbie

Joined: Fri May 13, 2005 5:20 am
Posts: 6
Hello,

I'm not sure how to solve my problem the best way:

I'm working with hibernate 3.1 alpha 1, Hibernate Annotations 3.1 , EntityManager 3.0.

I have lots of tables with lots of relations in-between.
I want to fill my tables by reading the datas out of a textfile. At the time I'm reading my datas, it is possible to identify the table, and the sort of datas that have to be stored. This all is fully dynamical.
Now begins my problem. I have my new dataset and I know the table where the datas should be inserted. Is it possible to take native sql for an insert, is it possible in any way that hibernate also updates all the relations?
Or is it better to write my datas in pojos and then save that pojo?

I hope anybody can give me an advice how to solve this problem in the best way!

Thanks,

Gaby


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 23, 2005 8:28 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I use dbUnit for prepopulation of data (test or otherwise) into my databases. dbUnit can also create the XML dataset by extracting the data snapshot from the database. There are other methods aswell, insert scripts work fine - usually have less issues if you drop the constraints, do the load then re-apply constraints.


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.