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


Java StoreTransaction类代码示例

本文整理汇总了Java中jetbrains.exodus.entitystore.StoreTransaction的典型用法代码示例。如果您正苦于以下问题:Java StoreTransaction类的具体用法?Java StoreTransaction怎么用?Java StoreTransaction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: deleteLinks

import jetbrains.exodus.entitystore.StoreTransaction; //导入依赖的package包/类
private static void deleteLinks(StoreTransaction txn, Entity mainEntity) {
  Set<String> names = new HashSet<>(3);
  names.add(LINK_VARIABLE);
  names.add(LINK_FIELD_ACCESS);
  names.add(LINK_METHOD_CALL);

  // for (Entity entity : mainEntity.getLinks(LINK_REV_CLASS_REFERENCES)) {
  //   Entity classEntity = entity.getLink(LINK_CLASS);
  //   if (nonNull(classEntity)) {
  //     // reload
  //     classEntity.deleteLink(LINK_CLASS_REFERENCES, entity);
  //   }
  // }

  for (Entity entity : mainEntity.getLinks(names)) {
    entity.delete();
  }

  for (String name : names) {
    mainEntity.deleteLinks(name);
  }

  // mainEntity.deleteLinks(LINK_REV_CLASS_REFERENCES);
}
 
开发者ID:mopemope,项目名称:meghanada-server,代码行数:25,代码来源:Source.java

示例2: addClassReference

import jetbrains.exodus.entitystore.StoreTransaction; //导入依赖的package包/类
private static void addClassReference(
    StoreTransaction txn,
    Entity mainEntity,
    Map<String, ClassIndex> classIndex,
    Entity entity,
    String fqcn) {

  if (isNull(fqcn)) {
    return;
  }
  classIndex.computeIfPresent(
      fqcn,
      (key, index) -> {
        try {
          EntityId entityId = index.getEntityId();
          if (nonNull(entityId)) {
            Entity classEntity = txn.getEntity(entityId);
            classEntity.addLink(LINK_CLASS_REFERENCES, entity);

            entity.addLink(LINK_CLASS, classEntity);
            mainEntity.addLink(LINK_REV_CLASS_REFERENCES, entity);
          }
        } catch (Exception e) {
          log.warn(e.getMessage());
        }
        return index;
      });
}
 
开发者ID:mopemope,项目名称:meghanada-server,代码行数:29,代码来源:Source.java

示例3: store

import jetbrains.exodus.entitystore.StoreTransaction; //导入依赖的package包/类
@Override
public void store(StoreTransaction txn, Entity entity) {
  entity.setProperty("filePath", this.filePath);
  if (isNull(this.packageName)) {
    entity.setProperty("packageName", "");
  } else {
    entity.setProperty("packageName", this.packageName);
  }
  entity.setProperty("fqcn", this.getFQCN());
}
 
开发者ID:mopemope,项目名称:meghanada-server,代码行数:11,代码来源:Source.java

示例4: store

import jetbrains.exodus.entitystore.StoreTransaction; //导入依赖的package包/类
@Override
public void store(StoreTransaction txn, Entity entity) {
  entity.setProperty("declaration", this.declaration);
  entity.setProperty("name", this.name);
  if (isNull(this.filePath)) {
    // use test only
    entity.setProperty("filePath", "");
  } else {
    entity.setProperty("filePath", this.filePath);
  }
  entity.setProperty("isAnnotation", this.isAnnotation);
  entity.setProperty("isInterface", this.isInterface);
  entity.setProperty("functional", this.functional);
}
 
开发者ID:mopemope,项目名称:meghanada-server,代码行数:15,代码来源:ClassIndex.java

示例5: store

import jetbrains.exodus.entitystore.StoreTransaction; //导入依赖的package包/类
@Override
public void store(StoreTransaction txn, Entity entity) {
  entity.setProperty("name", name);
}
 
开发者ID:mopemope,项目名称:meghanada-server,代码行数:5,代码来源:Project.java

示例6: store

import jetbrains.exodus.entitystore.StoreTransaction; //导入依赖的package包/类
@Override
public void store(StoreTransaction txn, Entity entity) {

  long now = Instant.now().getEpochSecond();
  entity.setProperty("createdAt", now);
  entity.setProperty("result", this.success);
  entity.setProperty("problems", this.diagnostics.size());

  for (Diagnostic<? extends JavaFileObject> diagnostic : this.diagnostics) {
    String kind = diagnostic.getKind().toString();
    long line = diagnostic.getLineNumber();
    long column = diagnostic.getColumnNumber();

    String message = diagnostic.getMessage(null);
    if (isNull(message)) {
      message = "";
    }
    JavaFileObject fileObject = diagnostic.getSource();
    String path = null;
    if (fileObject != null) {
      final URI uri = fileObject.toUri();
      final File file = new File(uri);
      try {
        path = file.getCanonicalPath();
      } catch (IOException e) {
        throw new UncheckedIOException(e);
      }
    }

    String code = diagnostic.getCode();
    Entity subEntity = txn.newEntity(CompileResult.DIAGNOSTIC_ENTITY_TYPE);
    subEntity.setProperty("kind", kind);
    subEntity.setProperty("line", line);
    subEntity.setProperty("column", column);
    subEntity.setProperty("message", message);
    if (nonNull(path)) {
      subEntity.setProperty("path", path);
    }
    if (nonNull(code)) {
      subEntity.setProperty("code", code);
    }

    entity.addLink("diagnostic", entity);
  }
}
 
开发者ID:mopemope,项目名称:meghanada-server,代码行数:46,代码来源:CompileResult.java

示例7: execute

import jetbrains.exodus.entitystore.StoreTransaction; //导入依赖的package包/类
public <R> boolean execute(Function<StoreTransaction, Boolean> fn) {
  return this.entityStore.computeInTransaction(fn::apply);
}
 
开发者ID:mopemope,项目名称:meghanada-server,代码行数:4,代码来源:ProjectDatabase.java

示例8: computeInReadonly

import jetbrains.exodus.entitystore.StoreTransaction; //导入依赖的package包/类
public <R> R computeInReadonly(Function<StoreTransaction, R> fn) {
  return this.entityStore.computeInReadonlyTransaction(fn::apply);
}
 
开发者ID:mopemope,项目名称:meghanada-server,代码行数:4,代码来源:ProjectDatabase.java

示例9: getTransaction

import jetbrains.exodus.entitystore.StoreTransaction; //导入依赖的package包/类
private StoreTransaction getTransaction() {
	if(!collectingTransaction.isPresent()) 
		collectingTransaction = Optional.of(occStore.beginTransaction());
	return collectingTransaction.get();
}
 
开发者ID:termsuite,项目名称:termsuite-core,代码行数:6,代码来源:XodusOccurrenceStore.java

示例10: store

import jetbrains.exodus.entitystore.StoreTransaction; //导入依赖的package包/类
void store(StoreTransaction txn, Entity mainEntity); 
开发者ID:mopemope,项目名称:meghanada-server,代码行数:2,代码来源:Storable.java


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