Null not allowed for column **ID
I got problems with the default generated strategy GenerationType.AUTO , I add GenerationType.SEQUENCE for
- ScoreCard.java
- Multiplication.java
- MultiplicationResultAttempt.java
- User.java
then everything works just fine.
Please verify this issue and allow me to create a new PR if my solution is correct.
Hi,
Are you using the same library versions as in this repository? Also, please describe exactly what are the problems you're finding.
Thanks!
Hi @mechero ,
The problem is I cannot persist object due to "null pointer exception" with column *ID. I don't think it's due to the difference in version because I already tried using your existing code.
Also from this post of thoughts-on-java. We should use GenerationType.SEQUENCE because it's better in term of performance and it will work on all versions of hibernate.
I'm not saying it's not better to use it, but I need to comment the code to indicate from which version of [Hibernate / Spring Boot / other libraries] the code doesn't work anymore. Keep in mind that this repo is referenced from a book that is "static" between editions so it needs to be very clear in comments what differs from the edition and why it's been changed.
This was certainly working by the time the book got released so there must be a difference somewhere.