相关文章推荐

1. 示例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
@Entity(name = "person")
public class Person implements Serializable {
@Id
@GeneratedValue
private Long id;
@Column(nullable = false, length = 32)
private String name;
@Column(length = 128)
private String mail;
@Column(columnDefinition = "char(11) NOT NULL")
private String phone;
@Column(precision = 5, scale = 2)
private BigDecimal salary;
@Column(precision = 5, scale = 2)
private double assets;
// getters and setters
}

产生的 DDL 语句(MySQL):

 
推荐文章