当前位置: 首页>>代码示例>>Java>>正文


Java OObjectDatabaseTx.query方法代码示例

本文整理汇总了Java中com.orientechnologies.orient.object.db.OObjectDatabaseTx.query方法的典型用法代码示例。如果您正苦于以下问题:Java OObjectDatabaseTx.query方法的具体用法?Java OObjectDatabaseTx.query怎么用?Java OObjectDatabaseTx.query使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.orientechnologies.orient.object.db.OObjectDatabaseTx的用法示例。


在下文中一共展示了OObjectDatabaseTx.query方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: query

import com.orientechnologies.orient.object.db.OObjectDatabaseTx; //导入方法依赖的package包/类
public <RET extends List<?>> RET query(OQuery<?> iCommand, Object... iArgs)
{
    final OObjectDatabaseTx databaseTx = repositorySource.getObjectDatabaseTx();

    List<Transaction> list = databaseTx.query(iCommand, iArgs);

    try
    {
        return (RET) detach(databaseTx, list);
    }
    finally
    {
        databaseTx.close();
    }
}
 
开发者ID:geekflow,项目名称:light,代码行数:16,代码来源:RepositoryExecutor.java

示例2: saveTaskJoin

import com.orientechnologies.orient.object.db.OObjectDatabaseTx; //导入方法依赖的package包/类
private String saveTaskJoin(String caseId, String taskName, OObjectDatabaseTx database) {
    List<ODocument> currentIteration = database.query(new OSQLSynchQuery<ODocument>("SELECT MAX(in.iteration) FROM ProcessTaskList WHERE [email protected] = " + caseId + " AND in.taskName = '" + taskName + "'", 1));
    Integer iteration = currentIteration.size() > 0 ? Integer.parseInt(currentIteration.get(0).field("MAX").toString()) + 1 : 1;
    ODocument join = new ODocument("TaskJoin");
    join.field("iteration", iteration);
    join.field("taskName", taskName);
    join.field("caseId", caseId);
    join.save();
    return join.getIdentity().toString();
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:11,代码来源:InternalAPI.java

示例3: getVariableValues

import com.orientechnologies.orient.object.db.OObjectDatabaseTx; //导入方法依赖的package包/类
protected Map<String, Object> getVariableValues(String caseId) {
    logger.log(Level.INFO, "InternalAPI.getVariableValues {0}", new Object[]{caseId});
    Map<String, Object> result = new HashMap<>();
    OObjectDatabaseTx database = getOObjectDatabaseTxReloadClasses();
    List<ODocument> variables = database.query(new OSQLSynchQuery<ODocument>("SELECT name, in.asString() FROM Variable WHERE out = " + caseId));
    for (ODocument variable : variables) {
        Object value = database.load(new ORecordId(variable.field("in").toString()));
        result.put(variable.field("name").toString(), value);
    }
    return detachMap(result);
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:12,代码来源:InternalAPI.java

示例4: modify

import com.orientechnologies.orient.object.db.OObjectDatabaseTx; //导入方法依赖的package包/类
@Override
public Transaction modify(Transaction transaction)
{
    OObjectDatabaseTx databaseTx = repositorySource.getObjectDatabaseTx();

    try
    {
        databaseTx.begin();

        //            List<ODocument> result = documentTx.query(new OSQLSynchQuery<ODocument>("SELECT * FROM transaction WHERE id = " + transaction.getId() + ""));
        List<ODocument> result = databaseTx.query(new OSQLSynchQuery<ODocument>("SELECT * FROM transaction"));


        //                int recordsUpdated = documentTx.command(new OCommandSQL("UPDATE Classes SET byteCode = " + classes.getByteCodes() + " WHERE name = " + classes.getName())).execute();

        //                for (ODocument document : documentTx.browseClass("transaction"))
        //                {
        //                    document.field("id", transaction.getId());
        //                    document.field("oid", transaction.getOid());
        //                    document.field("guid", transaction.getGuid());
        //                    document.field("endTime", transaction.getEndTime());
        //                    document.field("elapsedTime", transaction.getElapsedTime());
        //                    document.field("cpuTime", transaction.getCpuTime());
        //                    document.field("sqlCount", transaction.getSqlCount());
        //                    document.field("sqlTime", transaction.getSqlTime());
        //                    document.field("fetchCount", transaction.getFetchCount());
        //                    document.field("fetchTime", transaction.getFetchTime());
        //                    document.field("ipAddress", transaction.getIpAddress());
        //                    document.field("transactionHash", transaction.getTransactionHash());
        //                    document.field("browserHash", transaction.getBrowserHash());
        //                    document.field("userHash", transaction.getUserHash());
        //                    document.save();
        //                }
        //                documentTx.getMetadata().getSchema().reload();

        databaseTx.commit();
    }
    catch (Exception exception)
    {
        databaseTx.rollback();
    }
    finally
    {
        databaseTx.close();
    }

    return transaction;
}
 
开发者ID:geekflow,项目名称:light,代码行数:49,代码来源:TransactionDaoImpl.java


注:本文中的com.orientechnologies.orient.object.db.OObjectDatabaseTx.query方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。