public class Blog {
@Id
@GeneratedValue(strategy = GenerationType.TABLE)
private Long id;
@Field(name = “标题”)
private String title;
@Field(name = “简介”)
private String intro;
@Field(name = “用户名”)
private String author;
@Field(name = “管理员密码”)
private String password;
@Field(name=”域名”)
private String domain;
@Field(name = “联系邮箱”)
private String email;
@Field(name = “使用皮肤”)
private String theme;
@Field(name = “公告”)
private String announce;
@Field(name = “页首自定义”)
private String header;
@Field(name = “页脚自定义”)
private String footer;
@Field(name = “关键字”)
private String keywords;
@Field(name = “访问量”)
private Integer hits = 0;
…
…
}
像这样的,看了解析是说在数据库建表的时候,字段是用@里面的值,但是具体的数据库建表是怎样建,麻烦又个代码简单的说明。
并且不是所有的@都用来建表用的。还有一些其他的@用处,可以举个例说明下么,谢谢