Forums Register Login

Insert in master detail table entity with composite primary key

+Pie Number of slices to send: Send
Hello,

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:

Service
Reservation
ServiceTaken
ServiceTakenPK

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 =/
+Pie Number of slices to send: Send
Seems like you have incorrectly mapped your class. Include you mappings (annotations/xml).

See,
http://en.wikibooks.org/wiki/Java_Persistence/Identity_and_Sequencing
bacon. tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1139 times.
Similar Threads
Hypersonic DB question
Restore problem
ManyToOne relation with composite keys
Three problems with mysql...
Updaing image field in Sql server
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 15, 2024 22:12:03.