-->
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.  [ 1 post ] 
Author Message
 Post subject: Using a stored procedure for updating a column
PostPosted: Mon Feb 09, 2009 10:11 am 
Newbie

Joined: Mon Feb 09, 2009 9:53 am
Posts: 2
Location: Raleigh, NC
I have a database table, and I would like to override the SQLUpdate with the following (Hibernate 3):

@SQLUpdate = (sql = "UPDATE person_user SET description = ?, facility = ?, person_id = ?, slot_number = ?, modify_date = current_utc_date(), modify_time = current_utc_time() WHERE id = ?")

Now, notice that modify_date and time are not using the current values in the object, and there are more columns in the class than placeholders. How do I do this?

Also, the class is declared like so, and I need to know if the declared column order is how the statement gets generated, or is it by the name?

@Column(name="description")
private String description;


@Column(name="facility")
private Integer facility;


@Column(name="modify_time")
private Integer modify_time;


@Column(name="modify_date")
private Integer modify_date;


@Column(name="slot_number")
private Integer slot_number;


@Column(name="person_id")
private Integer person_id;


@Column(name="id")
private Integer id;


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.