1 Reply Latest reply on Feb 19, 2002 1:45 AM by Dain Sundstrom

    Unknown (or generated) primary keys

    Paul Boddie Newbie

      According to the J2EE tutorial and the EJB 2.0 specification, it should be possible to state a "primkey-class" field whose value is "java.lang.Object", and to provide appropriate ejbCreate and findByPrimaryKey methods which use Object, as opposed to other primary key types.

      Is this actually possible in JBoss 3.0.0alpha? I seem to get an error report which includes...

      javax.transaction.TransactionRolledbackException: id may not be null; nested exception is:
      java.lang.Error: id may not be null
      java.lang.Error: id may not be null
      at org.jboss.ejb.CacheKey.(CacheKey.java:76)
      at org.jboss.ejb.plugins.EntityInstanceCache.createCacheKey(EntityInstanceCache.java:48)
      at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:259)
      at org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:673)
      at java.lang.reflect.Method.invoke(Native Method)

      See also: http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/CMP8.html#73260