This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Hibernate\JPA set field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate\JPA set field" Watch "Hibernate\JPA set field" New topic
Author

Hibernate\JPA set field

Niall Loughnane
Ranch Hand

Joined: Dec 07, 2006
Posts: 208
Hi,

i have a field "topicId" that i set the id of the topic,

i use a filter to set the current topic id when doing queries,

but is there anything to set the topicId when doing inserts and updates?

Thanks,

Niall
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1648
    
    7

I don't understand why you would need to set the id on an insert or update. Would these not be generated? Also you typically do not write insert or update queries you just modify the entity and when the transaction is committed hibernate will generate the appropriate update or insert query.


[How To Ask Questions][Read before you PM me]
 
Don't get me started about those stupid light bulbs.
 
subject: Hibernate\JPA set field