本文整理汇总了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;
}
}
示例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;
}
示例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());
} */
}
示例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();
}
}
示例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);
}
}
示例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);
}
示例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();
}
示例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);
}
示例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));
}
示例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);
}
示例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();
}