Package org.apache.openjpa.jdbc.schema

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


    /**
     * 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.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

    /**
     * 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

        OpenJPAEntityManagerFactory pmf =(OpenJPAEntityManagerFactory)
                getEmf(getProps());
        OpenJPAEntityManager pm = (OpenJPAEntityManager) pmf.createEntityManager();
        //FIXME jthomas
        //Sequence gen = pm.getIdentitySequence(SeqF.class);
        Sequence gen=null;
        long next = ((Number) gen.getIncrement()).longValue();
        //FIXME jthomas
        //gen = pm.getIdentitySequence(SeqG.class);
        assertEquals(next + 1, ((Number) gen.getIncrement()).longValue());
        pm.close();
        pmf.close();
    }
View Full Code Here

        OpenJPAEntityManagerFactory pmf =(OpenJPAEntityManagerFactory)
                getEmf(props);
        OpenJPAEntityManager pm = pmf.createEntityManager();
        //FIXME jthomas
        //Sequence gen = pm.getIdentitySequence(SeqF.class);
        Sequence gen =null;
        long next = ((Number) gen.getIncrement()).longValue();
        //FIXME jthomas
        //Sequence gen2 = pm.getIdentitySequence(SeqG.class);
        Sequence gen2 =null;
        long next2 = ((Number) gen2.getIncrement()).longValue();
        if (next2 != next + 1)
            return; // valid.
        assertTrue(((Number) gen.getIncrement()).longValue() != next2 + 1);
       
        pm.close();
View Full Code Here

        int amountToIncrement = generatorIncrement * 2;

        OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
        //FIXME jthomas
        //Sequence s = pm.getIdentitySequence(cls);
        Sequence s =null;
        s.setAllocate(amountToIncrement);

        sql.clear();
        for (int i = 0; i < amountToIncrement; i++) {
            s.getIncrement();
            assertEquals("SQL list should have been empty on sequence"
                + " fetch #" + i + " of #" + amountToIncrement
                + ", but contained: " + sql, 0, sql.size());
        }
    }
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.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

    /**
     * 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

    /**
     * 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

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.