Alex Shneyderman wrote:
The UoW is given a MixinType that the client wants to retrieve, and
that will mean that all Entity types that has that Mixin implemented
will be a possible return type. The UoW has no way to know this in a
generic fashion.

lets see an example, say I have code like this:

uow.get( Country.class, isoCode );

UoW knows what I am looking for - Country. Why can't this be relayed to ES ?

But that's a mixin type, not an Entity Type. There could be 5 actual Entity Types implementing that interface! What good is it going to do to the ES?

ES interface looks a bit strange to an uninitiated, any chance someone
could put a few javadocs there?

I'll do that.

The ES could require that Identities are formatted with entity types
according to some syntax, and to ensure such syntax it is easiest if
the IdentityGenerator service is implemented by the ES as well. For

Could you elaborate on how this interaction works? IdentityGenerator
and ES/UoW. Example:

Country country = uow.newEntity( Country.class, isoCode );

but IdentityGenerator has this in its interface:

String generate( Class<? extends Identity> compositeType );

where does id I pass to newEntity go?

The IdentityGenerator is either called by the UoW for you if you do uow.newEntity(...);
or if you want to call it manually then inject it:
@Service IdentityGenerator idGen;

String id = idGen.generate(SomeEntityType.class);
SomeEntityType entity = uow.newEntity(SomeEntityType.class, id);

/Rickard

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to