如何在Spring中使用@SequenceGenerator
答案 0 :(得分:1)
你没有。
这就是说,javax.persistence.SequenceGenerator
与春天无关;这是JPA(Hibernate,Toplink,...); e.g:
@Entity
@Table(name = "APPLICATION")
public class Application {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "APPLICATION_SEQ")
@SequenceGenerator(name = "APPLICATION_SEQ", sequenceName = "APPLICATION_SEQ", allocationSize = 1)
@Column(name = "APPLICATION_ID")
private Integer id;