-->
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.  [ 5 posts ] 
Author Message
 Post subject: [mapping] Calculated values in insert statement
PostPosted: Wed Oct 25, 2006 4:44 pm 
Newbie

Joined: Tue Oct 03, 2006 6:28 am
Posts: 9
Hi,
I've got a table like this:
TABLE_A:
- ID
- LINK_TYPE
- LINK_PROG
- ENTITY

When I have to insert in this table I'd like to produce this sql statment (I work on an Oracle10 DB):

INSERT INTO TABLE_A
VALUES (?, ?, SELECT MAX(LINK_PROG)+1 WHERE ID=? AND LINK_TYPE=?, ?)

How can obtain this with mapping? Is it possible?
Which is the best solutions?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 3:22 pm 
Newbie

Joined: Tue Oct 03, 2006 6:28 am
Posts: 9
up


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 27, 2006 3:11 pm 
Newbie

Joined: Tue Oct 03, 2006 6:28 am
Posts: 9
Nothing?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 27, 2006 3:53 pm 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
you can define the save statements, check here

http://www.hibernate.org/hib_docs/v3/re ... erysql-cud

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 27, 2006 4:06 pm 
Newbie

Joined: Tue Oct 03, 2006 6:28 am
Posts: 9
mmm...good
I'm going to try!

thanks a lot!


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