Changes for BAEL-2243

This commit is contained in:
Nikhil Khatwani 2018-10-09 23:47:04 +05:30
parent 7d03f03ebb
commit a0d084751a
1 changed files with 12 additions and 2 deletions

View File

@ -4,13 +4,23 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;
@Entity
public class User {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequence-generator")
@SequenceGenerator(name = "sequence-generator", sequenceName = "user_sequence", initialValue = 4)
@GenericGenerator(
name = "genericGenerator",
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;
public long getUserId() {