摘要: column注解中的columnDefinition属性用于覆盖数据库DDL中的语句:(MySql) @Column(columnDefinition = "int(11) DEFAULT NULL COMMENT '类型'") public Integer getType() { return type; }因此,又可以为该列添加comment注释。然而,columnDefinition不推荐使用,因为可能导致移植性不好,各个数据库不兼容等。 阅读全文
posted @ 2013-08-26 17:16 无忧之路 阅读(18120) 评论(2) 推荐(0) 编辑
摘要: @Id @SequenceGenerator(name="increment") @GeneratedValue(strategy=GenerationType.AUTO, generator="increment") public Integer getId() { return id; }经测试,MySql数据库可用。 阅读全文
posted @ 2013-08-26 17:08 无忧之路 阅读(1140) 评论(0) 推荐(1) 编辑
无忧之路