Question about using a library having Cayenne embedded within a project using Cayenne

From: Sukanya Ratanotoyanon (sratano..mail.com)
Date: Wed Nov 07 2007 - 22:47:37 EST

  • Next message: Dan Morgan: "MS SQLServer 1.2 JDBC driver and responseBuffering"

    Hello,

    I'm having a problem getting a correct DataDomain when I'm using a library
    containing cayenne objects. Basically, I'm working on a project using
    Cayenne. I need the database URL, usename and password to be configurable.
    Therefore, I have this method to set up them up like this:

                Configuration config = Configuration.getSharedConfiguration();

                DataDomain domain = config.getDomain();
                DataNode cNode = domain.getNode(LINK_DB_NODE);
                ....
                ....

     I received a library that also uses Cayenne to map the database, and tried
    to integrate this library into my project. However, after integration, when
    I call Configuration.getSharedConfiguration(), it loads the configuration
    from the cayenne.xml in the library instead of the one I'm using for the
    project. So when I tried to get my DataNode, it cannot be founded. This
    results in NullPointerException when I use my DataNode object. Is there a
    way to work around this, or do I miss something? I just start using Cayenne
    not very long ago and would appreciate any helps.

    Thank you very much,
    Sukanya



    This archive was generated by hypermail 2.0.0 : Thu Nov 08 2007 - 14:02:46 EST