0 Replies Latest reply on Sep 16, 2003 2:00 PM by Dennis Sosnoski

    Generated SQL problem using OID PKs

    Dennis Sosnoski Newbie

      I'm having a problem trying to link a CMP bean to an existing table structure using MySQL. The PK is an OID, represented in the table as a column oid of type CHAR(16) BINARY. The problem I'm running into is that when I try any finder lookups or even try to create a new instance JBoss is trying to find an additional column (TransactionFile_upk, where TransactionFile is the name of the bean).

      For example, when I try to create an instance using the home.create() call the generated SQL (to check for an existing instance) is:

      SELECT COUNT(*) FROM Transactions WHERE oid-? AND TransactionFile_upk=?

      The (generated) ejb-jar.xml has The ejb-jar.xml has <prim-key-class>java.lang.Object</prim-key-class> and <primkey-field>fileOid</primkey-field>, where 'fileOid' is the property name, so that looks like what I'd expect.

      Any suggestions?