-->
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.  [ 7 posts ] 
Author Message
 Post subject: schemaexport
PostPosted: Thu Apr 15, 2004 12:08 pm 
Newbie

Joined: Thu Apr 15, 2004 12:00 pm
Posts: 13
Currently I am using this tool to generate ddl by using mapping documents.

Actually we have a set of standards we need to follow like.. for table name it should start with "PTM_" etc.

Let's assume that in the mapping document I have specified table name as "TEST". Is it possible to read all standards from a file and verify the mapping documents, if not following, apply the standards and finally generate ddl?

For examples in the above specified case...
eventhough I have specified table name as "TEST" in the mapping file, is it possible to generate the ddl with "PTM_TEST"(As per standards). I mean with out modifying mapping document?

I appreciate your quick response.

-Thanks
Sudhir


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 15, 2004 12:10 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
You need a custom NamingStrategy, see the documentation.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 15, 2004 1:26 pm 
Newbie

Joined: Thu Apr 15, 2004 12:00 pm
Posts: 13
Thanks for your reply. Actually documentation doesn't provide much details. Can you please give me an example for how to use this NamingStrategy?

I tried by including net.sf.hibernate.cfg.NamingStrategy=ImprovedNamingStrategy.INSTANCE in hibernate.properties file... but I didn't see any difference.

-Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 15, 2004 2:53 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Read the source code of that class, implement your own, plug it in as described in the documentation.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 15, 2004 3:38 pm 
Newbie

Joined: Thu Apr 15, 2004 12:00 pm
Posts: 13
Thanks for your reply. Yes I have implemented NamingStrategy interface and was able to apply the standards for both table name and column names.

Is there any way to apply the standards on the rest? Like. Foreign key constraint etc.

I appreciate your quick response.

-Thanks
sudhir


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 15, 2004 3:46 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
I don't think so, this is actually a feature request that makes sense. Put it in JIRA.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 15, 2004 3:50 pm 
Newbie

Joined: Thu Apr 15, 2004 12:00 pm
Posts: 13
Thanks for your great help. I will add it.

-Sudhir


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