Answers for "i add new column and set default value spring boot"

1

jpa default value

@Entity
public class User {    
  @Id    
  Long id;     
  
  @Column(columnDefinition = "varchar(255) default 'John Snow'")    
  private String name;     
  
  @Column(columnDefinition = "integer default 25")    
  private Integer age;     
  
  @Column(columnDefinition = "boolean default false")    
  private Boolean locked;
}
Posted by: Guest on October-15-2020

Code answers related to "i add new column and set default value spring boot"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language