cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: 3.1 example app & extended types
Date Tue, 13 Sep 2011 13:46:56 GMT

On Sep 13, 2011, at 4:39 PM, Marek Ĺ abo wrote:

> Oj I see, so I'm probably not gonna use @Inject anywhere?

Except in your own Cayenne extensions that you'll load in Cayenne container.

> I managed to upgrade configure from 3.0 to 3.1 but I don't know how to add extended types.
I used to do it in wicket init method (wicket filter is second in web.xml, both are mapped
to /*) but now I got nullpointer when I do this:
> 
>        ServerRuntime sr = (ServerRuntime) WebUtil.getCayenneRuntime(getServletContext());
>        DataDomain domain = sr.getDataDomain(); <-- NPE
>        DataNode node = domain.getNode("mainNode");
>        node.getAdapter().getExtendedTypes().registerType(new Inet4AddressType());
> 
> Any ideas where I should finish my configuration? I thought WebUtil will provide instace
of CayenneRuntime after CayenneFilter was handled.

yes it should. Make sure your filter is initialized before you call the code above and the
filter name in web.xml is the same as your Cayenne XML file name.

Andrus
Mime
View raw message