Examples of IdGenerator


Examples of org.activiti.engine.impl.cfg.IdGenerator

     
      // Insert historic process-instance
      getDbSqlSession().insert(historicProcessInstance);
 
      // Also record the start-event manually, as there is no "start" activity history listener for this
      IdGenerator idGenerator = Context.getProcessEngineConfiguration().getIdGenerator();
     
      String processDefinitionId = processInstance.getProcessDefinitionId();
      String processInstanceId = processInstance.getProcessInstanceId();
      String executionId = processInstance.getId();
 
      HistoricActivityInstanceEntity historicActivityInstance = new HistoricActivityInstanceEntity();
      historicActivityInstance.setId(idGenerator.getNextId());
      historicActivityInstance.setProcessDefinitionId(processDefinitionId);
      historicActivityInstance.setProcessInstanceId(processInstanceId);
      historicActivityInstance.setExecutionId(executionId);
      historicActivityInstance.setActivityId(processInstance.getActivityId());
      historicActivityInstance.setActivityName((String) processInstance.getActivity().getProperty("name"));
View Full Code Here

Examples of org.apache.activemq.util.IdGenerator

    private Map<String, AbstractPullPoint> pullPoints;

    public AbstractCreatePullPoint(String name) {
        super(name);
        idGenerator = new IdGenerator();
        pullPoints = new ConcurrentHashMap<String, AbstractPullPoint>();
    }
View Full Code Here

