-->
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.  [ 3 posts ] 
Author Message
 Post subject: question about Query
PostPosted: Mon Nov 29, 2004 12:46 pm 
Newbie

Joined: Mon Nov 29, 2004 12:36 pm
Posts: 2
I have a quick question!

Is it possible to do something like this in a Query (and how do I do it?):

"select new MyObject('randomString', table.col1) from my_table table" ?

My problem is that "MyObject" has a constructor that requires a string that is not available in "my_table" so I want to provide a default value through Hibernate.

Of course I can iterate the result of the Query and insert the default value manually but it would be nice to be able to do it in the Query.

I could not find any information about this in the documentation...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 29, 2004 12:53 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
No, not possible yet.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 29, 2004 12:58 pm 
Newbie

Joined: Mon Nov 29, 2004 12:36 pm
Posts: 2
Ok, thanks for your reply!


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