1 Reply Latest reply on Nov 14, 2004 11:19 AM by Johan Borchers

    Can CMP contain non-persistent fields

    Alwyn Schoeman Newbie

      I suspect the answer is no, but I just need to be sure.

      Can CMP contain non-persistent fields?

      I am thinking that the abstract class is defined with some variables and methods that access them. If possible the methods need to not be abstract in the abstract class right?

        • 1. Re: Can CMP contain non-persistent fields
          Johan Borchers Newbie

          The answer is NO

          If you deploy a CMP bean without setter for an CMP field you get this message:
          17:04:18,664 WARN [verifier] EJB spec violation:
          Bean : MyBean
          Section: 10.6.2
          Warning: The entity bean class must define a set accessor for each CMP field.
          Info : Field: myField

          The CMP fields specified in the deployment descriptor need getter and setter methods.
          If you need a non CMP field just define 2 normal non abstract interface methods as getter and setter but don't mention them in the deployoment descriptor. What you do in those methods is up to you.

          Johan