-->
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: Access multiple prefixed tables with one class
PostPosted: Fri Apr 05, 2013 2:10 am 
Newbie

Joined: Thu Apr 04, 2013 11:02 am
Posts: 1
Hello,

I have a question concerning mapping of more than one table to a single class with hibernate and JPA. Here's what I want to do:
I have an existing database with tables that look like the example I put at the end of this post. As you can see I have a table called configuration without prefixes which holds a list of companies, each of them have a identifier. I have also a bunch of tables for each company which are prefixed by a string containing the number for the company.
Is there a possibility to use one class e.g for employee to map all the employee tables. One more thing I want to be able to add a new company during runtime and have hibernate gernerate the prefxed tables if possible.

db
|
|-f01234_employee
|-f01234_company
|-f01234_car
|
|-f09876_employee
|-f09876_company
|-f09876_car
|
|-configuration <- table containing the company numbers


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.