File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Murach's Java Servlets and JSP this week in the Servlets 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: 1646
    
    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]
 
It is sorta covered in the JavaRanch Style Guide.
 
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