File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes problem with update on many-to-one hibernate relationship Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "problem with update on many-to-one hibernate relationship" Watch "problem with update on many-to-one hibernate relationship" New topic
Author

problem with update on many-to-one hibernate relationship

Jeferson Coli
Greenhorn

Joined: Jan 04, 2014
Posts: 1

Hello guys,

I have a problem with hibernate relationship many-to-one.

My system is commercial proposal controller, where has a responsible for proposal from user entity. When the proposal is create and set the responsible, has no problems, works fine. But when change the responsible and update, it changes the object, I can see in a datatable, but has no update in database. If I refresh on page the update disapears.

class proposal


User Class


DAO Code


In the User class I don't make any annotation about this relationship, it's a unidirectional relationship. The class proposal yet use the user class to make a user's bag, as participants, and this relationship will be unidirectional relationship too.

I tried to make annotations in user class but no works too.

User class with annotations




The class User has a many-to-one relationship with userType and it works fine.




Someone has any ideia about this? My head is too hot...

Thanks


Jeferson
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with update on many-to-one hibernate relationship