nemo-ufes / frameweb-vp-plugin

FrameWeb Plugin for Visual Paradigm
Apache License 2.0
1 stars 1 forks source link

Add support for cascade and fetch constraints to persistent class association ends (Entity Model) #12

Closed vitorsouza closed 1 year ago

vitorsouza commented 1 year ago

Expected behavior:

The behavior to be implemented is very similar to what has already been implemented for adding collection=... constraints to association ends of persistent classes in Entity packages (see #10):

  1. Right-click an association end of an association between persistent classes in an Entity package;
  2. Select Add FrameWeb Constraint > cascade=none;
  3. The constraint cascade=none is added to the selected association end.

Same for cascade=persist, =merge, =remove, =refresh and =all. All of these constraints are disjoint with one another and only one of them can be applied to the same association end at the same time.

After implementing the cascade=... constraints, also implement fetch=lazy and =eager, which also form another disjoint set.

Should also work if the association involves a mapped superclass. Should not be enabled for associations with transient classes.

Example: in the Oldenburg example Entity Model, right-click the association end of the assocation between Submission and Review (on the Review side) and add fetch=eager and cascade=all constraints to it.