File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why is Hibernate updating after a select?

 
Steve Vittoria
Ranch Hand
Posts: 35
Eclipse IDE Java Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic