On Mon, Oct 27, 2008 at 4:02 PM, Richard Wallace
<[EMAIL PROTECTED]> wrote:

> And that's great for initialization.  My biggest question when using a
> private mixin still remains: How do you do a query for Cargo (or
> CargoEntity) when all its state is stored in CargoState?

The Query subsystem operates with the same mechanisms in place for
initialization. So,

QueryBuilder<Cargo> builder = uow.newQueryBuilder( Cargo.class );
CargoState template = QueryExpressions.templateFor( CargoState.class );
builder.where( QueryExpressions.eq( template.origin().get().name(),
"New York" ) );
Query query = builder.newQuery();


As is mentioned in DDD, clients should not be given free reign of
query. Whether or not (and how) we should enforce that clients can't
access the templates for the private mixins is another story.


Cheers
Niclas

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

Reply via email to