Jpa set the default value constraints

 

SpringDataJpa field is set using two ways Default constraints

// The first way is to modify the attributes defined in the column build table 
the @Column (columnDefinition = "VARCHAR (35) default '12345'" )
 // second is provided by the following Hibernate (org.hibernate.annotations.ColumnDefault) the comment set the default value 
@ColumnDefault ( "12345")

 

// When stored, Insert field value according to whether there is enumerated list of values to be set by means insertion 
@DynamicInsert    // dynamic insertion
 // and @DynamicInsert Similarly, means that the refreshing operation 
@DynamicUpdate   // Dynamic update

 

Guess you like

Origin www.cnblogs.com/XingXiaoMeng/p/11374338.html