-->
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.  [ 1 post ] 
Author Message
 Post subject: Import CSV files into a database with a bunch of obstacles
PostPosted: Fri Feb 21, 2014 12:54 pm 
Newbie

Joined: Fri Feb 21, 2014 5:42 am
Posts: 2
On the first glance, this seems to be an easy task, but let me explain you the situation:

I have data copies of CSV files from accounts and person. Person - Account a related via a 1:n relationship. I want to import these entities into a mysql database with the help of hibernate. The problem is that there is no knowledge of the foreign key relationship between Person and Account at compile time. That means, i cannot just write:

Code:
   // …
   @ManyToOne
   @JoinColumn(name = "person_id")
   public Person getPerson() {
   return person;
   }
   // …


Accountrecords are composed of different attributefields, dependant from the sort of account (SAP accounts have different attributes than AD accounts for instance). The connecttion between ADSAccount and Person is done via the attributes ADSAccount.SAMAccountName und Person.CentralAccount. For SAP accounts, the connecting attributes are SAPAccount.accnt und Person.CentralSAPAccount. That means, the connecting attributes vary from account type to account type. This said, i have a big problem. How can i tell hibernate at compile time how to connect Account and Person, that is, how shall i define the foreign key relationships?

Hope you understand what i mean. If not, pls ask.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.