myeclipse生成注解实体

1.选择java类型,会生成Long,hibernate只会生成long

2.SEQUENCE主键

@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE,generator="role_seq")
@SequenceGenerator(name="role_seq", sequenceName="SEQ_SYS_ROLES")
@Column(name = "ID", unique = true, nullable = false, precision = 22, scale = 0)

3.程序自己控制

@GeneratedValue(generator = "paymentableGenerator")    

@GenericGenerator(name = "paymentableGenerator", strategy = "assigned")   

4.自动增长列

@GeneratedValue(strategy = IDENTITY)

posted @ 2012-09-26 12:54  七郎  Views(1109)  Comments(0Edit  收藏  举报