I think I have found it after all;
In EntityInstance there are
private final ModuleUnitOfWork uow;
private ModuleInstance moduleInstance;
Now, uow is set to the MUoW that retrieved this EntityInstance
(PagesModule in my case), whereas the moduleInstance is set correctly
to the "RentalModule".
But
public Object invoke( Object proxy, Method method, Object[] args )
throws Throwable
{
return entityModel.invoke( this, this.proxy, method, args,
uow.module() );
}
shouldn't the Module passed in that method be moduleInstance instead
of the module of the UoW loaded this Entity? Or, should the
ModuleUnitOfWork already be set to a MUoW that has the RentalModule
visibility?
Cheers
On Mon, Aug 24, 2009 at 5:54 PM, Niclas Hedhman<[email protected]> wrote:
> On Mon, Aug 24, 2009 at 5:39 PM, Niclas Hedhman<[email protected]> wrote:
>
>> module.addEntities( Booking.class, Car.class, Customer.class,
>> CarCategory.class );
>> module.addValues( Address.class, Period.class );
>> module.addEntities( RentalShop.class ).visibleIn(
>> Visibility.application );
>>
>> I am starting debugging now... Any suggestion what to look for/at ??
>
> The bookings() method returns a ManyAssociation which has a state that
> looks ok. It is the toList() method that fails.
>
> In ModuleUnitOfWork.get() (line 223 and there about);
>
>
> EntityFinder finder = moduleInstance.findEntityModel( type );
> if( finder.models.isEmpty() )
> {
>
> type = Booking
> moduleInstance = PagesModule, i.e. where Booking is NOT registered,
> but where the UoW is started.
>
> and therefor the lookup fails.
>
>
> I don't understand the UoW separation (UnitOfWorkInstance vs
> ModuleUnitOfWork) and how the changes are to happen, so not sure if I
> can help further.
>
>
> 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
>
--
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