Double Model in frameworks and application

From: WONDER (mmmmmmmmm5..eb.de)
Date: Mon Mar 13 2006 - 18:16:36 EST

  • Next message: Cris Daniluk: "Re: reverse engineering a postgresql database: no relationships detected?"

    Hello,
    I have the following situation:

    A framework "myFramework", this has:
            1. myFramework.BaseClass
            2. Includs a Cayenne Model "myErrorCayenne"// its in the CLASSPATH of the framework
            3. static class myFramework.ErrorClass.

    An application "myApplication", this has:
            1. Its own Cayenne Model "myApplicationCayenne".
            2. Class myApplication.BaseClass extends myFramework.BaseClass,
            3. Class myApplication.BaseClass uses the static class myFramework.ErrorClass.

    -----------------------------------------------------------------------
    public class myFramework.ErrorClass
    {
        public list static myErrors()
        {
            Configuration conf = Configuration.getSharedConfiguration();
            domain = conf.getDomain("myErrorCayenne");
            // Debuger displays the name "myApplicationCayenne".
            // "myErrorCayenne" is not visible here.
    ....
    return xx;
        }
    }
    -----------------------------------------------------------------------
    public class myFramework.BaseClass
    {
        public myFramework.BaseClass(String domainName)
        {
            super();
            Configuration conf = Configuration.getSharedConfiguration();
            domain = conf.getDomain(domainName);
            // Debuger displays the name "myApplicationCayenne".
        }
    }
    -----------------------------------------------------------------------
    public class myApplication.BaseClass extends myFramework.BaseClass
    {
        public myApplication.BaseClass()
        {
            super("myApplicationCayenne"); // This goes well
        }

        public myMethod()
        {
            List errors = myFramework.ErrorClass.myErrors(); // This doesnt work.

        }
    }
    -----------------------------------------------------------------------

    So my problem is getSharedConfiguration once work and another not.

    My question: How can I tell Cayenne to get the Configurations in the static method myFramework.ErrorClass.myErrors(); to use the framewokr Configurations and -->> the Cayenne file in the Framework "myErrorCayenne".

    I hope i could explain the problem.

    Sako.



    This archive was generated by hypermail 2.0.0 : Mon Mar 13 2006 - 18:14:10 EST