JPA @Column Description
@Column (name= "ColumnName"; boolean unique () default False;boolean nullable () default True;boolean insertable () default True;boolean updatable () default true; String columndefinition () default ""; String table () default ""; int length () default 255;int precision () default 0; Decimal Precisionint scale () default 0; Decimal scalename Optional, field name (default value is property name) unique optional, whether to set a unique constraint on this field (the default value of false) nullable optional, whether to set the value of the field can be empty (default value false) Insertable Optionally, whether the field is a field in the resulting INSERT statement (the default is true) updatable optional, whether the field is a field in the generated UPDATE statement (the default value true) ColumnDefinition Optional: Overwrite the SQL DDL fragment for this specific field (this may result in the inability to migrate between different databases) Table optional, define the corresponding table (default is the primary table) length is optional, field length (default value 255) Precision optional, field numeric precision (default 0) scale is optional, If the field number scale is available, this setting (the default value of 0) for example: @Column (columndefinition= "int default 0", Nullable=false,insertable=false,updatable=false ) Integer enmenuvertag;//English dishes have been verified //0: not verified 1: Verified @column (columndefinition= "varchar (255) Default ' x '", Nullable=false,insertable=false,updatable=false) String enmenuverid;//English food Check person @temporal (Temporaltype.timestamp) @ Column (Columndefinition= "timestamptz default ' 2009-01-01 00:00:00 '", Nullable=false,insertable=false,updatable=false) Date enmenuvertime;//English Food Check Time
This article is from the "beautiful Dē‖java Question" blog, please be sure to keep this source http://teny32.blog.51cto.com/8027509/1654705
Hibernate JPA @Column Description