You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Michael Gentry <mg...@masslight.net> on 2011/03/28 18:15:41 UTC

Re: Accessing DataContext

Hi Eldred,

You may want to read through the UPGRADE.txt file in 3.1.  Of interest
to you is this snippet:


E.g. to instantiate the Cayenne stack in 3.1 you would do something like that:

    ServerRuntime cayenneRuntime = new
ServerRuntime("cayenne-UntitledDomain.xml");

To obtain a new ObjectContext, the following API is used:

    ObjectContext context = cayenneRuntime.getContext();


mrg


On Mon, Mar 28, 2011 at 11:46 AM, Eldred Mullany
<el...@easypay.co.za> wrote:
> Hi all
>
> I have upgraded from cayenne3.0 to 3.1M2 and obviously have a few
> breakable changes.
>
> From 3.0 I was able to access Datacontext  ie ObjectContex context =
> DataContext.createDataContext() for a standalone application.
>
> How would I access the context from 3.1M2 ?
>
> Is there any documentation from 3.0 to 3.1 that can help me ?
>
> Many thanks
> Eldred
>