aspose file tools*
The moose likes Object Relational Mapping and the fly likes Why is Hibernate updating after a select? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Why is Hibernate updating after a select?" Watch "Why is Hibernate updating after a select?" New topic
Author

Why is Hibernate updating after a select?

Steve Vittoria
Ranch Hand

Joined: Jan 12, 2005
Posts: 33

Hi everyone,

I have a wierd problem with my code. I'm using JPA/Hibernate, and for some odd reason (well odd to me at least), Hibernate is performing an update on very row in my table after doing a select. When I make a call to a method that simply does "from OwordDocuments" to return a List of OwordDocuments object, Hibernate befores an update on every row in my table. I noticed that when I switch one of the fields in my table from a TemporalType.TIMESTAMP to TemporalType.DATE, this update does not occur. Why is that?

Here is my class that was generated by Hibernate...


As I said, when I switch the field updateDate on line 158 to @Temporal(TemporalType.DATE), this update does not happen.

Here is my class that executes the select...


Any ideas why the updates are happening, and how I can stop it from happening?
 
Consider Paul's rocket mass heater.
 
subject: Why is Hibernate updating after a select?