Re: Double Model in frameworks and application

From: WONDER (mmmmmmmmm5..eb.de)
Date: Mon Mar 13 2006 - 19:08:49 EST

  • Next message: Andrus Adamchik: "Re: Double Model in frameworks and application"

    In Short,
    One Application can have only one Cayenne Model.
    Ok. What about framewokrs? not allowed to have thier Cayenne Model(s)?

    Sako.
      ----- Original Message -----
      From: WONDER
      To: cayenne-use..bjectstyle.org
      Sent: Tuesday, March 14, 2006 12:16 AM
      Subject: Double Model in frameworks and application

      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 - 19:06:23 EST