Package org.apache.openjpa.jdbc.schema

Examples of org.apache.openjpa.jdbc.schema.Sequence


    public void testSequenceParsing() {
        Schema schema = _group.getSchema("SCHEMA1");
        assertEquals(2, schema.getSequences().length);
        assertEquals(0, _group.getSchema("SCHEMA2").getSequences().length);
       
        Sequence seq1 = schema.getSequence("SEQ1");
        assertNotNull(seq1);
        assertEquals("SEQ1", seq1.getName());
        assertEquals(seq1, _group.findSequence("SEQ1"));
        assertEquals(seq1, _group.findSequence("SCHEMA1.SEQ1"));
        assertEquals(1, seq1.getInitialValue());
        assertEquals(1, seq1.getIncrement());
        assertEquals(0, seq1.getAllocate());
       
        Sequence seq2 = schema.getSequence("SEQ2");
        assertNotNull(seq2);
        assertEquals(3, seq2.getInitialValue());
        assertEquals(5, seq2.getIncrement());
        assertEquals(50, seq2.getAllocate());
    }
View Full Code Here


    /**
     * Create a new sequence from the information in the schema metadata.
     */
    protected Sequence newSequence(ResultSet sequenceMeta)
        throws SQLException {
        Sequence seq = new Sequence();
        seq.setSchemaIdentifier(fromDBName(StringUtils.stripEnd(sequenceMeta.getString("SEQUENCE_SCHEMA"), null),
            DBIdentifierType.SCHEMA));
        seq.setIdentifier(fromDBName(StringUtils.stripEnd(sequenceMeta.getString("SEQUENCE_NAME"), null),
            DBIdentifierType.SEQUENCE));
        return seq;
    }
View Full Code Here

     * Firebird 1.5 surprisingly returns a string right-padded with spaces up
     * to the length of 255.
     */
    @Override
    protected Sequence newSequence(ResultSet sequenceMeta) throws SQLException {
        Sequence seq = super.newSequence(sequenceMeta);
        seq.setIdentifier(DBIdentifier.trim(seq.getIdentifier()));
        return seq;
    }
View Full Code Here

     *
     * @see org.apache.openjpa.jdbc.sql.DBDictionary#newSequence(ResultSet)
     */
    @Override
    protected Sequence newSequence(ResultSet sequenceMeta) throws SQLException {
        Sequence seq = super.newSequence(sequenceMeta);
        seq.setIdentifier(DBIdentifier.trim(seq.getIdentifier()));
        return seq;
    }
View Full Code Here

    /**
     * Create a new sequence from the information in the schema metadata.
     */
    protected Sequence newSequence(ResultSet sequenceMeta)
        throws SQLException {
        Sequence seq = new Sequence();
        seq.setSchemaName(sequenceMeta.getString("SEQUENCE_SCHEMA"));
        seq.setName(sequenceMeta.getString("SEQUENCE_NAME"));
        return seq;
    }
View Full Code Here

    /**
     * Create a new sequence from the information in the schema metadata.
     */
    protected Sequence newSequence(ResultSet sequenceMeta)
        throws SQLException {
        Sequence seq = new Sequence();
        seq.setSchemaName(sequenceMeta.getString("SEQUENCE_SCHEMA"));
        seq.setName(sequenceMeta.getString("SEQUENCE_NAME"));
        return seq;
    }
View Full Code Here

     *
     * @see org.apache.openjpa.jdbc.sql.DBDictionary#newSequence(ResultSet)
     */
    @Override
    protected Sequence newSequence(ResultSet sequenceMeta) throws SQLException {
        Sequence seq = super.newSequence(sequenceMeta);
        seq.setName(seq.getName().trim());
        return seq;
    }
View Full Code Here

    /**
     * Create a new sequence from the information in the schema metadata.
     */
    protected Sequence newSequence(ResultSet sequenceMeta)
        throws SQLException {
        Sequence seq = new Sequence();
        seq.setSchemaName(sequenceMeta.getString("SEQUENCE_SCHEMA"));
        seq.setName(sequenceMeta.getString("SEQUENCE_NAME"));
        return seq;
    }
View Full Code Here

     * Firebird 1.5 surprisingly returns a string right-padded with spaces up
     * to the length of 255.
     */
    @Override
    protected Sequence newSequence(ResultSet sequenceMeta) throws SQLException {
        Sequence seq = super.newSequence(sequenceMeta);
        seq.setName(seq.getName().trim());
        return seq;
    }
View Full Code Here

    /**
     * Create a new sequence from the information in the schema metadata.
     */
    protected Sequence newSequence(ResultSet sequenceMeta)
        throws SQLException {
        Sequence seq = new Sequence();
        seq.setSchemaName(sequenceMeta.getString("SEQUENCE_SCHEMA"));
        seq.setName(sequenceMeta.getString("SEQUENCE_NAME"));
        return seq;
    }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.jdbc.schema.Sequence

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.