I have use columnDefinition to specify default value for a column, however it does not store default value it stores null only,
columnDefinition
Please help regarding this,
Your proposed solution should work, but is database dependent, so you might want to check up on whether your syntax actually works with your concrete DB. Another more generic approach is
@PrePersist void preInsert() { if ( getSourceFrom() == null ) { setSourceFrom( "Case" ); } }
Cheers,