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
>