• 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

EJB with multiple MapKeys

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I want to implement EJB with @MapKey and use JBoss 5.1.0.GA.
The following works perfectly (object A):

The database tables (mysql) will look like this:
Table A
Table B,
Table A_B with (A_id, name_id)


But I need more Maps like 'name' in A, e.g.

The database tables (mysql) will look like this:
Table A
Table B,
Table A_B with (A_id, name_id,symbol_id)


If I want to persist a object A (with a single object B in the Map name) I get this error:
Caused by: java.sql.BatchUpdateException: Field 'symbol_id' doesn't have a default value

I'm surprised a little bit about the databse structure and understand the error, but how to solve this??

Thank you
Thorsten
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to our ORM/JPA forum where you might get some answers.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic