2009/11/17 Niclas Hedhman <[email protected]>

> On Tue, Nov 17, 2009 at 5:23 PM, Jacek Sokulski <[email protected]>
> wrote:
>
> >> When you add more roles, yes, you do change the existing code. So what?
> >> What is the problem with that?
> >
> > I can have no no access to existing code or I do customisation for many
> > clients and want to have minimal delta from the baseline or want to  have
> > extensible library.
>
> I still think that you can do the other way around as well;
>
> @Mixins( ManagerMixin.class )
> public interface Manager extends Employee
> {
> :
> }
>
> to accomplish the same. By doing the above, if the ManagerMixin
> implements any of the methods in Employee then those implementations
> takes precedence over the mixins declared on the Employee type.
>
Yes, that's my point, but it does not work for existing entities (not sure
if should), if I load Employee as Manager ( uow.get(Manager.class, empId) )
and try to invoke a manager method I got NPE, but maybe it is the place for
Migration API, I haven seen it yet, but if it works it would solve the
issue.

BTW if the entity is not usable an exception should be probable thrown by
uow.get method, Here is the stacktrace:
java.lang.NullPointerException
    at org.qi4j.runtime.entity.EntityInstance.<init>(EntityInstance.java:77)
    at
org.qi4j.runtime.unitofwork.UnitOfWorkInstance.get(UnitOfWorkInstance.java:234)
    at
org.qi4j.runtime.structure.ModuleUnitOfWork.get(ModuleUnitOfWork.java:218)
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to