Re: Mapping (My)SQL function

2011-02-10 Thread Marek Šabo
Hi, here's the relevant code: public class Inet4AddressType implements ExtendedType { @Override public String getClassName() { return Inet4Address.class.getName(); } @Override public void setJdbcObject(PreparedStatement statement, Object value, int pos, int type, i

Re: Mapping (My)SQL function

2011-02-10 Thread Michael Gentry
Hi Marek, If you don't mind sharing, I'm sure many would like to see it. Thanks, mrg On Thu, Feb 10, 2011 at 5:08 PM, Marek Šabo wrote: > Hi Michael, > > I fooled around a little bit and settled down with extended type > implementation for Inet4Address. Should anyone want to see the code I ca

Re: Mapping (My)SQL function

2011-02-10 Thread Marek Šabo
Hi Michael, I fooled around a little bit and settled down with extended type implementation for Inet4Address. Should anyone want to see the code I can post it. Regards, marek On 02/09/2011 03:30 PM, Michael Gentry wrote: Hi Marek, I'd probably just wrap it in utility methods, but I tend t

Re: How to create a new datacontext based on a datacontext

2011-02-10 Thread Andrus Adamchik
Yeah, one way is to reorg your code to make runtime accessible. An alternative would be to register a custom ObjectContextFactory with DI that will provide DataContext with access to runtime (or rather to org.apache.cayenne.di.Injector that is the configuration engine inside Runtime): class MyD

Re: How to create a new datacontext based on a datacontext

2011-02-10 Thread Øyvind Harboe
On Thu, Feb 10, 2011 at 3:57 PM, Andrus Adamchik wrote: > Content is created by a "runtime" object (normally a ServerRuntime) : > >   ObjectContext context = cayenneRuntime.getContext(); > > See an example in tutorial's "Main" class. Can I get to the cayenneRuntime based on a datacontext class?

Re: How to create a new datacontext based on a datacontext

2011-02-10 Thread Andrus Adamchik
Content is created by a "runtime" object (normally a ServerRuntime) : ObjectContext context = cayenneRuntime.getContext(); See an example in tutorial's "Main" class. Andrus On Feb 10, 2011, at 3:12 AM, Øyvind Harboe wrote: > In my app I'm creating a new datacontext based on a > existing dat

Re: Cayenne 3.1 - how to create autoadapter

2011-02-10 Thread Andrus Adamchik
There is a new constructor for AutoAdapter: public AutoAdapter(Provider adapterProvider) > While injection is an implementation detail, it is used in the > documentation: We are still trying to write the Java classes managed via injection in a manner that should not prevent their creation in

Re: How to create a new datacontext based on a datacontext

2011-02-10 Thread Øyvind Harboe
On Thu, Feb 10, 2011 at 2:27 PM, Michael Gentry wrote: > Which version of Cayenne are you using?  It isn't > deprecated in Cayenne 3.0. I'm trying to upgrade to Cayenne 3.1, so I want to stop using it. -- Øyvind Harboe Can Zylin Consulting help on your project? US toll free 1-866-980-3434

Re: How to create a new datacontext based on a datacontext

2011-02-10 Thread Michael Gentry
Which version of Cayenne are you using? It isn't deprecated in Cayenne 3.0. mrg On Thu, Feb 10, 2011 at 3:12 AM, Øyvind Harboe wrote: > In my app I'm creating a new datacontext based on a > existing datacontext, but the method I used to do this > is now deprecated and I don't know what to repl

How to create a new datacontext based on a datacontext

2011-02-10 Thread Øyvind Harboe
In my app I'm creating a new datacontext based on a existing datacontext, but the method I used to do this is now deprecated and I don't know what to replace it with: getDataContext().getParentDataDomain().createDataContext(); ? -- Øyvind Harboe Can Zylin Consulting help on your project? US t

Cayenne 3.1 - how to create autoadapter

2011-02-10 Thread Øyvind Harboe
I have a warning that this 'new AutoAdapter(dataSource)' is deprecated. What do I do instead? The implementation of the above uses deprecated methods, otherwise I would have thought that the source provided the solution on this one. While injection is an implementation detail, it is used in the