Examples of org.apache.avalon.excalibur.datasource.ids.IdGenerator

     *-------------------------------------------------------------*/
    public void testSimpleRequestIdsSize1() throws Exception
    {
        getLogEnabledLogger().info( "testSimpleRequestIdsSize1" );

        IdGenerator idGenerator =
            (IdGenerator)m_idGeneratorSelector.select( "ids-testSimpleRequestIdsSize1" );
        try
        {
            long firstId = 1;
            int idCount = ID_COUNT;
View Full Code Here

Examples of org.apache.cxf.wsn.util.IdGenerator

    private Map<String, AbstractPullPoint> pullPoints;

    public AbstractCreatePullPoint(String name) {
        super(name);
        idGenerator = new IdGenerator();
        pullPoints = new ConcurrentHashMap<String, AbstractPullPoint>();
    }
View Full Code Here

Examples of org.apache.jetspeed.idgenerator.IdGenerator

            // copy documents under webapp/pages folder without transforming them
            webappDestDirFile = new File("target/testdata/" + pagesDirName+"/webapp-ids");
            dirHelper.setBaseDirectory(webappDestDirFile);
            dirHelper.copyFrom(webappPagesDirFile, noCVSorSVNorBackups);

            IdGenerator idGen = new JetspeedIdGenerator(65536,"P-","");
            FileCache cache = new FileCache(10, 12);
           
            DocumentHandler psmlHandler = new CastorFileSystemDocumentHandler(idGen, "/JETSPEED-INF/castor/page-mapping.xml", Page.DOCUMENT_TYPE, PageImpl.class, "target/testdata/" + pagesDirName, cache);
            DocumentHandler linkHandler = new CastorFileSystemDocumentHandler(idGen, "/JETSPEED-INF/castor/page-mapping.xml", Link.DOCUMENT_TYPE, LinkImpl.class, "target/testdata/" + pagesDirName, cache);
            DocumentHandler folderMetaDataHandler = new CastorFileSystemDocumentHandler(idGen, "/JETSPEED-INF/castor/page-mapping.xml", FolderMetaDataImpl.DOCUMENT_TYPE, FolderMetaDataImpl.class, "target/testdata/" + pagesDirName, cache);
View Full Code Here

Examples of org.apache.lucene.gdata.storage.IDGenerator

    private final IDGenerator idGenerator;


    public StorageCoreControllerStub() throws IOException, StorageException {
        try{
            this.idGenerator = new IDGenerator(5);
        }catch (NoSuchAlgorithmException e) {
            throw new StorageException(e);
        }
      
    }
View Full Code Here

Examples of org.apache.servicemix.id.IdGenerator

        return jbiEndpoint;
    }

    protected String createEndpointName() {
        if (idGenerator == null) {
            idGenerator = new IdGenerator("camel");
        }
        return idGenerator.generateSanitizedId();
    }
View Full Code Here

Examples of org.apache.torque.oid.IdGenerator

        String dbName = criteria.getDbName();
        DatabaseMap dbMap = Torque.getDatabaseMap(dbName);
        TableMap tableMap = dbMap.getTable(table);
        Object keyInfo = tableMap.getPrimaryKeyMethodInfo();
        IdGenerator keyGen = tableMap.getIdGenerator();

        ColumnMap pk = getPrimaryKey(criteria);

        // If the keyMethod is SEQUENCE or IDBROKERTABLE, get the id
        // before the insert.
        if (keyGen != null && keyGen.isPriorToInsert())
        {
            // pk will be null if there is no primary key defined for the table
            // we're inserting into.
            if (pk != null && !criteria.containsKey(pk.getFullyQualifiedName()))
            {
                if (keyGen == null)
                {
                    throw new TorqueException(
                            "IdGenerator for table '" + table + "' is null");
                }

                id = getId(pk, keyGen, con, keyInfo);
                criteria.add(pk.getFullyQualifiedName(), id);
            }
        }

        // Use Village to perform the insert.
        TableDataSet tds = null;
        try
        {
            String tableName = SQLBuilder.getFullTableName(table, dbName);
            tds = new TableDataSet(con, tableName);
            Record rec = tds.addRecord();
            // not the fully qualified name, insertOrUpdateRecord wants to use table as an index...
            BasePeer.insertOrUpdateRecord(rec, table, dbName, criteria);
        }
        catch (Exception e)
        {
            throwTorqueException(e);
        }
        finally
        {
            VillageUtils.close(tds);
        }

        // If the primary key column is auto-incremented, get the id
        // now.
        if (keyGen != null && keyGen.isPostInsert())
        {
            id = getId(pk, keyGen, con, keyInfo);
        }

        return id;
View Full Code Here

Examples of org.apache.torque.oid.IdGenerator

        }

        DatabaseMap dbMap = Torque.getDatabaseMap(criteria.getDbName());
        TableMap tableMap = dbMap.getTable(tableName);
        Object keyInfo = tableMap.getPrimaryKeyMethodInfo();
        IdGenerator keyGen = tableMap.getIdGenerator();

        ColumnMap pk = getPrimaryKey(criteria);

        // pk will be null if there is no primary key defined for the table
        // we're inserting into.
        if (pk != null && !criteria.containsKey(pk.getFullyQualifiedName()))
        {
            if (keyGen == null)
            {
                throw new TorqueException(
                    "IdGenerator for table '" + tableName + "' is null");
            }
            // If the keyMethod is SEQUENCE or IDBROKERTABLE, get the id
            // before the insert.

            if (keyGen.isPriorToInsert())
            {
                try
                {
                    if (pk.getType() instanceof Number)
                    {
                        id = new NumberKey(
                                keyGen.getIdAsBigDecimal(con, keyInfo));
                    }
                    else
                    {
                        id = new StringKey(keyGen.getIdAsString(con, keyInfo));
                    }
                }
                catch (Exception e)
                {
                    throwTorqueException(e);
                }
                criteria.add(pk.getFullyQualifiedName(), id);
            }
        }

        // Use Village to perform the insert.
        TableDataSet tds = null;
        try
        {
            tds = new TableDataSet(con, tableName);
            Record rec = tds.addRecord();
            BasePeer.insertOrUpdateRecord(rec, tableName, criteria);
        }
        catch (Exception e)
        {
            throwTorqueException(e);
        }
        finally
        {
            if (tds != null)
            {
                try
                {
                    tds.close();
                }
                catch (Exception e)
                {
                    throwTorqueException(e);
                }
            }
        }

        // If the primary key column is auto-incremented, get the id
        // now.
        if (pk != null && keyGen != null && keyGen.isPostInsert())
        {
            try
            {
                if (pk.getType() instanceof Number)
                {
                    id = new NumberKey(keyGen.getIdAsBigDecimal(con, keyInfo));
                }
                else
                {
                    id = new StringKey(keyGen.getIdAsString(con, keyInfo));
                }
            }
            catch (Exception e)
            {
                throwTorqueException(e);
View Full Code Here

Examples of org.apache.torque.oid.IdGenerator

        String dbName = criteria.getDbName();
        Database database = Torque.getDatabase(dbName);
        DatabaseMap dbMap = database.getDatabaseMap();
        TableMap tableMap = dbMap.getTable(table);
        Object keyInfo = tableMap.getPrimaryKeyMethodInfo();
        IdGenerator keyGen
                = database.getIdGenerator(tableMap.getPrimaryKeyMethod());

        ColumnMap pk = getPrimaryKey(criteria);

        // If the keyMethod is SEQUENCE or IDBROKERTABLE, get the id
        // before the insert.
        if (keyGen != null && keyGen.isPriorToInsert())
        {
            // pk will be null if there is no primary key defined for the table
            // we're inserting into.
            if (pk != null && !criteria.containsKey(pk.getFullyQualifiedName()))
            {
                id = getId(pk, keyGen, con, keyInfo);
                criteria.add(pk.getFullyQualifiedName(), id);
            }
        }

        // Use Village to perform the insert.
        TableDataSet tds = null;
        try
        {
            String tableName = SQLBuilder.getFullTableName(table, dbName);
            tds = new TableDataSet(con, tableName);
            Record rec = tds.addRecord();
            // not the fully qualified name, insertOrUpdateRecord wants to use table as an index...
            BasePeer.insertOrUpdateRecord(rec, table, dbName, criteria);
        }
        catch (DataSetException e)
        {
            throwTorqueException(e);
        }
        catch (SQLException e)
        {
            throwTorqueException(e);
        }
        catch (TorqueException e)
        {
            throwTorqueException(e);
        }
        finally
        {
            VillageUtils.close(tds);
        }

        // If the primary key column is auto-incremented, get the id
        // now.
        if (keyGen != null && keyGen.isPostInsert())
        {
            id = getId(pk, keyGen, con, keyInfo);
        }

        return id;
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.