"Problems encountered by your project":
New delete can be implemented, that is, when the change cannot be synchronized update design three classes: Problem class Scask body content class Text Class View number + reply number + discussion number of Runinfo class
"Body class and number of views + replies + Number of discussion classes cannot be modified update"
Background changed annotation success
"Reference blog: http://blog.sina.com.cn/s/blog_9b81777f0101gn3f.html"
Cascade representing cascading operations
Cascadetype.merge Cascade Update: If the Items property is modified then the order object is saved and the objects in items are modified at the same time. The merge method corresponding to Entitymanager
Cascadetype.persist Cascade Refresh: Gets the object in the order object that also retrieves the latest items at the same time. The Refresh (object) method corresponding to the Entitymanager is valid. will re-query the latest data in the database
Cascadetype.refresh: The objects in items are also saved when the order object is saved. The Presist method of corresponding Entitymanager
Cascadetype.remove Cascade Delete: Delete the Order object as well as the objects in items. Remove method corresponding to Entitymanager
Cascadetype.persist a cascade B object is added when only Class A is added. If the B object is in the data inventory (followed by the new) then throw an exception (let B become persistent state)
Cascadetype.merge refers to a class of new or changed, cascading B objects (new or changed)
Cascadetype.remove only Class A delete, cascade delete Class B;
Cascadetype.all contains all;
Cascadetype.refresh didn't work.
In general: Most of the cases with Cascadetype.merge can achieve cascade with new and not error, use Cascadetype.all to consider Cascadetype.remove
@Fetch:
Defines the fetch policy that loads the associated relationship. Fetchmode can be
Select (Triggers a SELECT operation when an association is required), Subselect (valid for collection only, subquery policy is used, details refer to Hibernate reference document)
Join (Use SQL join to load the association relationship when loading the primary entity).
Join will overwrite any deferred attributes (the associations loaded through the join policy will no longer be deferred).
Hibernate cascade (Cascadetype attribute of hibernate annotations)