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: Multiple members on an iSeries (AS/400) database
PostPosted: Fri Dec 10, 2004 3:35 pm 
Beginner
Beginner

Joined: Wed Nov 24, 2004 10:54 am
Posts: 48
I am running Hibernate 2.1.7. I am attaching to an existing database schema on an iSeries (AS/400). I have a physical file on the iSeries that has multiple members. How to I tell Hibernate to grab a specific member in a physical file that has multiple members?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 13, 2004 11:13 am 
Beginner
Beginner

Joined: Wed Nov 24, 2004 10:54 am
Posts: 48
OK, I found the answer to my question. Just in case anyone else has this issue.

You use a CREATE ALIAS. Here is an example

If you have a physical file name SALES that has a member for each month and you want to get JANUARY, here is the SQL command

CREATE ALIAS MYLIB/SALES_JANUARY FOR MYLIB/SALES(JANUARY)

Then you can use a select statement like...

SELECT * FROM SALES_JANUARY.

My only question here is, is there a way in Hibernate to dynamically map a table? With this type if issue, I will not always know the table name by which I am pulling the data. In my situation, the multiple members have a dynamic name (by seq number). I really would like to use HQL if at all possible.

Thanks


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.