Hi,
This sounds a silly question. I hope you can stay with me for a moment.
I use WebLogic 6.1, I keep getting error messages whenever I want to write non-cmp business method on CMP EntityBean.
public interface Customer extends EJBObject {
...
public ProfileVO _getProfile() throws RemoteException;
public void _setProfile(ProfileVO profile) throws RemoteException;
...
}
Basically, ProfileVO is a value object contains name, address, etc. And ProfileVO object is going to be serialized into database as single
String value
profile (CMP field).
The bean code:
...
public abstract class CustomerEJB implements EntityBean {
...
// this is a CMP field
public String
profile;
// this is not a CMP field
public ProfileVO profileVo;
public ProfileVO _getProfile() {
return profileVo;
}
public void _setProfile(ProfileVO p) {
profileVo = p;
}
public void ejbLoad() {
// ProfileVO can accept String as argument,
// and parse it to get the customer name,
// address, etc.
profileVo = new ProfileVO(profile);
}
public void ejbStore() {
// this will convert ProfileVO to String
// so it can be saved into database
profile = profileVO.constructString();
}
...
}
The error told something about "field definition mismatch" or similar.. My code can be compiled *only* when I remove _setProfile and _getProfile in Customer remote interface. Why?
PS: It works fine when I use BMP ...