On Wed, May 13, 2009 at 4:33 AM, Rickard Öberg <[email protected]> wrote:

> I'm guessing that it would have to be an explicit operation, rather than
> just "oh so you want to cast an Entity to X, sure I'll add it on the fly"
> kind of thing. So, one way to do that would be to extend the EntityBuilder
> in UoW to work similarly to how ValueBuilder can take an existing value and
> modify it:

> ArticleEntity article = ...;
> EntityBuilder<CommentsEntity> commentsBuilder =
> uow.addEntityType(CommentsEntity.class, article);
> CommentsEntity ce = commentsBuilder.prototype();
> ... initialize CommentsEntity state ...
> CommentsEntity ce = commentsBuilder.newInstance();

Looks straight forward enough...

Cheers
-- 
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java

I  live here; http://tinyurl.com/2qq9er
I  work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug

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

Reply via email to