This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes table/column alias with hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "table/column alias with hibernate" Watch "table/column alias with hibernate" New topic
Author

table/column alias with hibernate

Divan Mostert
Greenhorn

Joined: Jan 24, 2006
Posts: 4
I am hoping that someone can be of help to me as the Hibernate guys are NOT very keen on helping.

So here goes:

When I generate the property element, I use the column attribute foe the actual valid column name and the name attribute to store the original name that corresponds to my application. Now this work 100%

However, when I have a list with a one-to-many inside, I assumed that the table attribute would have the same functionality, but it doesn't. The insert seems to work ok, but when it generates the select statement, it uses the incorrect name attribute of the list.

Can anybody help???
Gerardo Tasistro
Ranch Hand

Joined: Feb 08, 2005
Posts: 362
Can you post the code?
Divan Mostert
Greenhorn

Joined: Jan 24, 2006
Posts: 4
Thanks for the quick reply..

Here is my mapping code:



[code tags added - Paul Sturrock]
[ January 24, 2006: Message edited by: Paul Sturrock ]
Divan Mostert
Greenhorn

Joined: Jan 24, 2006
Posts: 4
Does anyone have an idea???
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: table/column alias with hibernate
 
Similar Threads
fetch="subselect" and fetch="join" not working as expected with HQL
Hibernate lazy property fetching
Cascading non foreign key to Child Table
retrieving object hierarchy - many-to-one?
Id key in .hbm.xml