-->
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.  [ 2 posts ] 
Author Message
 Post subject: Union mapping two table with different id column names
PostPosted: Thu Oct 27, 2005 3:58 pm 
Newbie

Joined: Thu Oct 27, 2005 3:20 pm
Posts: 1
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.05

Name and version of the database you are using: Postgres 7.4.3

I am trying to create a union mapping for a legacy database that contains order information.

The legacy database contains order data in one table and order history in another table. The data in these tables is identical. The problem is that if an order is half shipped the order could be in both tables. Therefor, to get complete current, and historical order information you have to do a union on the two tables.

That would be fine except the column names are different for the two tables. For the current order table the id column is named something like s_id, and for the history table the id colum is name h_id.

Could someone tell me if it is possible to do a union mapping with the id columns being different names? I only need to read the database. I don't need to persist the objects back to the database. Thanks in advance.


Top
 Profile  
 
 Post subject: 2c
PostPosted: Sun Oct 30, 2005 1:23 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
I do not think that H is very useful for helping you. I think iBatis SQLMaps could do better job. It will do exactly what you want
http://ibatis.apache.org/

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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