Thank you for your response.
I think i am not clear in my question so,felt like pasting my code here.
@Entity
@Table(name = "patient")
@SequenceGenerator (
name="PATIENT_ID_SEQ",
sequenceName="patient_id_sequence",
allocationSize=20
)
@Id
@Column(name = "patient_id", nullable=false, length=100)
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="PATIENT_ID_SEQ")
public Long getPatientId() {
return patientId;
}
in postgreSQL i defined patient_id column as of type serial and its not a primary key field.
with this code its generating patient ids with sequence like 1,2,3,4..........The problem is
allocation size which i have given is not working.So, i felt the sequence is getting generated by postgreSQL.I dont know what the problem is?How do i make allocation
size working?
any ideas?
thanks in advance.
|