JBoss Community

Re: Oracle custom sequence instead of select hibernate_seque

created by Uwe Risse in EJB3 Development - View the full discussion

The thread is rather old but I have the same problem with hibernate 3.6.4.

I could solve this by adding the attribute allocationSize=1 to the annotation

 

In your case:

 

@Id(generate = GeneratorType.SEQUENCE, generator = "mysequence")
@SequenceGenerator(name = "mysequence", sequenceName = "MY_SEQ",
allocationSize=1)
//@SequenceGenerator(name = "mysequence", sequenceName = "hibernate_sequence")
@Column(name = "COVT_ID", primaryKey=true)
public long getId() {
return m_id;
}

 

should work.

Reply to this message by going to Community

Start a new discussion in EJB3 Development at Community