commit
30f5e68575
|
@ -4,13 +4,23 @@ import javax.persistence.Entity;
|
||||||
import javax.persistence.GeneratedValue;
|
import javax.persistence.GeneratedValue;
|
||||||
import javax.persistence.GenerationType;
|
import javax.persistence.GenerationType;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
import javax.persistence.SequenceGenerator;
|
|
||||||
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
|
import org.hibernate.annotations.Parameter;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
public class User {
|
public class User {
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequence-generator")
|
@GeneratedValue(generator = "sequence-generator")
|
||||||
@SequenceGenerator(name = "sequence-generator", sequenceName = "user_sequence", initialValue = 4)
|
@GenericGenerator(
|
||||||
|
name = "sequence-generator",
|
||||||
|
strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator",
|
||||||
|
parameters = {
|
||||||
|
@Parameter(name = "sequence_name", value = "user_sequence"),
|
||||||
|
@Parameter(name = "initial_value", value = "4"),
|
||||||
|
@Parameter(name = "increment_size", value = "1")
|
||||||
|
}
|
||||||
|
)
|
||||||
private long userId;
|
private long userId;
|
||||||
|
|
||||||
public long getUserId() {
|
public long getUserId() {
|
||||||
|
|
Loading…
Reference in New Issue