Discussions

EJB design: Integer - PrimaryKey class

  1. Integer - PrimaryKey class (2 messages)

    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.


    thanks,

    - Sri
  2. Integer - PrimaryKey class[ Go to top ]

    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.
  3. hi,
    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.