I have a Oracle sequence
create sequence S_MEETINGNO
minvalue 1
maxvalue 9999999999999999999999999999
start with 220
increment by 1
cache 20;
I am using JPA. The sequence is set in my entity class as follows:-
@Id
@SequenceGenerator(name=“MEETING_MEETINGNO_GENERATOR”, sequenceName=“S_MEETINGNO”)
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator=“MEETING_MEETINGNO_GENERATOR”)
private long meetingno;
When i insert a new row, the value does not appear to be the next in the sequence (last attempt returned a value of 167).
Meeting m = new Meeting("<Enter Meeting Name>", "<Enter Meeting Description>", "<Enter location>", null, fromDate, toDate, "Blue", user.getUserno(), "<Enter Meeting Notes>", null);
Object itemId = meetings.addEntity(m);
EntityItem <Meeting> meetingEntityItem = meetings.getItem(itemId);
this.myMeetingNo = (Long) meetingEntityItem.getItemId(); // get the new meeting number
Any ideas?