Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-1788

Problem in Firebird 2.1 with sequence creation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0, 2.0.1, 2.0.2
    • 2.1.0
    • jdbc
    • None
    • 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();
      }

      Attachments

        Activity

          People

            mikedd Michael Dick
            diegocattelan Diego Cattelan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: