-->
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.  [ 4 posts ] 
Author Message
 Post subject: Preserving case with Oracle
PostPosted: Mon Jun 04, 2007 10:46 pm 
Newbie

Joined: Thu Dec 28, 2006 5:24 pm
Posts: 14
I am using the Oracle9Dialect and 3.2.0.beta9a of Hibernate Tools. I am using JPA/EJB3 and Seam.

My build will create the DDL (using hbm2ddl) for my Entity beans. I use this DDL to create the tables and constraints in Oracle (Express).

Then, if I use seam-gen generate-entities to reverse engineer a CRUD app from the database tables, I notice that my camel case isn't the same.

For example, it would seem that:

(Original Java) -> (Oracle) -> (reverse engineered Java)
replacementDate -> REPLACEMENTDATE -> replacementdate

I would think that this translation would be bidirectional, such that:

assert java_column == db2java(java2db(java_column)))


I am thinking that if the Java field name to database column name replaced a camel case transition with an underscore, then the bidirectional property would be maintained.

Is there a flag/option to get what I would expect?

Alternatively, is there a way to activate a "Preserve Case" mode where every table and column name is quoted?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 05, 2007 3:38 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Use org.hibernate.cfg.ImprovedNamingStrategy which uses _ instead of a concatenation.

With respect to quotes you could probably do that by implementing a custom reverse engineering strategy that added backticks for every colum (though I don't think that is a healthy thing ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: persistence.xml
PostPosted: Tue Jun 05, 2007 1:58 pm 
Newbie

Joined: Thu Dec 28, 2006 5:24 pm
Posts: 14
Is there a way that I can specify this in the persistence.xml? (I can't seem to find a hibernate property for naming strategy.)


Top
 Profile  
 
 Post subject: hibernate.ejb.naming_strategy
PostPosted: Tue Jun 05, 2007 2:09 pm 
Newbie

Joined: Thu Dec 28, 2006 5:24 pm
Posts: 14
Never mind, found it: hibernate.ejb.naming_strategy


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