-->
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: Mapping class to multiple tables
PostPosted: Thu Nov 27, 2008 8:00 pm 
Newbie

Joined: Thu Nov 27, 2008 11:47 am
Posts: 1
Hi,

we have an existing java application which is persisting data to a oracle database using jdbc. I am working on converting the application to use hibernate. application has class structure similar to sample below

class A {
private String id;
private int version;
private String dataA1;
private D d;
.....
}

class B {
private String dataB1;
.......
}

class C extends B {
private String dataC1;
.......
}

class D extends C {
private String dataD1;
private String dataD2;
private String dataD3;
........
}


This has to be mapped to existing tables below

TABLE_A
id (from Class A)
version (from Class A)
dataA1 (from Class A)
dataB1 (from Class B)
dataC1 (from Class C)

TABLE_B
id (from Class A )
version (from Class A )
dataD1 (from Class D)
dataD2 (from Class D)
dataD3 (from Class D)

Table_B and TABLE_B has primary key as version,id. It is difficult
to get data model changed now. Is it possible to map this structure using Hibernate? We are using Hibernate version 3.3.

Thanks in Advance


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 28, 2008 1:16 pm 
Beginner
Beginner

Joined: Wed Nov 19, 2008 6:39 am
Posts: 44
Location: Mumbai, India
It is possible in Hibernate. You can get more idea for this at http://www.hibernate.org/hib_docs/v3/re ... rwork.html


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.