1 2 Previous Next 15 Replies Latest reply on May 28, 2013 8:54 AM by uwe.risse Go to original post
      • 15. Re: Oracle custom sequence instead of select hibernate_seque
        uwe.risse

        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.

        1 2 Previous Next