PrimaryKey class in CMP

Discussions

EJB design: PrimaryKey class in CMP

  1. PrimaryKey class in CMP (5 messages)

    I am planning a design which has "String" as Primary Key. I have defined two constructors in the Primary Bean class one with String as parameter and another with no parameter. Then what shall I do with hashcode() and equals() methods. I have implemented serialisable interface. Can anyone clarify.

    Threaded Messages (5)

  2. PrimaryKey class in CMP[ Go to top ]

    Hi narayan,
        If String is going to be the primary key for ur entity bean, then there is no need to seperately define a primary key class. use the class of String itself, "java.lang.String".

    thanks...hasan
    (ahamed at aztec dot soft dot net)
  3. PrimaryKey class in CMP[ Go to top ]

    hi hasan
    Thanks for your reply. I tried in two ways.
    no.1 -> using java.lang.String i.e. without having separate PK class -> If I ejb compile i get CASE_INSENSITIVE_ORDER error, i think it's telling we have to check for case if we use String.

    no.2 -> using separate PK class, as per your ref. article, I get some thing like "Bean provided to weblogic RDBMS CMP system is invalid". unknown error, and it tells to check that the deployment descriptor contains well-formed XML.

    I checked everthing twice, but can't figure out. can you suggest where I am going wrong.
    thanks a lot
    narayan
  4. PrimaryKey class in CMP[ Go to top ]

    Are you sure that you clearly defined you PK class in ejb-jar.xml as in <prim-key-class>-tag?
  5. PrimaryKey class in CMP[ Go to top ]

    i did check all aspects. could not figure out?
  6. PrimaryKey class in CMP[ Go to top ]

    Hasan,

    Cut and paste weblogic-rdbms-cmp.xml file and let us take a look at it.. I had a similar problem and if you leave one section out you will bomb..

    Peter