Examples of SequenceManager


Examples of org.apache.ojb.broker.util.sequence.SequenceManager

    }

    private List createKeyList(PersistenceBroker broker, FieldDescriptor field, int number)
            throws SequenceManagerException
    {
        SequenceManager sm = SequenceManagerFactory.getSequenceManager(broker);
        List resultList = new ArrayList();
        int result;
        for (int i = 0; i < number; i++)
        {
            Integer val = (Integer) sm.getUniqueValue(field);
            result = val.intValue();
            resultList.add(new Integer(result));
        }
        return resultList;
    }
View Full Code Here

Examples of org.apache.ojb.broker.util.sequence.SequenceManager

        try
        {
            jcd.setSequenceDescriptor(new SequenceDescriptor(jcd, SequenceManagerStoredProcedureImpl.class));
            PersistenceBrokerFactory.releaseAllInstances();
            broker = PersistenceBrokerFactory.defaultPersistenceBroker();
            SequenceManager sm = broker.serviceSequenceManager();
            if (!(sm instanceof SequenceManagerStoredProcedureImpl))
            {
                fail("testSM_StoredProcedure: Expected sequence manager implemenation was " +
                        SequenceManagerStoredProcedureImpl.class.getName());
                return;
            }
            // now we start the tests
            FieldDescriptor field = broker.getClassDescriptor(targetClass).getAutoIncrementFields()[0];
            sm.getUniqueValue(field);

            generatedKeys.clear();
// comment in
//            testSequenceGeneration();
//            testMultipleAutoincrement();
View Full Code Here

Examples of org.apache.ojb.broker.util.sequence.SequenceManager

    public void testObjectsFromAbstractBaseClass1() throws Exception
    {
        PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker();
        try
        {
            SequenceManager sm = broker.serviceSequenceManager();
            FieldDescriptor fld_1 = broker.getClassDescriptor(SMObjectOne.class).getAutoIncrementFields()[0];
            FieldDescriptor fld_2 = broker.getClassDescriptor(SMObjectTwo.class).getAutoIncrementFields()[0];

            Object result_1 = sm.getUniqueValue(fld_1);
            Object result_2 = sm.getUniqueValue(fld_2);

            assertNotNull(result_1);
            assertNotNull(result_2);
            assertTrue(result_1 instanceof Integer);
            assertTrue(result_2 instanceof Integer);

            result_1 = sm.getUniqueValue(fld_1);
            result_2 = sm.getUniqueValue(fld_2);

            assertNotNull(result_1);
            assertNotNull(result_2);
            assertTrue(result_1 instanceof Integer);
            assertTrue(result_2 instanceof Integer);
View Full Code Here

Examples of org.apache.phoenix.compile.SequenceManager

                new SingleKeyValueTuple(new KeyValue(B, SINGLE_COLUMN_FAMILY, SINGLE_COLUMN, PDataType.LONG.toBytes(2L))),
            };

        PhoenixConnection pconn = DriverManager.getConnection(getUrl(), PropertiesUtil.deepCopy(TEST_PROPERTIES)).unwrap(PhoenixConnection.class);
        PhoenixStatement statement = new PhoenixStatement(pconn);
        StatementContext context = new StatementContext(statement, null, new Scan(), new SequenceManager(statement));
        AggregationManager aggregationManager = context.getAggregationManager();
        SumAggregateFunction func = new SumAggregateFunction(Arrays.<Expression>asList(new KeyValueColumnExpression(new PLongColumn() {
            @Override
            public PName getName() {
                return SINGLE_COLUMN_NAME;
View Full Code Here

Examples of org.apache.phoenix.compile.SequenceManager

    public QueryPlan optimize(PhoenixStatement statement, SelectStatement select) throws SQLException {
        return optimize(statement, select, FromCompiler.getResolverForQuery(select, statement.getConnection()), Collections.<PColumn>emptyList(), null);
    }

    public QueryPlan optimize(PhoenixStatement statement, SelectStatement select, ColumnResolver resolver, List<? extends PDatum> targetColumns, ParallelIteratorFactory parallelIteratorFactory) throws SQLException {
        QueryCompiler compiler = new QueryCompiler(statement, select, resolver, targetColumns, parallelIteratorFactory, new SequenceManager(statement));
        QueryPlan dataPlan = compiler.compile();
        return optimize(dataPlan, statement, targetColumns, parallelIteratorFactory);
    }
View Full Code Here

Examples of org.apache.phoenix.compile.SequenceManager

            }
           
        };
        PhoenixConnection connection = DriverManager.getConnection(getUrl(), PropertiesUtil.deepCopy(TEST_PROPERTIES)).unwrap(PhoenixConnection.class);
        PhoenixStatement statement = new PhoenixStatement(connection);
        StatementContext context = new StatementContext(statement, resolver, scan, new SequenceManager(statement));
        context.setScanRanges(scanRanges);
        SkipRangeParallelIteratorRegionSplitter splitter = SkipRangeParallelIteratorRegionSplitter.getInstance(context, tableRef, HintNode.EMPTY_HINT_NODE);
        List<KeyRange> keyRanges = splitter.getSplits();
        Collections.sort(keyRanges, new Comparator<KeyRange>() {
            @Override
View Full Code Here

Examples of org.apache.phoenix.compile.SequenceManager

            throws SQLException {
        TableRef tableRef = getTableRef(conn, ts);
        PhoenixConnection pconn = conn.unwrap(PhoenixConnection.class);
        final List<HRegionLocation> regions =  pconn.getQueryServices().getAllTableRegions(tableRef.getTable().getPhysicalName().getBytes());
        PhoenixStatement statement = new PhoenixStatement(pconn);
        StatementContext context = new StatementContext(statement, null, scan, new SequenceManager(statement));
        DefaultParallelIteratorRegionSplitter splitter = new DefaultParallelIteratorRegionSplitter(context, tableRef, HintNode.EMPTY_HINT_NODE) {
            @Override
            protected List<HRegionLocation> getAllRegions() throws SQLException {
                return DefaultParallelIteratorRegionSplitter.filterRegions(regions, scan.getStartRow(), scan.getStopRow());
            }
View Full Code Here

Examples of org.apache.phoenix.compile.SequenceManager

                new SingleKeyValueTuple(new KeyValue(B, SINGLE_COLUMN_FAMILY, SINGLE_COLUMN, PDataType.LONG.toBytes(2L))),
            };

        PhoenixConnection pconn = DriverManager.getConnection(getUrl(), PropertiesUtil.deepCopy(TEST_PROPERTIES)).unwrap(PhoenixConnection.class);
        PhoenixStatement statement = new PhoenixStatement(pconn);
        StatementContext context = new StatementContext(statement, null, new Scan(), new SequenceManager(statement));
        AggregationManager aggregationManager = context.getAggregationManager();
        SumAggregateFunction func = new SumAggregateFunction(Arrays.<Expression>asList(new KeyValueColumnExpression(new PLongColumn() {
            @Override
            public PName getName() {
                return SINGLE_COLUMN_NAME;
View Full Code Here

Examples of org.apache.phoenix.compile.SequenceManager

    public QueryPlan optimize(PhoenixStatement statement, SelectStatement select) throws SQLException {
        return optimize(statement, select, FromCompiler.getResolverForQuery(select, statement.getConnection()), Collections.<PColumn>emptyList(), null);
    }

    public QueryPlan optimize(PhoenixStatement statement, SelectStatement select, ColumnResolver resolver, List<? extends PDatum> targetColumns, ParallelIteratorFactory parallelIteratorFactory) throws SQLException {
        QueryCompiler compiler = new QueryCompiler(statement, select, resolver, targetColumns, parallelIteratorFactory, new SequenceManager(statement));
        QueryPlan dataPlan = compiler.compile();
        return optimize(dataPlan, statement, targetColumns, parallelIteratorFactory);
    }
View Full Code Here

Examples of org.olat.modules.scorm.server.sequence.SequenceManager

      _defaultorg = _navViewer.getDefaultOrgElement(orgs);
      // NO orgs, so cant play - flag it
      if (_defaultorg == null) {
        _ReloadNoItemFoundExceptionFlag = false;
      } else {
        _sequence = new SequenceManager(_defaultorg.getAttributeValue(CP_Core.IDENTIFIER), scormSettingsHandler);
        // it exists so try to load it...
        try {
          initialize();
        } catch (Exception ex) {
          _error_found = true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.