-
1. Re: inheritance in EJB's /JBoss ??
jbossuser Jan 23, 2002 4:14 PM (in response to berndreiners)Are you using CMP 2.0?
Entity beans persisted fields are declared as abstract methods, and you can't use the pattern of inheriting from a value object. -
2. Re: inheritance in EJB's /JBoss ??
andreas Jan 24, 2002 3:57 AM (in response to berndreiners)Hi 'jbossuser',
You *can* define the abstract getters and setters in the EB class or any of it's supper classes.
The EJB spec. (1.1 and 2.0) does not restrict the usage of inheritance, and I use inheritance with 2.0 cmp extensive. -
3. Re: inheritance in EJB's /JBoss ??
jbossuser Jan 24, 2002 1:39 PM (in response to berndreiners)Doh! God please give me patience.
The "value object" pattern used in 1.1 was to have a value object that had properties, have your entity bean inherit from this value object so that you didn't have to re-declare the fields, and use the value object to pass back the collection of properties in one shot rather than one by one.
With EJB 2.0, you must declare your properties as abstract methods, and thus, inheriting from the value object does not provide you anything.
Sorry you needed this spelled out, but if you had read the origional post ayou would have seen that he was trying to inherit the datafields. Also, you would have seen that I said you can't use the "pattern of inheriting from a value object", not that you can't use inheritence.