Forums Register Login

@Generatedvalue and MySQL

+Pie Number of slices to send: Send
I can't generate id value in MySQL using @Generatedvalue.
SQLException: no value for 2 parameter in exprection INSERT INTO tab(value, id) values(?, ?)

I tried to use everything what is in commentary

Thanks for help!
+Pie Number of slices to send: Send
Is the column in the database defined correctly as a auto increment column?
+Pie Number of slices to send: Send
Exactly. PrimaryKey, Integer, NotNull, Auto Inc, Unsigned, Zerofill
+Pie Number of slices to send: Send
Normally if you have a column where unique keys are auto-generated, you leave that column out of your INSERT statements.
Look! It's Leonardo da Vinci! And he brought a tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1403 times.
Similar Threads
JPA,/mysql/JBoss and a big head ache
EJB with multiple MapKeys
hibernate to JPA: generator class=increment
HBM to Annotation: Foreign Generator
Leaving any property unmapped to a column in Hibernate using annotation
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 08:15:02.