Affects Version/s: None
Fix Version/s: None
Per the forum discussion, it would be helpful to have a Strategy mechanism for the Entity/Finder so that addons that change the core Entity/Finders could be written instead of replacements for Entity/Finder.
For example, ROO-191 is a request for Soft Delete functionality, which would affect the Entity ( remove) and Finders ( and deleted=false).
Also http://forum.springsource.org/showthread.php?t=79002 refers to the ability to make Entity and Finder aware of the current user.
If roo allows the specification of 0 to many Strategies on Entity and Finder, users could easily write addon's that accomplished this behavior without having to recreate the entire Entity/Finder addons.
The Strategy interface would have to allow for the custom strategy to perform the following:
1) Add fields to the Entity ( e.g. deleteFlag, user)
2) Modify or Overwrite Entity methods ( e.g. SoftDelete would override remove with a method that would set deleteFlag=true; and then persist
3) Allow for the default customization of Finders, so when a user creates a finder for a softDeleteStrategy entity, it would add " and deleteFlag=false" to the JPA query. For UserAwareStrategy it would get more complex, as it would have to be able to both update the JPA query string ( " and user = :user" ) and to also update the parameters on the query, e.g. query.setParameter("user",user);