+1 because of power. I like my idea better because of usability.
However - perfectly fine with the enum.
On 20.06.2011, at 19:48, Pinaki Poddar wrote:
> Hi,
> Useful suggestion, semantically.
>
> Syntactically, How about the following:
>
>
> /**
> * User visible persistent states of an entity.
> */
> public enum LifeCycleState {NEW, DIRTY, CLEAN, DELETED};
>
> /**
> * Gets the persistent types whose instances are in any of the given lifecycle states in this context.
> */
> Set<Class<?>> meta = EntityManager#getClasses(EnumSet<LifyCycleState> states);
>
>
> /**
> * Gets the persistent entities that are in any of the given lifecycle states in this context.
> */
> Set<Object> instances = EntityManager#getEntities(EnumSet<LifyCycleState> states, Class<?> classes);
>
>
>
> Regards --
>
> Pinaki Poddar
> Apache OpenJPA Project Chair http://openjpa.apache.org/
> JPA Expert Group Member
> Application & Integration Middleware
>
>
>
>
>
>
>
>
> From: Adam Bien <abien_at_adam-bien.com>
> To: jsr338-experts_at_jpa-spec.java.net
> Date: 06/19/11 01:20 AM
> Subject: [jsr338-experts] Re: Standardized Access to ChangeSet
>
>
>
> Hi Werner,
>
> I searched in the proposal and in the mailing lists but couldn't find anything similar.
>
> I'm happy with another solution as well.
>
> adam
> On 18.06.2011, at 13:48, Werner Keil wrote:
>
> > Why the different name pattern for the last proposed?
> > They would all fulfill the same purpose.
> >
> > Cheers,
> > Werner
> >
> > -------- Original-Nachricht --------
> >> Datum: Sat, 18 Jun 2011 13:06:03 +0200
> >> Von: Adam Bien <abien_at_adam-bien.com>
> >> An: jsr338-experts_at_jpa-spec.java.net
> >> Betreff: [jsr338-experts] Standardized Access to ChangeSet
> >
> >> HI All,
> >>
> >> I would like to propose additional EntityManager methods:
> >>
> >> Set<Class> updated = EntityManager#getUpdatedEntities(Class<T>.class);
> >> Set<Class> deleted = EntityManager#getDeletedEntities(Class<T>.class);
> >> Set<Class> created = EntityManager#getCreatedEntities(Class<T>.class);
> >> Set<Class> dirty = EntityManager#getDirty(Class<T>.class);
> >>
> >> We had to use provider-specific EntityManager extensions to access the
> >> dirty entities for the implementation of replication or historization.
> >>
> >> Such methods would be also useful for debugging purposes,
> >>
> >> thanks in advance,
> >>
> >> adam
> >>
> >>
> >
> > --
> > NEU: FreePhone - kostenlos mobil telefonieren!
> > Jetzt informieren: http://www.gmx.net/de/go/freephone
>
>
>