disabling and enabling a customizer

View: New views
2 Messages — Rating Filter:   Alert me  

disabling and enabling a customizer

by Vamsee Lakamsani :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I used Shaun's blog tip to filter an association using a customizer (thanks Shaun).
http://onpersistence.blogspot.com/2008/01/customizing-eclipselink-jpaorm.html

As the next step I want to enable and disable this customizer programmatically. The use case is the following:
  • three entities: Schedule, ScheduleVersion and Event
  • Schedule has many ScheduleVersion(s) and each ScheduleVersion has many Event(s).
  • When I query for a Schedule, I only want to see the latest version of the Event list (filtering customizer works great here).
  • When I delete a Schedule, sometimes I want to delete just the latest version and sometimes all the versions (here I was thinking may be disable the customizer and reload/delete the Schedule and re-enable the customizer programmatically).
Is there another way?

thanks.

_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Re: disabling and enabling a customizer

by James Sutherland :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I would not recommend dynamically changing mappings.

Either handle the functionality in your application/data access layer, or perhaps use Descriptor events.

Vamsee Lakamsani wrote:
I used Shaun's blog tip to filter an association using a customizer (thanks
Shaun).
http://onpersistence.blogspot.com/2008/01/customizing-eclipselink-jpaorm.html

As the next step I want to enable and disable this customizer
programmatically. The use case is the following:

   - three entities: Schedule, ScheduleVersion and Event
   - Schedule has many ScheduleVersion(s) and each ScheduleVersion has many
   Event(s).
   - When I query for a Schedule, I only want to see the latest version of
   the Event list (filtering customizer works great here).
   - When I delete a Schedule, sometimes I want to delete just the latest
   version and sometimes all the versions (here I was thinking may be disable
   the customizer and reload/delete the Schedule and re-enable the customizer
   programmatically).

Is there another way?

thanks