6 Replies Latest reply on Aug 8, 2003 1:41 PM by bbd66

    Value Objects and EJB deployment descriptors

    bbd66

      Hello all,
      Do I have to define a value object in any of the deployment descriptors? Right now, I have a class which gets teh values from an entity copied into it and it is returned to the session bean layer to be used by the client. I have tried making the appropriate calls in the remote and local interfaces and still am getting the following error: (my value object is GroupStatesVO.java)

      org.jboss.deployment.DeploymentException: Could not find matching method for public abstract com.tpg.main.mode
      l.web.ValueObjects.GroupStatesVO com.tpg.main.framework.engine.consumer.mdb.GroupStatesLocalHome.getGroupStatesData()

      I also have another unrelated question for anyone who can answer:

      Is there any point to using Value Objects if all my calls to the entity beans from teh session beans are local? The only time I could see a remote call being made is if we have entity beans in a clustered environment. Will the calls still be local in a clustered environment?

      Thanks,

      Dave

        • 1. Re: Value Objects and EJB deployment descriptors

          I'm guessing from the class name that you've tried
          to define the getter in the local home?

          It is unclear what you are asking in your second question.
          Local interfaces cannot be used outside the same VM where
          load balancing would be used.

          Regards,
          Adrian

          • 2. Re: Value Objects and EJB deployment descriptors
            bbd66

            Yes I have tried to declare it in the local home...is that incorrect?

            About the second question: I am debating whether or not to use Value Objects to aggregate all the field values from the entity into a value object. I see no point in using the Value Objects if all my calls from the session bean layer (facade) will be local and I can create a value object in the session bean layer. In a clustered environment, will the session bean layer (facade) still be making local calls to the entity beans?

            Thanks,

            Dave

            • 3. Re: Value Objects and EJB deployment descriptors

              The value object should be on the remote/local interface.

              It is more efficient to contruct the value object at the
              entity level. Consider an entity with 20 fields.
              That would require 20 getXXX invocations but getValue()
              only requires one.

              The session bean should be using local entity beans
              so load balancing/failover doesn't happen at this level.
              It happens at the session level.

              Regards,
              Adrian

              • 4. Re: Value Objects and EJB deployment descriptors
                bbd66

                Adrian,
                I have tried to add a value object creation method but I was getting Deployment problems:
                org.jboss.deployment.DeploymentException: No abstract accessors for field named 'stateSelectionID' found in en
                tity class com.tpg.main.framework.engine.consumer.mdb.GroupStatesBean

                I eliminated the abstract methods and assigned the values from the query to the variables of the class as in the attached file. I cannot have them being abstract since there must be implementation for teh value object code.

                I am in a bit of a cunnundrum here,

                Thanks for any help,

                Dave

                • 5. Re: Value Objects and EJB deployment descriptors

                  Is this CMP1.1 or CMP2

                  The persistent fields should have abstract gets and sets
                  in CMP2.

                  Regards,
                  Adrian

                  • 6. Re: Value Objects and EJB deployment descriptors
                    bbd66

                    I am using CMP 2.0.

                    Does that mean that I can't have a Value Object in my entity bean class cause I can't define the implementation of the getData() method which returns the value object if it's supposed to be abstract? Is there a way around this?

                    Thanks,

                    Dave