Merge pull request #5412 from khatwaniNikhil/BAEL-2243

Bael 2243
This commit is contained in:
Loredana Crusoveanu 2018-10-09 22:56:07 +03:00 committed by GitHub
commit 30f5e68575
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 3 deletions

View File

@ -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() {