Meaningless Drivel is fun!*
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
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate\JPA set field" Watch "Hibernate\JPA set field" New topic

Hibernate\JPA set field

Niall Loughnane
Ranch Hand

Joined: Dec 07, 2006
Posts: 208

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?


Bill Gorder

Joined: Mar 07, 2010
Posts: 1648

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]
jQuery in Action, 2nd edition
subject: Hibernate\JPA set field
Similar Threads
Topic is not saved in correct encoding when I post in Tradit
Bug fix for deleting posts
how to see the posts page after u login
About topic_last_post_id
constant error problem