-->
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: Hibernate/Postgres & Mixed Case Table/Column names?
PostPosted: Thu Jun 07, 2007 2:23 pm 
Newbie

Joined: Thu Jun 07, 2007 1:29 pm
Posts: 2
I am not using Hibernate, but am in a project where another group *is* and I'm being told that Hibernate cannot handle mixed case table/column names in a PostgreSQL database. I'm having a hard time believing this, and so am posting here as a sanity check. The claim is that the produced Java will not compile. At this point I don't know the details.

So, I'd very much like to hear from anyone who HAS ACTUALLY USED Hibernate/Postgres and dealt with this problem. We're trying to avoid the ripple effect of having to go back and change an already existing schema to accommodate this claimed limitation of Hibernate.

Thanks in advance.

Bill


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 07, 2007 3:49 pm 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
you can write your own naming strategy :)

http://www.hibernate.org/hib_docs/v3/ap ... ang.String)

http://www.hibernate.org/hib_docs/v3/ap ... ategy.html


fyi
Hibernate cannot handle if your first or second letter on the java bean attribute name is mixed cases as it uses reflection and normal java conventions to set those values and will get all screwy

_________________
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: Thu Jun 07, 2007 4:58 pm 
Newbie

Joined: Thu Jun 07, 2007 1:29 pm
Posts: 2
kochcp
Thanks for the response. Is it the case that Hibernate is "normally" used to synthesize a database schema (and associated DAC) in order to support persisting an object model -- or is it also intended to synthesize the object model given a database schema? The NamingStrategy seems to imply the former. I had assumed the latter; i.e., given a (legacy) database synthesize the code to objectify the data. Please forgive my ignorance about Hibernate.

Thanks again,
Bill


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 08, 2007 8:09 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
It does both equally well. Hibernate was designed from the ground up to support new development and legacy database systems. Though, it is much easier use hibernate on newly developed database schemas.

But, they can only predict so many ways to name things, so that is why the naming strategy is a built-in extension point.

_________________
Chris

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


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.