Hiep Luong wrote:

> I've been trying to get the cabinbean example in the RMH
> Enterprise JavaBeans book to work.  This example has a primary key that is
> primitive int.  The way they code it is by creating a cabinPK class which
> goes into the prim-key-class element in the deployment descriptor with a
> corresponding primkey-field element.  It compiled but when I ran this, the
> table gets created but no primary key constraint is created in oracle but no
> exceptions either.  Beans are created just fine and I see data in the table
> BUT when I try to retrieve  the bean by using findbyprimarykey method I get
> "No such entry!" exception always.  Has anyone successful got this to work?


'int' is a primitive.  A primary key must be a Serializable.  You cannot 
use 'int' as a primary key.  Try using 'Integer' instead, and see p. 157 
of Monson-Haefel's _Enterprise JavaBeans_ for an example.

-- 
Richard Kasperowski (mailto:[EMAIL PROTECTED])
Tel: 617-576-1552, Fax: 617-576-2441
http://www.altisimo.com/


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to