• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Multiple key field

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Having trouble getting JBoss to know which fields are part of my entity, when using a compound key.
My table has 3 Strings as the PK. No other columns. I created a PK class, and map to it in the ejbjar.xml


...
<prim-key-class>com.titan.rick.Report_tPK</prim-key-class>
...
<cmp-field><field-name>reportType</field-name></cmp-field>
<cmp-field><field-name>month</field-name></cmp-field>
<cmp-field><field-name>year</field-name></cmp-field>
...


And as far as I can tell, coded the Interfaces and the abstract Bean class OK.
Upon deployment, JBoss logs that it successfully created and deleted an entity:


JDBCCreateEntityCommand.Report_tEJB] Insert Entity SQL: INSERT INTO Report_t (ReportType, Month, Year) VALUES (?, ?, ?)
JDBCCreateEntityCommand.Report_tEJB] Entity Exists SQL: SELECT COUNT(*) FROM Report_t WHERE
JDBCCommandFactory.Report_tEJB] entity-command: [commandName=default,commandClass=class org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand,attributes={}]
JDBCRemoveEntityCommand.Report_tEJB] Remove SQL: DELETE FROM Report_t WHERE


-->> Nothing follows the WHERE clause.
And likewise, when my client attempts to do a findByPrimaryKey(), the similar problem is generated:


Executing SQL: SELECT FROM Report_t WHERE
jdbc.JDBCFindByPrimaryKeyQuery.Report_tEJB.findByPrimaryKey] Find failed


No fields in the SELECT and no fields/values in the WHERE.
Any suggestions?
Thanks in advance.
 
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rick,

Did u find a solution to your problem? We face a similar problem with JBoss 3.2.3 and MySQL 4.0.17

Thanks in advance
Sudharsan
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic