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


Java OIdentifiable.getRecord方法代码示例

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


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

示例1: execute

import com.orientechnologies.orient.core.db.record.OIdentifiable; //导入方法依赖的package包/类
@Override
public Object execute(final Object iThis,
                      final OIdentifiable iCurrentRecord,
                      final Object iCurrentResult,
                      final Object[] iParams,
                      final OCommandContext iContext)
{
  OIdentifiable identifiable = (OIdentifiable) iParams[0];
  ODocument document = identifiable.getRecord();
  String browsedRepositoryName = (String) iParams[1];
  boolean jexlOnly = iParams.length > 2 && (boolean) iParams[2];

  switch (document.getClassName()) {
    case "asset":
      return checkAssetPermissions(document, browsedRepositoryName, jexlOnly);
    case "component":
      return checkComponentAssetPermissions(document, browsedRepositoryName, jexlOnly);
    default:
      return false;
  }
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:22,代码来源:ContentAuth.java

示例2: involvedIndex

import com.orientechnologies.orient.core.db.record.OIdentifiable; //导入方法依赖的package包/类
protected OLuceneFullTextIndex involvedIndex(OIdentifiable iRecord, ODocument iCurrentResult, OSQLFilterCondition iCondition,
    Object iLeft, Object iRight) {

  ODocument doc = iRecord.getRecord();
  Set<OIndex<?>> classInvolvedIndexes = getDatabase().getMetadata().getIndexManager()
      .getClassInvolvedIndexes(doc.getClassName(), fields(iCondition));

  OLuceneFullTextIndex idx = null;
  for (OIndex<?> classInvolvedIndex : classInvolvedIndexes) {

    if (classInvolvedIndex.getInternal() instanceof OLuceneFullTextIndex) {
      idx = (OLuceneFullTextIndex) classInvolvedIndex.getInternal();
      break;
    }
  }
  return idx;
}
 
开发者ID:orientechnologies,项目名称:orientdb-lucene,代码行数:18,代码来源:OLuceneTextOperator.java

示例3: getRecordByUUIDStr

import com.orientechnologies.orient.core.db.record.OIdentifiable; //导入方法依赖的package包/类
public ODocument getRecordByUUIDStr(String id, String orientClass) 
			throws ObjectNotFoundException, NdexException {
		
		//try {
			OIndex<?> Idx;
			OIdentifiable record = null;
			
			Idx = this.db.getMetadata().getIndexManager().getIndex(NdexClasses.Index_UUID);
			OIdentifiable temp = (OIdentifiable) Idx.get(id);
			if((temp != null) )
				record = temp;
				
			if(record == null || ( orientClass !=null && !((ODocument)record.getRecord()).getClassName().equals(orientClass))) 
				throw new ObjectNotFoundException("[Class "+ orientClass + "] Object with ID: " + id.toString() + " doesn't exist.");
			
			return (ODocument) record.getRecord();
			
//		}  
	/*catch (Exception e) {
			logger.severe("Unexpected error on external object retrieval by UUID : " + e.getMessage());
			e.printStackTrace();
			throw new NdexException(e.getMessage());
		} */
		
	}
 
开发者ID:ndexbio,项目名称:ndex-common,代码行数:26,代码来源:OrientdbDAO.java

示例4: loadRelationsToModel

import com.orientechnologies.orient.core.db.record.OIdentifiable; //导入方法依赖的package包/类
@Override
    protected void loadRelationsToModel(ODocument document) {
//        for (OIdentifiable id : new OSQLSynchQuery<ODocument>("select expand( out() ) from " + vertex.getId())) {
        try {
            for (OIdentifiable id : new OSQLSynchQuery<ODocument>("traverse out(" + ImotEdge.class.getSimpleName() +
                    ") from " + document.getIdentity() + " while $depth <= 1")) {
                if (ImotVertex.class.getSimpleName().equals(((ODocument) id.getRecord()).getClassName())) {
                    ODocument doc = (ODocument) id.getRecord();
                    user.addImot((Imot) new ImotVertex(new Imot(null)).load(doc).model());
                }
            }
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }
 
开发者ID:imotSpot,项目名称:imotSpot,代码行数:16,代码来源:UserVertex.java

示例5: getCommentById

import com.orientechnologies.orient.core.db.record.OIdentifiable; //导入方法依赖的package包/类
public Comment getCommentById(String id) {
    try (OObjectDatabaseTx database = getOObjectDatabaseTx()) {
        OIdentifiable rec = database.load(new ORecordId(id));
        ODocument doc = rec.getRecord();
        return oDocumentToComment(doc);
    }
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:8,代码来源:CommentAPI.java

示例6: execute

import com.orientechnologies.orient.core.db.record.OIdentifiable; //导入方法依赖的package包/类
public LinkedList<OrientVertex> execute(Object iThis, OIdentifiable iCurrentRecord, Object iCurrentResult,
    final Object[] iParams, OCommandContext iContext) {
  
final OModifiableBoolean shutdownFlag = new OModifiableBoolean();
final OrientBaseGraph graph = OGraphCommandExecutorSQLFactory.getGraph(false, shutdownFlag);

  final ORecord record = (ORecord) (iCurrentRecord != null ? iCurrentRecord.getRecord() : null);

  Object source = iParams[0];
  if (OMultiValue.isMultiValue(source)) {
    if (OMultiValue.getSize(source) > 1)
      throw new IllegalArgumentException("Only one sourceVertex is allowed");
    source = OMultiValue.getFirstValue(source);
  }
  paramSourceVertex = graph.getVertex(OSQLHelper.getValue(source, record, iContext));

  Object dest = iParams[1];
  if (OMultiValue.isMultiValue(dest)) {
    if (OMultiValue.getSize(dest) > 1)
      throw new IllegalArgumentException("Only one destinationVertex is allowed");
    dest = OMultiValue.getFirstValue(dest);
  }
  paramDestinationVertex = graph.getVertex(OSQLHelper.getValue(dest, record, iContext));

  paramWeightFieldName = OStringSerializerHelper.getStringContent(iParams[2]);
  
  paramWeightLimit = Double.parseDouble(iParams[3].toString());
  
  if (iParams.length > 4)
    paramDirection = Direction.valueOf(iParams[4].toString().toUpperCase());

  return super.execute(iContext);
}
 
开发者ID:jrosocha,项目名称:jarvisCli,代码行数:34,代码来源:OSQLFunctionDijkstraWithWeightMax.java

示例7: getRecordByUUIDStr

import com.orientechnologies.orient.core.db.record.OIdentifiable; //导入方法依赖的package包/类
protected ODocument getRecordByUUIDStr(String id) 
		throws ObjectNotFoundException, NdexException {
	
		OIndex<?> Idx;
		OIdentifiable record = null;
		
		Idx = this.localConnection.getMetadata().getIndexManager().getIndex(NdexClasses.Index_UUID);
		OIdentifiable temp = (OIdentifiable) Idx.get(id);
		if((temp != null) )
			record = temp;
		else	
			throw new ObjectNotFoundException("Network with ID: " + id + " doesn't exist.");
		
		return (ODocument) record.getRecord();
}
 
开发者ID:ndexbio,项目名称:ndex-common,代码行数:16,代码来源:BasicNetworkDAO.java

示例8: getUserUUIDByEmail

import com.orientechnologies.orient.core.db.record.OIdentifiable; //导入方法依赖的package包/类
public String getUserUUIDByEmail(String userEmail) throws IllegalArgumentException {

		Preconditions.checkArgument(!Strings.isNullOrEmpty(userEmail),
				"userEmail required");

		OIndex<?> Idx = this.db.getMetadata().getIndexManager().getIndex( NdexClasses.Index_userEmail );
		OIdentifiable user = (OIdentifiable) Idx.get(userEmail); 
		if(user == null)
				return null;
			
		ODocument doc = user.getRecord();
		return doc.field(NdexClasses.ExternalObj_ID);
			
	}
 
开发者ID:ndexbio,项目名称:ndex-common,代码行数:15,代码来源:UserDocDAO.java

示例9: execute

import com.orientechnologies.orient.core.db.record.OIdentifiable; //导入方法依赖的package包/类
@Override
public Object execute(final Object iThis,
                      final OIdentifiable iCurrentRecord,
                      final Object iCurrentResult,
                      final Object[] iParams,
                      final OCommandContext iContext)
{
  OIdentifiable identifiable = (OIdentifiable) iParams[0];
  ODocument asset = identifiable.getRecord();
  RepositorySelector repositorySelector = RepositorySelector.fromSelector((String) iParams[2]);
  String jexlExpression = (String) iParams[1];
  List<String> membersForAuth;

  //if a single repo was selected, we want to auth against that member
  if (!repositorySelector.isAllRepositories()) {
    membersForAuth = Arrays.asList(repositorySelector.getName());
  }
  //if all repos (or all of format) was selected, use the repository the asset was in, as well as any groups
  //that may contain that repository
  else {
    @SuppressWarnings("unchecked")
    Map<String, List<String>> repoToContainedGroupMap = (Map<String, List<String>>) iParams[3];

    //find the repository that matches the asset
    String assetRepository = getAssetRepository(asset);

    //if can't find it, just back out, nothing more to see here
    if (assetRepository == null) {
      log.error("Asset {} references no repository", getAssetName(asset));
      return false;
    }

    membersForAuth = repoToContainedGroupMap.get(assetRepository);

    if (membersForAuth == null) {
      log.error("Asset {} references an invalid repository: {}", getAssetName(asset), assetRepository);
      return false;
    }
  }

  return contentAuthHelper.checkAssetPermissions(asset, membersForAuth.toArray(new String[membersForAuth.size()])) &&
      checkJexlExpression(asset, jexlExpression, asset.field(AssetEntityAdapter.P_FORMAT, String.class));
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:44,代码来源:ContentExpressionFunction.java

示例10: getAssetRepository

import com.orientechnologies.orient.core.db.record.OIdentifiable; //导入方法依赖的package包/类
@Nullable
private String getAssetRepository(ODocument asset) {
  OIdentifiable bucketId = asset.field(AssetEntityAdapter.P_BUCKET, OIdentifiable.class);
  ODocument bucket = bucketId.getRecord();
  return bucket.field(BucketEntityAdapter.P_REPOSITORY_NAME, String.class);
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:7,代码来源:ContentExpressionFunction.java

示例11: ODocumentModel

import com.orientechnologies.orient.core.db.record.OIdentifiable; //导入方法依赖的package包/类
public ODocumentModel(OIdentifiable identifiable) {
	super(identifiable!=null?(ODocument)identifiable.getRecord():null);
	if(identifiable!=null) this.orid = identifiable.getIdentity();
}
 
开发者ID:OrienteerBAP,项目名称:wicket-orientdb,代码行数:5,代码来源:ODocumentModel.java


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