1

In java hibernate how to set the default value from the database in column if the value inseting is null using hibernate hbm property?

2

1 Answer 1

0

For .hbm files you can use,default element Ex:-

<column name="age" not-null="true" default="18"/> 
Sign up to request clarification or add additional context in comments.

1 Comment

this didn't work by i think not-null is used to set the column as not null

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.