On 11/01/2011, at 22.47, Stanislav Muhametsin wrote:
> Yes, but the implementation for property (and association, and 
> manyassociation) methods is provided by Qi4j itself by default, so it won't 
> even look at your mixin.

I'm beginning to get it ...

> Yeah, I ended up in doing dummyMethods at first too. To get rid of those, you 
> need to explicitly extend your entity composite from Lifecycle interface in 
> order for your Lifecycle mixin to kick in.
> 
> Like this:
> 
> @Mixins(SomeEntityMixinWithJustLC.class)
> public interface SomeEntityWithJustLC
>    extends SomeEntity, EntityComposite, Lifecycle
> {
> }
> 
> where SomeEntityMixinWithJustLC implements only Lifecycle.

I tried your suggestion and modified my test code from before, but I must be 
missing something since the LC is still not called:

public interface SomeEntity
{
    Property<String> someString();
}

@Mixins( SomeEntityMixinWithJustLC.class )
public interface SomeEntityWithJustLC
      extends SomeEntity, EntityComposite, Lifecycle
{
}

class SomeEntityMixinWithJustLC
      implements Lifecycle
{
   @This
   SomeEntity someEntity;

   public void create()
         throws LifecycleException
   {
      someEntity.someString().set( "hi" );
      create2 = true;
   }

   public void remove() throws LifecycleException {}
}

Thanks for your help!

I'll be back tomorrow.... zzzz

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

Reply via email to