You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Juan José Gil <ma...@gmail.com> on 2012/09/17 02:11:05 UTC

Registering Extended Types

Hi,

I'm trying to use 3.1M3 version and I've noted that my ExtendedType
registrations aren't working anymore.
I've looked at docs, but they don't seem to be update. So I had readed the
unit tests at svn; but I did not understand them :(

Has anynoe already solved this problem?

The errors are:

import org.apache.cayenne.BaseContext;
import org.apache.cayenne.ObjectContext;
import org.apache.cayenne.access.DataContext;
import org.apache.cayenne.access.DataDomain;
import org.apache.cayenne.access.DataNode;
import org.apache.cayenne.conf.Configuration;

...

  @Before public void setupCayenne() {
    final DataDomain domain =
Configuration.getSharedConfiguration().getDomain(); // <-- it does not know
"Configuration"
    for (final DataNode node : domain.getDataNodes()) {

node.getAdapter().getExtendedTypes().registerType(DateTimeType.INSTANCE);

node.getAdapter().getExtendedTypes().registerType(LocalDateType.INSTANCE);

node.getAdapter().getExtendedTypes().registerType(LocalDateTimeType.INSTANCE);

node.getAdapter().getExtendedTypes().registerType(LocalTimeType.INSTANCE);
    }

    final ObjectContext context = DataContext.createDataContext(); // <--
this method doesn't exists anymore
    BaseContext.bindThreadObjectContext(context);
  }

is there a sample I could reach?

Best Regards
Juanjo

RE: Registering Extended Types

Posted by "Durchholz, Joachim" <Jo...@hennig-fahrzeugteile.de>.
> Is there a way to avoid accessing / initializing a DB
> in order to be able to use Cayenne generated models?
> I mean, most of my "business logic" unit tests / specs
> time is consumed by configuring cayenne access to an
> in-memory derby db.
> 
> As far as I understand how cayenne works I could avoid
> some of this time by having some "persistent" (not in
> memory) db for unit tests & similar; but... is there a
> way to use models without accessing the db?

Approach 1: Per-test-class setup and teardown. Junit has mechanisms exactly for this.
Approach 2: Package the setup stuff in a class, and use a static class member during testing. Bonus points if you register a shutdown hook for teardown (but if you simply recreate the Derby db for every test run, you don't need this).

Nothing of this is Cayenne-specific.
Which means it applies to anything else that might take too long to set up: Tomcat test servers, virtual machines with FTP server, or what else you might have.

Re: Registering Extended Types

Posted by "Juan J. Gil" <ma...@gmail.com>.
I now this is some-what unrelated to the original topic, but as we are 
talking of unit tests...

Is there a way to avoid accessing / initializing a DB in order to be 
able to use Cayenne generated models?
I mean, most of my "business logic" unit tests / specs time is consumed 
by configuring cayenne access to an in-memory derby db.

As far as I understand how cayenne works I could avoid some of this time 
by having some "persistent" (not in memory) db for unit tests & similar; 
but... is there a way to use models without accessing the db?

I someone considers this merits its own thread, tell me and I resend it 
in its own topic :)

Best Regards
Juanjo

On 17/09/12 11:36, Andrus Adamchik wrote:
> In your unit tests you may simply create an instance of ServerRuntime with a set of custom modules. Or use DIBootstrap.createInjector for more isolated testing of DI.
>   
> Cayenne sure takes the full advantage of DI in its own tests:
>
> http://svn.apache.org/repos/asf/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/DICase.java
> http://svn.apache.org/repos/asf/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCase.java
>
> Not sure if that's directly applicable to your tests though, but still may give you some ideas.
>
> Andrus
>
> On Sep 17, 2012, at 10:20 AM, Juan José Gil <ma...@gmail.com> wrote:
>
>> Ok, I'll try this option to... I need it for my unit tests.
>> To do this I need to create an injector? Is ther a TestCase I could extend?
>>
>> Regards,
>> Juanjo
>>
>> 2012/9/17 Andrus Adamchik <an...@objectstyle.org>
>>
>>> In 3.1 you can also do that with a custom module:
>>>
>>>   binder.bindList(Constants.SERVER_USER_TYPES_LIST)
>>>                 .add(new XyzType())
>>>                 .add(new AbcType());
>>>
>>> Still need to document that in the new cayenne-guide.pdf. BTW, check out
>>> org.apache.cayenne.configuration.Constants - it declares all supported
>>> extension points. Then you may take a look at ServerModule sources to see
>>> what Cayenne currently uses for each of those things.
>>>
>>> Andrus
>>>
>>> On Sep 17, 2012, at 4:22 AM, Tore Halset <ha...@pvv.ntnu.no> wrote:
>>>> Hello.
>>>>
>>>> I do it this way with 3.1.
>>>>
>>>>            ServerRuntime runtime = .....
>>>>            DataDomain domain = runtime.getDataDomain();
>>>>            DataNode node = domain.getDataNode("mydatanode");
>>>>            ExtendedTypeMap extendedTypes =
>>> node.getAdapter().getExtendedTypes();
>>>>            extendedTypes.registerType(new ColorType());
>>>>            extendedTypes.registerType(new
>>> WKTGeometryType(Geometry.class));
>>>> Btw, you should use 3.1B instead of 3.1M as B is newer.
>>>>
>>>> Regards,
>>>> Tore Halset.
>>>>
>>>> On Sep 17, 2012, at 02:11 , Juan José Gil wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I'm trying to use 3.1M3 version and I've noted that my ExtendedType
>>>>> registrations aren't working anymore.
>>>>> I've looked at docs, but they don't seem to be update. So I had readed
>>> the
>>>>> unit tests at svn; but I did not understand them :(
>>>>>
>>>>> Has anynoe already solved this problem?
>>>>>
>>>>> The errors are:
>>>>>
>>>>> import org.apache.cayenne.BaseContext;
>>>>> import org.apache.cayenne.ObjectContext;
>>>>> import org.apache.cayenne.access.DataContext;
>>>>> import org.apache.cayenne.access.DataDomain;
>>>>> import org.apache.cayenne.access.DataNode;
>>>>> import org.apache.cayenne.conf.Configuration;
>>>>>
>>>>> ...
>>>>>
>>>>> @Before public void setupCayenne() {
>>>>>   final DataDomain domain =
>>>>> Configuration.getSharedConfiguration().getDomain(); // <-- it does not
>>> know
>>>>> "Configuration"
>>>>>   for (final DataNode node : domain.getDataNodes()) {
>>>>>
>>>>>
>>> node.getAdapter().getExtendedTypes().registerType(DateTimeType.INSTANCE);
>>>>>
>>> node.getAdapter().getExtendedTypes().registerType(LocalDateType.INSTANCE);
>>>>>
>>> node.getAdapter().getExtendedTypes().registerType(LocalDateTimeType.INSTANCE);
>>>>>
>>> node.getAdapter().getExtendedTypes().registerType(LocalTimeType.INSTANCE);
>>>>>   }
>>>>>
>>>>>   final ObjectContext context = DataContext.createDataContext(); // <--
>>>>> this method doesn't exists anymore
>>>>>   BaseContext.bindThreadObjectContext(context);
>>>>> }
>>>>>
>>>>> is there a sample I could reach?
>>>>>
>>>>> Best Regards
>>>>> Juanjo
>>>>
>>>


Re: Registering Extended Types

Posted by Andrus Adamchik <an...@objectstyle.org>.
In your unit tests you may simply create an instance of ServerRuntime with a set of custom modules. Or use DIBootstrap.createInjector for more isolated testing of DI.
 
Cayenne sure takes the full advantage of DI in its own tests:

http://svn.apache.org/repos/asf/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/DICase.java
http://svn.apache.org/repos/asf/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCase.java

Not sure if that's directly applicable to your tests though, but still may give you some ideas.

Andrus

On Sep 17, 2012, at 10:20 AM, Juan José Gil <ma...@gmail.com> wrote:

> Ok, I'll try this option to... I need it for my unit tests.
> To do this I need to create an injector? Is ther a TestCase I could extend?
> 
> Regards,
> Juanjo
> 
> 2012/9/17 Andrus Adamchik <an...@objectstyle.org>
> 
>> In 3.1 you can also do that with a custom module:
>> 
>>  binder.bindList(Constants.SERVER_USER_TYPES_LIST)
>>                .add(new XyzType())
>>                .add(new AbcType());
>> 
>> Still need to document that in the new cayenne-guide.pdf. BTW, check out
>> org.apache.cayenne.configuration.Constants - it declares all supported
>> extension points. Then you may take a look at ServerModule sources to see
>> what Cayenne currently uses for each of those things.
>> 
>> Andrus
>> 
>> On Sep 17, 2012, at 4:22 AM, Tore Halset <ha...@pvv.ntnu.no> wrote:
>>> Hello.
>>> 
>>> I do it this way with 3.1.
>>> 
>>>           ServerRuntime runtime = .....
>>>           DataDomain domain = runtime.getDataDomain();
>>>           DataNode node = domain.getDataNode("mydatanode");
>>>           ExtendedTypeMap extendedTypes =
>> node.getAdapter().getExtendedTypes();
>>>           extendedTypes.registerType(new ColorType());
>>>           extendedTypes.registerType(new
>> WKTGeometryType(Geometry.class));
>>> 
>>> Btw, you should use 3.1B instead of 3.1M as B is newer.
>>> 
>>> Regards,
>>> Tore Halset.
>>> 
>>> On Sep 17, 2012, at 02:11 , Juan José Gil wrote:
>>> 
>>>> Hi,
>>>> 
>>>> I'm trying to use 3.1M3 version and I've noted that my ExtendedType
>>>> registrations aren't working anymore.
>>>> I've looked at docs, but they don't seem to be update. So I had readed
>> the
>>>> unit tests at svn; but I did not understand them :(
>>>> 
>>>> Has anynoe already solved this problem?
>>>> 
>>>> The errors are:
>>>> 
>>>> import org.apache.cayenne.BaseContext;
>>>> import org.apache.cayenne.ObjectContext;
>>>> import org.apache.cayenne.access.DataContext;
>>>> import org.apache.cayenne.access.DataDomain;
>>>> import org.apache.cayenne.access.DataNode;
>>>> import org.apache.cayenne.conf.Configuration;
>>>> 
>>>> ...
>>>> 
>>>> @Before public void setupCayenne() {
>>>>  final DataDomain domain =
>>>> Configuration.getSharedConfiguration().getDomain(); // <-- it does not
>> know
>>>> "Configuration"
>>>>  for (final DataNode node : domain.getDataNodes()) {
>>>> 
>>>> 
>> node.getAdapter().getExtendedTypes().registerType(DateTimeType.INSTANCE);
>>>> 
>>>> 
>> node.getAdapter().getExtendedTypes().registerType(LocalDateType.INSTANCE);
>>>> 
>>>> 
>> node.getAdapter().getExtendedTypes().registerType(LocalDateTimeType.INSTANCE);
>>>> 
>>>> 
>> node.getAdapter().getExtendedTypes().registerType(LocalTimeType.INSTANCE);
>>>>  }
>>>> 
>>>>  final ObjectContext context = DataContext.createDataContext(); // <--
>>>> this method doesn't exists anymore
>>>>  BaseContext.bindThreadObjectContext(context);
>>>> }
>>>> 
>>>> is there a sample I could reach?
>>>> 
>>>> Best Regards
>>>> Juanjo
>>> 
>>> 
>> 
>> 


Re: Registering Extended Types

Posted by Juan José Gil <ma...@gmail.com>.
Ok, I'll try this option to... I need it for my unit tests.
To do this I need to create an injector? Is ther a TestCase I could extend?

Regards,
Juanjo

2012/9/17 Andrus Adamchik <an...@objectstyle.org>

> In 3.1 you can also do that with a custom module:
>
>   binder.bindList(Constants.SERVER_USER_TYPES_LIST)
>                 .add(new XyzType())
>                 .add(new AbcType());
>
> Still need to document that in the new cayenne-guide.pdf. BTW, check out
> org.apache.cayenne.configuration.Constants - it declares all supported
> extension points. Then you may take a look at ServerModule sources to see
> what Cayenne currently uses for each of those things.
>
> Andrus
>
> On Sep 17, 2012, at 4:22 AM, Tore Halset <ha...@pvv.ntnu.no> wrote:
> > Hello.
> >
> > I do it this way with 3.1.
> >
> >            ServerRuntime runtime = .....
> >            DataDomain domain = runtime.getDataDomain();
> >            DataNode node = domain.getDataNode("mydatanode");
> >            ExtendedTypeMap extendedTypes =
> node.getAdapter().getExtendedTypes();
> >            extendedTypes.registerType(new ColorType());
> >            extendedTypes.registerType(new
> WKTGeometryType(Geometry.class));
> >
> > Btw, you should use 3.1B instead of 3.1M as B is newer.
> >
> > Regards,
> > Tore Halset.
> >
> > On Sep 17, 2012, at 02:11 , Juan José Gil wrote:
> >
> >> Hi,
> >>
> >> I'm trying to use 3.1M3 version and I've noted that my ExtendedType
> >> registrations aren't working anymore.
> >> I've looked at docs, but they don't seem to be update. So I had readed
> the
> >> unit tests at svn; but I did not understand them :(
> >>
> >> Has anynoe already solved this problem?
> >>
> >> The errors are:
> >>
> >> import org.apache.cayenne.BaseContext;
> >> import org.apache.cayenne.ObjectContext;
> >> import org.apache.cayenne.access.DataContext;
> >> import org.apache.cayenne.access.DataDomain;
> >> import org.apache.cayenne.access.DataNode;
> >> import org.apache.cayenne.conf.Configuration;
> >>
> >> ...
> >>
> >> @Before public void setupCayenne() {
> >>   final DataDomain domain =
> >> Configuration.getSharedConfiguration().getDomain(); // <-- it does not
> know
> >> "Configuration"
> >>   for (final DataNode node : domain.getDataNodes()) {
> >>
> >>
> node.getAdapter().getExtendedTypes().registerType(DateTimeType.INSTANCE);
> >>
> >>
> node.getAdapter().getExtendedTypes().registerType(LocalDateType.INSTANCE);
> >>
> >>
> node.getAdapter().getExtendedTypes().registerType(LocalDateTimeType.INSTANCE);
> >>
> >>
> node.getAdapter().getExtendedTypes().registerType(LocalTimeType.INSTANCE);
> >>   }
> >>
> >>   final ObjectContext context = DataContext.createDataContext(); // <--
> >> this method doesn't exists anymore
> >>   BaseContext.bindThreadObjectContext(context);
> >> }
> >>
> >> is there a sample I could reach?
> >>
> >> Best Regards
> >> Juanjo
> >
> >
>
>

Re: Registering Extended Types

Posted by Juan José Gil <ma...@gmail.com>.
Ah! I was looking for it at
http://mvnrepository.com/artifact/org.apache.cayenne
I'll try to access it later, thanks!

I see 3.1B1 in Maven's repository:
>
>
> http://search.maven.org/#artifactdetails%7Corg.apache.cayenne%7Ccayenne-server%7C3.1B1%7Cjar
>
> mrg
>

Re: Registering Extended Types

Posted by Andrus Adamchik <an...@objectstyle.org>.
In 3.1 you can also do that with a custom module:

  binder.bindList(Constants.SERVER_USER_TYPES_LIST)
                .add(new XyzType())
                .add(new AbcType());

Still need to document that in the new cayenne-guide.pdf. BTW, check out org.apache.cayenne.configuration.Constants - it declares all supported extension points. Then you may take a look at ServerModule sources to see what Cayenne currently uses for each of those things.

Andrus

On Sep 17, 2012, at 4:22 AM, Tore Halset <ha...@pvv.ntnu.no> wrote:
> Hello.
> 
> I do it this way with 3.1.
> 
>            ServerRuntime runtime = .....
>            DataDomain domain = runtime.getDataDomain();
>            DataNode node = domain.getDataNode("mydatanode");
>            ExtendedTypeMap extendedTypes = node.getAdapter().getExtendedTypes();
>            extendedTypes.registerType(new ColorType());
>            extendedTypes.registerType(new WKTGeometryType(Geometry.class));
> 
> Btw, you should use 3.1B instead of 3.1M as B is newer.
> 
> Regards,
> Tore Halset.
> 
> On Sep 17, 2012, at 02:11 , Juan José Gil wrote:
> 
>> Hi,
>> 
>> I'm trying to use 3.1M3 version and I've noted that my ExtendedType
>> registrations aren't working anymore.
>> I've looked at docs, but they don't seem to be update. So I had readed the
>> unit tests at svn; but I did not understand them :(
>> 
>> Has anynoe already solved this problem?
>> 
>> The errors are:
>> 
>> import org.apache.cayenne.BaseContext;
>> import org.apache.cayenne.ObjectContext;
>> import org.apache.cayenne.access.DataContext;
>> import org.apache.cayenne.access.DataDomain;
>> import org.apache.cayenne.access.DataNode;
>> import org.apache.cayenne.conf.Configuration;
>> 
>> ...
>> 
>> @Before public void setupCayenne() {
>>   final DataDomain domain =
>> Configuration.getSharedConfiguration().getDomain(); // <-- it does not know
>> "Configuration"
>>   for (final DataNode node : domain.getDataNodes()) {
>> 
>> node.getAdapter().getExtendedTypes().registerType(DateTimeType.INSTANCE);
>> 
>> node.getAdapter().getExtendedTypes().registerType(LocalDateType.INSTANCE);
>> 
>> node.getAdapter().getExtendedTypes().registerType(LocalDateTimeType.INSTANCE);
>> 
>> node.getAdapter().getExtendedTypes().registerType(LocalTimeType.INSTANCE);
>>   }
>> 
>>   final ObjectContext context = DataContext.createDataContext(); // <--
>> this method doesn't exists anymore
>>   BaseContext.bindThreadObjectContext(context);
>> }
>> 
>> is there a sample I could reach?
>> 
>> Best Regards
>> Juanjo
> 
> 


Re: Registering Extended Types

Posted by Michael Gentry <mg...@masslight.net>.
I see 3.1B1 in Maven's repository:

http://search.maven.org/#artifactdetails%7Corg.apache.cayenne%7Ccayenne-server%7C3.1B1%7Cjar

mrg


On Mon, Sep 17, 2012 at 7:52 AM, Juan José Gil <ma...@gmail.com> wrote:
> Thanks Tore, I'll try it today and see if it works :)
> I'm using 3.1M3 because it's the newest at mvnrepository. Is there another
> repo I should configure and use with cayenne?
>
> Regards
> Juanjo
>
> 2012/9/17 Tore Halset <ha...@pvv.ntnu.no>
>
>> Hello.
>>
>> I do it this way with 3.1.
>>
>>             ServerRuntime runtime = .....
>>             DataDomain domain = runtime.getDataDomain();
>>             DataNode node = domain.getDataNode("mydatanode");
>>             ExtendedTypeMap extendedTypes =
>> node.getAdapter().getExtendedTypes();
>>             extendedTypes.registerType(new ColorType());
>>             extendedTypes.registerType(new
>> WKTGeometryType(Geometry.class));
>>
>> Btw, you should use 3.1B instead of 3.1M as B is newer.
>>
>> Regards,
>> Tore Halset.
>>
>> On Sep 17, 2012, at 02:11 , Juan José Gil wrote:
>>
>> > Hi,
>> >
>> > I'm trying to use 3.1M3 version and I've noted that my ExtendedType
>> > registrations aren't working anymore.
>> > I've looked at docs, but they don't seem to be update. So I had readed
>> the
>> > unit tests at svn; but I did not understand them :(
>> >
>> > Has anynoe already solved this problem?
>> >
>> > The errors are:
>> >
>> > import org.apache.cayenne.BaseContext;
>> > import org.apache.cayenne.ObjectContext;
>> > import org.apache.cayenne.access.DataContext;
>> > import org.apache.cayenne.access.DataDomain;
>> > import org.apache.cayenne.access.DataNode;
>> > import org.apache.cayenne.conf.Configuration;
>> >
>> > ...
>> >
>> >  @Before public void setupCayenne() {
>> >    final DataDomain domain =
>> > Configuration.getSharedConfiguration().getDomain(); // <-- it does not
>> know
>> > "Configuration"
>> >    for (final DataNode node : domain.getDataNodes()) {
>> >
>> > node.getAdapter().getExtendedTypes().registerType(DateTimeType.INSTANCE);
>> >
>> >
>> node.getAdapter().getExtendedTypes().registerType(LocalDateType.INSTANCE);
>> >
>> >
>> node.getAdapter().getExtendedTypes().registerType(LocalDateTimeType.INSTANCE);
>> >
>> >
>> node.getAdapter().getExtendedTypes().registerType(LocalTimeType.INSTANCE);
>> >    }
>> >
>> >    final ObjectContext context = DataContext.createDataContext(); // <--
>> > this method doesn't exists anymore
>> >    BaseContext.bindThreadObjectContext(context);
>> >  }
>> >
>> > is there a sample I could reach?
>> >
>> > Best Regards
>> > Juanjo
>>
>>

Re: Registering Extended Types

Posted by Juan José Gil <ma...@gmail.com>.
Thanks Tore, I'll try it today and see if it works :)
I'm using 3.1M3 because it's the newest at mvnrepository. Is there another
repo I should configure and use with cayenne?

Regards
Juanjo

2012/9/17 Tore Halset <ha...@pvv.ntnu.no>

> Hello.
>
> I do it this way with 3.1.
>
>             ServerRuntime runtime = .....
>             DataDomain domain = runtime.getDataDomain();
>             DataNode node = domain.getDataNode("mydatanode");
>             ExtendedTypeMap extendedTypes =
> node.getAdapter().getExtendedTypes();
>             extendedTypes.registerType(new ColorType());
>             extendedTypes.registerType(new
> WKTGeometryType(Geometry.class));
>
> Btw, you should use 3.1B instead of 3.1M as B is newer.
>
> Regards,
> Tore Halset.
>
> On Sep 17, 2012, at 02:11 , Juan José Gil wrote:
>
> > Hi,
> >
> > I'm trying to use 3.1M3 version and I've noted that my ExtendedType
> > registrations aren't working anymore.
> > I've looked at docs, but they don't seem to be update. So I had readed
> the
> > unit tests at svn; but I did not understand them :(
> >
> > Has anynoe already solved this problem?
> >
> > The errors are:
> >
> > import org.apache.cayenne.BaseContext;
> > import org.apache.cayenne.ObjectContext;
> > import org.apache.cayenne.access.DataContext;
> > import org.apache.cayenne.access.DataDomain;
> > import org.apache.cayenne.access.DataNode;
> > import org.apache.cayenne.conf.Configuration;
> >
> > ...
> >
> >  @Before public void setupCayenne() {
> >    final DataDomain domain =
> > Configuration.getSharedConfiguration().getDomain(); // <-- it does not
> know
> > "Configuration"
> >    for (final DataNode node : domain.getDataNodes()) {
> >
> > node.getAdapter().getExtendedTypes().registerType(DateTimeType.INSTANCE);
> >
> >
> node.getAdapter().getExtendedTypes().registerType(LocalDateType.INSTANCE);
> >
> >
> node.getAdapter().getExtendedTypes().registerType(LocalDateTimeType.INSTANCE);
> >
> >
> node.getAdapter().getExtendedTypes().registerType(LocalTimeType.INSTANCE);
> >    }
> >
> >    final ObjectContext context = DataContext.createDataContext(); // <--
> > this method doesn't exists anymore
> >    BaseContext.bindThreadObjectContext(context);
> >  }
> >
> > is there a sample I could reach?
> >
> > Best Regards
> > Juanjo
>
>

Re: Registering Extended Types

Posted by Tore Halset <ha...@pvv.ntnu.no>.
Hello.

I do it this way with 3.1.

            ServerRuntime runtime = .....
            DataDomain domain = runtime.getDataDomain();
            DataNode node = domain.getDataNode("mydatanode");
            ExtendedTypeMap extendedTypes = node.getAdapter().getExtendedTypes();
            extendedTypes.registerType(new ColorType());
            extendedTypes.registerType(new WKTGeometryType(Geometry.class));

Btw, you should use 3.1B instead of 3.1M as B is newer.

Regards,
Tore Halset.

On Sep 17, 2012, at 02:11 , Juan José Gil wrote:

> Hi,
> 
> I'm trying to use 3.1M3 version and I've noted that my ExtendedType
> registrations aren't working anymore.
> I've looked at docs, but they don't seem to be update. So I had readed the
> unit tests at svn; but I did not understand them :(
> 
> Has anynoe already solved this problem?
> 
> The errors are:
> 
> import org.apache.cayenne.BaseContext;
> import org.apache.cayenne.ObjectContext;
> import org.apache.cayenne.access.DataContext;
> import org.apache.cayenne.access.DataDomain;
> import org.apache.cayenne.access.DataNode;
> import org.apache.cayenne.conf.Configuration;
> 
> ...
> 
>  @Before public void setupCayenne() {
>    final DataDomain domain =
> Configuration.getSharedConfiguration().getDomain(); // <-- it does not know
> "Configuration"
>    for (final DataNode node : domain.getDataNodes()) {
> 
> node.getAdapter().getExtendedTypes().registerType(DateTimeType.INSTANCE);
> 
> node.getAdapter().getExtendedTypes().registerType(LocalDateType.INSTANCE);
> 
> node.getAdapter().getExtendedTypes().registerType(LocalDateTimeType.INSTANCE);
> 
> node.getAdapter().getExtendedTypes().registerType(LocalTimeType.INSTANCE);
>    }
> 
>    final ObjectContext context = DataContext.createDataContext(); // <--
> this method doesn't exists anymore
>    BaseContext.bindThreadObjectContext(context);
>  }
> 
> is there a sample I could reach?
> 
> Best Regards
> Juanjo