Hi,
I am trying to write a CMP Bean with out PK Class and my table dosen't have any primary key. So I am using
java.lang.Object in my Home Interface findByPrimaryKey(java.lang.Object) and in XML files <prim-key-class>java.lang.Object</prim-key-class> is this right?
while compiling with ejbc the following error occured
ERROR: Error from ejbc: [9.2.9] In EJB InvoiceMaster, the primary key class must implement the method public int hashCode().
ERROR: Error from ejbc: [9.2.9] In EJB InvoiceMaster, the primary key class must implement the method boolean equals(Object other). ERROR: ejbc found errors
is the java.lang.Object allready implements equals and hashCode methods ?
please help me. Thank u
Kamal.
Kamal.
-
CMP Bean with out Primary Key Class (2 messages)
- Posted by: Kamalakar Byravarasu
- Posted on: November 23 2000 05:17 EST
Threaded Messages (2)
- CMP Bean with out Primary Key Class by K V S Subrahmanyam K V S on November 28 2000 10:44 EST
- CMP Bean with out Primary Key Class by SundaraRajan Krishnamoorthy on November 30 2000 22:37 EST
-
CMP Bean with out Primary Key Class[ Go to top ]
- Posted by: K V S Subrahmanyam K V S
- Posted on: November 28 2000 10:44 EST
- in response to Kamalakar Byravarasu
HI,
U CANT USE ENTITY BEAN WITH OUT A PRIMARY KEY.
AND THE FIELDS IN THE PRIMARY KEY CLASS SHOULD BE CONTAINAR MANAGED.
SO TRY TO IDENTIFY A PRIMARY KEY IN YOUR TABLE AND PROCEED.
THANKS
SUBRAHMANYAM K V S
-
CMP Bean with out Primary Key Class[ Go to top ]
- Posted by: SundaraRajan Krishnamoorthy
- Posted on: November 30 2000 22:37 EST
- in response to K V S Subrahmanyam K V S
As per EJB Specification1.1, the definition of PrimaryKey can be deffered until deployment time by making the findByPrimarykey to take java.lang.Object as parameter and by making the return type of ejbCreate in bean implementation class to java.lang.Object.
But I am getting error similar to on errors Mr.Kamal got while running ejbc.It says that the equals & hashCode methods are undefined. I am using Weblogic5.1. I will be thankful if any one can provide a solution for this.
Regards
Sundar