My guess is that you are registering (module.addCompostes() )
BaseComposite, which lacks the doSomethingElse() implementation
method.

If you don't register that, and in fact, you don't really need it at
all, since you are probably only interested in Base, and you will be
allowed to do queries on Base, although the result might return all
kind of composite types.

Cheers
Niclas

On Tue, May 13, 2008 at 11:47 AM, Bong Gavin <[EMAIL PROTECTED]> wrote:
> Hi,
>
>  I need some help to model my entities.
>
>  Scenario:
>
>  1.1 SubBase extends from Base.
>
>  1.2 Base's interface has 2 methods.
>
>      Base#doSomething()
>      Base#doSomethingElse()
>
>  Goal:
>
>  2.1 I want to query the repository for Base.
>
>  2.2 Then I want to be able to invoke both methods on it.
>
>  Invoking Base#doSomething() should be dispatched to the mixin for Base.
>  Invoking Base#doSomethingElse() should delegate to the mixin for SubBase.
>
>
>  Question:
>
>  Is this doable ?
>
>  Currently I'm getting an exception.
>
>  org.qi4j.spi.composite.ResolutionException: Could not find mixin for
>  method public abstract void rnd.Base.doSomethingElse() in composite
>  rnd.BaseComposite
>         at 
> org.qi4j.runtime.composite.CompositeResolver.getMixinForMethod(CompositeResolver.java:501)
>         at 
> org.qi4j.runtime.composite.CompositeResolver.getMixinsForMethods(CompositeResolver.java:464)
>
>
>  Full source:
>  --
>
>  public interface Base
>  {
>     void doSomething();
>
>     void doSomethingElse();
>  }
>
>  @Mixins( BaseMixin.class )
>  public interface BaseComposite
>     extends Base, EntityComposite
>  {
>  }
>
>  public abstract class BaseMixin
>     implements Base
>  {
>     public void doSomething()
>     {
>         System.out.println( "doSomething" );
>     }
>     public abstract void doSomethingElse();
>  }
>
>  public interface SubBase
>     extends Base
>  {
>  }
>
>  @Mixins( SubBaseMixin.class )
>  public interface SubBaseComposite
>     extends SubBase, Composite
>  {
>  }
>
>  public abstract class SubBaseMixin
>     extends BaseMixin
>     implements SubBase
>  {
>     @Override
>     public void doSomethingElse()
>     {
>         System.out.println( "doSomethingElse" );
>     }
>  }
>
>  Thanks
>
>  Regards,
>
>  Gavin
>
>  _______________________________________________
>  qi4j-dev mailing list
>  [email protected]
>  http://lists.ops4j.org/mailman/listinfo/qi4j-dev
>

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

Reply via email to