Re: Switching databases

From: Michael Gentry (mgentr..asslight.net)
Date: Tue Mar 23 2010 - 15:03:38 EDT

  • Next message: Andrus Adamchik: "Re: Switching databases"

    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, <MGargan..scholar.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
    >



    This archive was generated by hypermail 2.0.0 : Tue Mar 23 2010 - 15:04:37 EDT