java.sql.SQLException: Field ‘userId’ doesn’t have a default value
This exception tells us that the userId value in the underlying database is not
configured with the appropriate generation type.
Hibernate 5.x.x comes with the modified version for strategy=GenerationType.
You just have to mention annotation @GeneratedValue and not any strategy is required and
make sure the userId or any primary key for that matter should be set to Auto Increment
for the table to generate its own Id in auto increment fashion.
This worked for me and mind you the exceptions differ based on the frameworks and the type of
application you are using.
Update here if you have come across similar yet different domain exception to improve this post.