cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: Adding a DI binding
Date Mon, 02 Jul 2012 07:28:59 GMT
Is the class that contains 'collectionFactory' ivar also managed by Cayenne DI container, or
is this your application class? If it is the former, then of course Cayenne injection will
have no effect.

Andrus

On Jul 1, 2012, at 8:16 PM, John Huss wrote:

> I'm trying to add a new DI binding and it's not working so I could use some help.
> 
> At the usage site I have this:
>     @Inject private ToManyCollectionFactory collectionFactory;
> 
> 
>     @Override
> 
>     public Object resolveFault(Persistent sourceObject, String relationshipName) {
> 
>         return collectionFactory.createToManyList(sourceObject, relationshipName);
> 
>     }
> 
> 
> The module is configured like so:
> 
>         binder.bind(ToManyCollectionFactory.class).to(DefaultToManyCollectionFactory.class);
> 
> But the collectionFactory is always null - it's not being injected.  What do I need to
be doing?
> 
> I'll attach the complete patch for reference.
> 
> 
> 
> Thanks,
> 
> John
> 


Mime
View raw message