0
如何在春季使用@SequenceGenerator如何在春季使用@SequenceGenerator
如何在春季使用@SequenceGenerator如何在春季使用@SequenceGenerator
你不這樣做。
也就是說,javax.persistence.SequenceGenerator
與Spring沒有任何關係,它是JPA(Hibernate,Toplink,...);例如:
@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;
這是JPA,而不是JTA – 2011-05-05 13:14:03
對不起,是一個錯字 – 2011-05-05 13:15:43