wood burning stoves*
The moose likes Object Relational Mapping and the fly likes Cannot update object - Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Cannot update object - Hibernate" Watch "Cannot update object - Hibernate" New topic
Author

Cannot update object - Hibernate

Diego Creador
Greenhorn

Joined: Jan 10, 2011
Posts: 24
Hello Friends!

Im using hibernate in my project, and I have a problem while trying to update a property of the object.

My object class is like this

private Integer perfilid;
private String nombre;
privateSet <Area> areas;


Whit the setters and getters. And the hbm is like this




The problem is that I cannot update the propertie "areas" . Im doing something wrong?

In the bean the update method I set this way the properties

perfilSelect.setNombre(nombre)
perfilSelect.setAreas(areas);
new PerfilHome().saveOrUpdate(perfilSelect);

Thanks in advance for the help!

Diego
Komal Renu
Ranch Hand

Joined: Jul 21, 2011
Posts: 51
Hi Diego,

Could you please add the error stack trace.
Also, i think that the mapping between Perfil should be one to many. please recheck that.

Thanks,
Komal
Diego Creador
Greenhorn

Joined: Jan 10, 2011
Posts: 24
Hello Komal!

That was the problem

Thanks a lot for the help

Regards
Diego
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot update object - Hibernate
 
Similar Threads
Foreig key must have same number of columns as the referenced primary key
Hibernate Many to Many association does not update database
Composite
hibernate association mistery
Recursive Mapping of collections