cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gentry <mgen...@masslight.net>
Subject Re: Switching databases
Date Tue, 23 Mar 2010 19:03:38 GMT
You probably have a few options.  The DataMap part of the model could
mostly be reused.  You could programatically create a DataNode (for
your DB connection) and attach it to the DataMap or you could create
the DataNode in the modeler and programatically adjust the settings in
it.  As for the PKs, you'd most likely need to iterate through the
DataMap and set the PK Generation Strategy depending upon your
DataNode type (the features used by your database: auto-increment,
sequences, etc).  Or, I suppose, you could use the generic
AUTO_PK_SUPPORT table that Cayenne can generate for you.

As for stored procedures ... Cayenne doesn't create/manage those for
you, but you can define how to call the procedure in the modeler.

I suspect I didn't really directly answer your questions, but perhaps
gave you a few more things to think about to ask more questions.  :-)

mrg


On Tue, Mar 23, 2010 at 2:40 PM,  <MGargano@escholar.com> wrote:
> Hi,
>
>        I'm looking into using Cayenne as a backend ORM technology
> replacing hibernate.  Currently our product supports multiple DBMSes (SQL
> Server, Oracle, DB2) depending on what the client already has installed.
> In hibernate when switching between oracle and sql server, for example, is
> just a matter of changing the dialect.  Is there a recommended way in
> Cayenne to generate models in a generic way so that the backend DBMS can
> be swapped out in code?  (How is auto id generation effected?  How are
> stored procs. handled?  etc.)  I only see articles related to running
> across multiple DBMSes.
>
> Thanks.
> -Mike
>

Mime
View raw message