Hi again nordborg,
Sorry for being so late. I have been doing some testing and i think hibernate thinks that the two Profile objects are equals.
if i print the creationDate before calling insert, i get the same exact value for both objects.
This is the sql debug the first time i make an insert:
Code:
Hibernate: select this_.id as id1_0_, this_.login as login1_0_, this_.password as password1_0_, this_.creation_date as creation4_1_0_, this_.id_profile as id5_1_0_, this_.id_category as id6_1_0_ from gatalents_user this_ where this_.login=?
Tue Dec 23 17:23:24 CET 2008
Hibernate: select nextval ('gatalents_user_id_seq')
Hibernate: select nextval ('gatalents_profile_id_seq')
Hibernate: select nextval ('gatalents_resource_id_seq')
Hibernate: insert into gatalents_profile (name, first_surname, second_surname, dni, birth_date, id_gender, id_province, id_country, city, zip_code, address, first_phone_number, second_phone_number, email, web_link, description, creation_date, id_category, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Hibernate: insert into gatalents_user (login, password, creation_date, id_profile, id_category, id) values (?, ?, ?, ?, ?, ?)
Hibernate: insert into gatalents_resource (title, description, file_name, file_path, creation_date, id_category, id) values (?, ?, ?, ?, ?, ?, ?)
Hibernate: update gatalents_resource set id_user=? where id=?
Hibernate: select this_.id as id1_0_, this_.login as login1_0_, this_.password as password1_0_, this_.creation_date as creation4_1_0_, this_.id_profile as id5_1_0_, this_.id_category as id6_1_0_ from gatalents_user this_
and this is the sql generated the second time:
Code:
Hibernate: select this_.id as id1_0_, this_.login as login1_0_, this_.password as password1_0_, this_.creation_date as creation4_1_0_, this_.id_profile as id5_1_0_, this_.id_category as id6_1_0_ from gatalents_user this_ where this_.login=?
Tue Dec 23 17:23:24 CET 2008
Hibernate: select nextval ('gatalents_user_id_seq')
Hibernate: select nextval ('gatalents_resource_id_seq')
Hibernate: insert into gatalents_user (login, password, creation_date, id_profile, id_category, id) values (?, ?, ?, ?, ?, ?)
Hibernate: insert into gatalents_resource (title, description, file_name, file_path, creation_date, id_category, id) values (?, ?, ?, ?, ?, ?, ?)
Hibernate: update gatalents_profile set name=?, first_surname=?, second_surname=?, dni=?, id_gender=?, id_province=?, id_country=?, city=?, zip_code=?, address=?, first_phone_number=?, second_phone_number=?, email=?, web_link=?, description=?, id_category=? where id=?
Hibernate: update gatalents_resource set title=?, description=?, file_name=?, file_path=?, id_category=? where id=?
Hibernate: update gatalents_resource set id_user=? where id=?
Hibernate: update gatalents_resource set id_user=? where id=?
Hibernate: select this_.id as id1_0_, this_.login as login1_0_, this_.password as password1_0_, this_.creation_date as creation4_1_0_, this_.id_profile as id5_1_0_, this_.id_category as id6_1_0_ from gatalents_user this_
Any other idea? thanks for being so helpful