cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: @SortWeight annotation
Date Wed, 20 Jul 2011 13:36:50 GMT
Hi Michael,

This is pretty straightforward. Here is an example:

// create custom module:
class CayenneExtrasModule implements Module {

	@Override
	public void configure(Binder binder) {
		binder.bind(EntitySorter.class).to(WeightedAshwoodEntitySorter.class);
	}
}

// use it when creating Cayenne runtime:
ServerRuntime runtime = new ServerRuntime("cayenne-xyz.xml", new CayenneExtrasModule());


Andrus



On Jul 20, 2011, at 4:26 PM, Michael Gentry wrote:

> Hi Andrus,
> 
> Since I'm completely new to the DI stuff in 3.1, how do I install the
> WeightedAshwoodEntitySorter in the DI container?
> 
> Thanks,
> 
> mrg
> 
> 
> On Wed, Jul 13, 2011 at 12:19 PM, Andrus Adamchik
> <andrus@objectstyle.org> wrote:
>> @SortWeight may help (unless the cycle is between the objects of the same type).
You will need to install WeightedAshwoodEntitySorter in the DI container to take advantage
of it.
>> 
> 


Mime
View raw message