-->
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.  [ 6 posts ] 
Author Message
 Post subject: Hibernate Mapping Q
PostPosted: Fri Jan 05, 2007 12:21 pm 
Newbie

Joined: Sun Sep 24, 2006 1:25 am
Posts: 7
I am working on a project that takes in a common code base or SQL, HBM, and POJO files. I take the SQL files and build the database. I use the Hibernate mapping files and POJOs and I hit the ground running.

I have the requirement and capability to add columns to the common tables in the database. For example I add column ‘ticker_symbol’ to the common table ‘business’.

I create a POJO. In this example I create MyBusinessObj class that extends the common POJO BusinessObj. In my new class I include the getter and setter methods for this new ticker_symbol field.

My next step is to create the Hibernate mapping file. This is where I am stuck. Could someone help me out here? Point me in the right direction?

Thanks,
Chuck


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 05, 2007 12:43 pm 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
hibernate tools

http://www.hibernate.org/255.html

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 05, 2007 12:52 pm 
Newbie

Joined: Sun Sep 24, 2006 1:25 am
Posts: 7
I should have mentioned this. I cannot just regenerate the mapping file out. The common mapping file has been tweaked for optimization.

I also cannot just add to this original mapping file. I do not have the privilege to.

I want to have a new mapping file extend from the common one.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 05, 2007 1:01 pm 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
ohh, I missed that line. I don't know if you can extend mapping files.

But I know you can extend classes. Can you copy what's in that mapping file and just make a new one?

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 05, 2007 1:23 pm 
Newbie

Joined: Sun Sep 24, 2006 1:25 am
Posts: 7
I can as an absolute last resort ... but do not want to. If the common mapping changed I do not want to be respondsible to update my local copy.


Top
 Profile  
 
 Post subject: Solution
PostPosted: Fri Jan 12, 2007 12:10 pm 
Newbie

Joined: Sun Sep 24, 2006 1:25 am
Posts: 7
I cannot say I found what I wanted ... but my solution is to create a sub class. So I would create a new table that would just contain the business id and the ticker symbol.


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