Hi KRK Gowda,
In the EJB3 specification 2.1.4:
The primary key (or field or property of a composite primary key) should be one of the following types:
- any
Java primitive type;
- any primitive wrapper type;
- java.lang.String;
- java.util.Date;
- java.sql.Date.
In general, however, approximate numeric types (e.g., floating point types) should never be used in primary keys. Entities whose primary keys use types other than these will not be portable.
If generated primary keys are used, only integral types will be portable. If java.util.Date is used as a primary key field or property, the temporal type should be specified as DATE.
Regards,
Beno�t