-->
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: Dynamic SQL populating the same Java Class
PostPosted: Wed Jul 02, 2008 3:47 pm 
Newbie

Joined: Wed Jul 02, 2008 3:39 pm
Posts: 3
Hi

I have requirement where my Select queries changes to different tables to fetch key and value. I am using the same class(TempVO) with attributes key and value for all queries.

For each time when the query changes it fetches two fields from the corresponding table one is key and the other is value.

I appreciate any help on this.

Thanks
Sedhu


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 04, 2008 1:09 pm 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
So, you have one class that you are mapping to many, potentially an infinite number, of tables?

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject: Dynamic Mapping
PostPosted: Mon Jul 07, 2008 11:12 am 
Newbie

Joined: Wed Jul 02, 2008 3:39 pm
Posts: 3
Cameron McKenzie wrote:
So, you have one class that you are mapping to many, potentially an infinite number, of tables?


Yes, thats what I am trying to do.

Say "select key1, value1 from Table1"

"select key2, value2 from Table2"


Note table names are changing I want the selected key and value to be mapped to the java class say "TempVO" which contains key and value as attribute name.


I appreciate your help and thanks for the reply.

Thanks
Sedhu


Top
 Profile  
 
 Post subject: Dynamic Mapping
PostPosted: Mon Jul 07, 2008 11:13 am 
Newbie

Joined: Wed Jul 02, 2008 3:39 pm
Posts: 3
Cameron McKenzie wrote:
So, you have one class that you are mapping to many, potentially an infinite number, of tables?


Yes, thats what I am trying to do.

Say "select key1, value1 from Table1"

"select key2, value2 from Table2"


Note table names are changing I want the selected key and value to be mapped to the java class say "TempVO" which contains key and value as attribute name.


I appreciate your help and thanks for the reply.

Thanks
Sedhu


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.