I have read a quite few of other people's mysterious Hibernate problems on one forum. Now, I have my own few. Here is one of them.
Hibernate version:
3.2
Code between sessionFactory.openSession() and session.close():
Code:
MyClass r = (MyClass) session.load(MyClass.class, i);
r.setAttribute1(a1);
session.flush();
The above code segment has been modified from the Spring HibernateTemplte class code.
Name and version of the database you are using:PostgreSQL 8.1
The generated SQL (show_sql=true):Code:
Hibernate:
select
my_class0_.id as id2_0_,
my_class0_.producer_id as producer2_2_0_,
my_class0_.trigger_date as trigger3_2_0_,
my_class0_.content as content2_0_
from
bm_my_class my_class0_
where
my_class0_.id=?
I only see the above select statement, but not an insert statement. A similar updating code on another class works correctly. I fail to see any difference between these two updating, but one works while the other doesn't.
What can go wrong here?