-->
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.  [ 3 posts ] 
Author Message
 Post subject: Column property generation
PostPosted: Wed Dec 19, 2007 2:33 pm 
Newbie

Joined: Thu Jun 23, 2005 12:25 pm
Posts: 7
I have a table with two relationships coming in from another table. The foreign keys are named test1_id and test2_id in the database. In my reverse engineering file I have this to generate test1 and test2. Hibernate isn't generating either of these two it comes up with its own naming. Does anyone know where this is coming from?

hibernate.reveng.xml
<table schema="SOAUSER" name="CLASS" class="Class">
<primary-key>
<generator class="sequence"></generator>
<key-column name="class_Id" type="Integer" />
</primary-key>
<column name="Test1_ID" property="test1" type="Integer"/>
<column name="Test2_ID" property="test2" type="Integer"/>
</table>


Generated Code
private Integer classId;
private Test testByTest1Id;
private Test testByTest2Id;

I looked at the definition in the database to see if there is extra notes that are being carried along.

Any ideas on how to change the column names to what you want them to be? Or in this case, what the database and mapping file says that it is.

Thank you.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 20, 2007 8:59 pm 
Newbie

Joined: Mon Oct 29, 2007 2:33 pm
Posts: 16
Location: Cambridge, MA
I think class="Class" could be a big problem. You need a usable class name here, say TestClass.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 14, 2008 3:49 pm 
Newbie

Joined: Thu Jun 23, 2005 12:25 pm
Posts: 7
True. This does need to be a useable class, however, that is not the focus of the question. I am more concerned with the Column names that it is generating.


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