0 Replies Latest reply on Aug 14, 2003 10:57 AM by hjhuber

    Internal error getting results for field member id

    hjhuber Newbie

      Hello,

      I have a problem with an Entity Bean and a Custom Primary Key class. The classes name is myPackage.GenericId and I defined the methods:

      /**
      * @ejb:persistent-field
      * @ejb:pk-field
      *
      * @jboss:column-name name="strId"
      **/
      public abstract GenericId getId();
      public abstract void setId( GenericId pId );

      I defined a type-mapping from myPackage.GenericId to SQL-Type CHAR(16) and JDBC-Type CHAR (tried STRING as well) for sapDB.

      JBOSS (Version 3.2.1) correctly creates the tables and when creating new objects they will be correctly written to the db.

      But when I call a finder method (e. g. findAll()) I receive the following error:

      javax.ejb.FinderException: Find failed: javax.ejb.EJBException: Internal error getting results for field member id; CausedByException is:
      Got a java.lang.String[cl=0, value=4534] while looking for a myPackage.GenericId[cl=4055775]
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:194)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:91)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEntitiesCommand.java:40)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities(JDBCStoreManager.java:599)
      at org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManager.java:324)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntities(CachedConnectionInterceptor.java:323)
      at org.jboss.ejb.EntityContainer.findLocal(EntityContainer.java:603)

      It seems as if the Container would not convert the String data back to an object of class GenericId.

      Does anyone know how to deal with this?

      Thanks,

      Hans