OpenJPA
  1. OpenJPA
  2. OPENJPA-1788

Problem in Firebird 2.1 with sequence creation

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0, 2.0.1, 2.0.2
    • Fix Version/s: 2.1.0
    • Component/s: jdbc
    • Labels:
      None
    • Environment:
      FirebirdSQL 2.1.3
      jaybird 2.1.6

      Description

      Create a simple entity

      @Entity
      public class ana_anagrafica implements Serializable {
      private static final long serialVersionUID = 1L;

      private Long id;

      @SequenceGenerator(name="ANA_ANAGRAFICA_GEN")
      @Id
      @GeneratedValue(strategy = GenerationType.SEQUENCE,generator="ANA_ANAGRAFICA_GEN")
      public Long getId()

      { return id; }

      public void setId(Long id)

      { this.id = id; }

      }

      in the sequence creation the SQL returned from FirebirdDictionary is wrong,
      method

      @Override
      protected String getSequencesSQL(DBIdentifier schemaName, DBIdentifier sequenceName)

      { StringBuilder buf = new StringBuilder(sequenceSQL); if (sequenceName != null) buf.append(sequenceNameSQL); return buf.toString(); }

      should be

      @Override
      protected String getSequencesSQL(DBIdentifier schemaName, DBIdentifier sequenceName) {
      StringBuilder buf = new StringBuilder(sequenceSQL);
      if(!DBIdentifier.isNull(sequenceName))

      { buf.append(sequenceNameSQL); }

      return buf.toString();
      }

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Michael Dick
            Reporter:
            Diego Cattelan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development