sybase和mysql自增id

在实体类中设置
@Id
@GeneratedValue(strategy=GenerationType.TABLE,generator="MESSAGE_INFO_IDGEN")
@TableGenerator(
            name="MESSAGE_INFO_IDGEN",
            table="GAF_ID_GEN",
            pkColumnName="\"KEY\"",
            valueColumnName="VALUE",
            pkColumnValue="MESSAGE_INFO",
            allocationSize=1)
private Long id;//主键id

你可能感兴趣的:(Sybase)