Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General 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
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic