on 04-29-2005 11:54 AM
Hello,
is it possible to define in the persistent.xml file an object as a primary key?. I mean something like
<field-map key-type="PrimaryKey">
<field-name>ProductPK</field-name>
<column>
<column-name>PRODUCTID</column-name>
</column>
</field-map>
ProductPK implements the toString(), hashCode() and equals(Object obj) methods.
Thanks for your answer,
SL
Hi,
i think there is something goes wrong in your Implementation.
1. If you only have one field as primary key you don't need a PK class. You only have to define this fiel with the key-type PrimaryKey in persistent.xml.
2. The ejbCreate Method must return the type of the primary key. So if your primary key is productID let it return a String.
Try this out and tell me if it works.
Regards André
Message was edited by: André Rauscher
Sorry the ejbCreateMethode can have parameter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In persistent.xml you have to define all fields which represents the primaryKey as key-type="PrimaryKey". In the ejb-jar.xml you should define your PrimaryKey Class like:
Regards André
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.