#Spring Boot ID generation problem

7 messages · Page 1 of 1 (latest)

uneven violet
#

When I send a POST request to register I get the error "org.postgresql.util.PSQLException: ERROR: null value in column "id" of relation "members" violates not-null constraint
Detail: Failing row contains (null, ttt, noob@noob.com, noob, test).", but shouldnt my id be auto-generated?

obtuse oracleBOT
#

This post has been reserved for your question.

Hey @uneven violet! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

dark mesa
#

by using GenerationType.IDENTITY you basically say. DB it's your job to generate pk values
so if you haven't set the db to auto generate keys it won't work

uneven violet
#

Using the AUTO generation type seems to do the trick.

uneven violet
obtuse oracleBOT
# uneven violet Yep I just found out, thank you!

If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.