Modify save problem in SSH

If an entity in pojo has a relationship with other entities, that is, other entities are referenced, the id attribute of the referenced entity must be written in the form of input hidden in the modified jsp page, and only when submitting and saving can the The information related to the referenced object is saved, otherwise it cannot be saved, and it will even be saved as empty information.

If there is a one-to-many relationship between user entity and product, when modifying product, be sure to put product.user.id in the modification page <input type="hidden" name="product.user.id" value="$ {product.user.id} " />, otherwise, when submitting the modification, it will prompt the existence of transient object unsaved when flushing.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326347191&siteId=291194637