2 Replies Latest reply on Dec 10, 2009 12:18 PM by Eugene Kashin

    EntityHome Update method doesn't update property's value

    Eugene Kashin Newbie
      I am trying to update one of an object's fields to the value entered in a web form. I am doing that exactly as I did with many other entities, directly from the RichFaces page, by calling entityHome.update method, like this:

      <h:commandButton value="Update MyObject" action="#{myObjectHome.update}"/>

      Everything looks well, I've got a printout from the Update() method, that says

      updated entity myApp.entity.MyObject 145

      where 145 is a correct ID for the managed entity. But, in fact, there are no changes in field's value in database. May be the following would be interesting: i tried to dig into the same transaction in other objects, that are updated well and use the  same call to entityHome.update. I noticed, that when performing update of these objects, the setter method of the modified property is called twice. But in case of property that is not willing to be updated, no call to setter method is made, just printing about successful update... Once again - there is nothing specific about problematic entity - everything looks the same as for other entities. Of course, I can workaround this by using some bean and entityManager, but it is pretty silly to do it while all the rest objects in application do it in so simple way. I will appreciate every idea/hint.