• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Insert in master detail table entity with composite primary key

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am working on a project with MySQL database Java GUI.

This is my SQL script


I created the entity classes with Netbeans 7.0 and created 4 classes:


but I cant enter values to the table and it gives me an error that I am trying to enter null values in as primary keys.

I have found the bug actually in Netbeans forum which is http://netbeans.org/bugzilla/show_bug.cgi?id=105084.

and accordingly I have added the following methods to the class ServiceTaken

upon inserting a new entry in the table I get this error :

Error Code: 1048
Call: INSERT INTO takenservice (PayRecBy, ServRecBy, Quantity, PayStat, ServUsedDate, ResvID, ServID) VALUES (?, ?, ?, ?, ?, ?, ?)
bind => [ddd, ddd, 0, ddd, null, null, null]

What I can do to fix this ? Please help me with this I am running out of time =/
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems like you have incorrectly mapped your class. Include you mappings (annotations/xml).

An elephant? An actual elephant. Into the apartment. How is the floor still here. Hold this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic