How can I implement toString() method in my EJB?
Created May 7, 2012
Joseph vijay Raj
It will not be compatible with java.lang.String java.lang.Object.toString() method.
Hence I think its not possible.
I have implementation in my ejb-implementation class:I think this is not possible because the toString() defined in the Remote Interface should throw RemoteException.
public String toString() {
return new String(" User id =" + m_id +"; ");
}
and in the remote interface
public java.lang.String toString() throws RemoteException;
But I got this error message:
... method toString() in interface userEntity cannot override method toString() in class java.lang.Object, overridden method does not throw java.rmi.RemoteException at line 12, column 27
It will not be compatible with java.lang.String java.lang.Object.toString() method.
Hence I think its not possible.