XMLWordPrintable

    Details

    • Complexity:
      Low

      Description

      Many database server like Postgres and Oracle use SEQUENCE to generate incremental id in databases. For hibernate to be able to generate the correct id, instead of generating 1 each time, it needs to know about this existing sequence. Liquibase will automatically convert an auto-increment="true" column to be of the type SERIAL or IDENTITY and this will create the default named sequence for the column which is <tablename>_<columnname>_seq.

      For hibernate to recognize and use this sequence, it needs to be mentioned as part of the
      <generator class="native">
      <param name="sequence">sequenceName</param>
      </generator>

      This useful tip can be found: http://www.altuure.com/2008/10/14/hibernate-nativeid-generator-tip/

        Attachments

        1. TRUNK-2620.patch
          68 kB
        2. TRUNK-2620-updated.patch
          68 kB

          Activity

            People

            Assignee:
            sunbiz Saptarshi Purkayastha
            Reporter:
            sunbiz Saptarshi Purkayastha
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: