if Primarykey column Datatype is 'int'
Do I need to write a PrimaryKey class or I can use
Integer wrapper class without writing new Primarykey class.
You need a primary key class that has int id as one of the attributes. If you do not want a primary key class, then use Integer object instead, in your bean. Modify your home interface findbyprimarykey method to take Integer as an argument instead of a PK object.
If you use int as primary key ,you don't have to write a primary key class.But mention in deployment descriptor
primkey-class tag java.lang.Integer.
In find by primaykey method use Integer instead of int.