org.vertexium.Graph.getIdGenerator()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(95)

本文整理了Java中org.vertexium.Graph.getIdGenerator()方法的一些代码示例,展示了Graph.getIdGenerator()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.getIdGenerator()方法的具体详情如下:
包路径:org.vertexium.Graph
类名称:Graph
方法名:getIdGenerator

Graph.getIdGenerator介绍

[英]Gets the id generator used by this graph to create ids.
[中]获取此图用于创建id的id生成器。

代码示例

代码示例来源:origin: org.visallo/visallo-web

protected String createPropertyKey(String propertyName, Graph graph) {
  return isCommentProperty(propertyName) ? createCommentPropertyKey() : graph.getIdGenerator().nextId();
}

代码示例来源:origin: org.visallo/visallo-model-vertexium

@Override
protected User addUser(String username, String displayName, String emailAddress, String password) {
  username = formatUsername(username);
  displayName = displayName.trim();
  byte[] salt = UserPasswordUtil.getSalt();
  byte[] passwordHash = UserPasswordUtil.hashPassword(password, salt);
  String id = GRAPH_USER_ID_PREFIX + graph.getIdGenerator().nextId();
  VertexBuilder userBuilder = graph.prepareVertex(id, VISIBILITY.getVisibility());
  VisalloProperties.CONCEPT_TYPE.setProperty(userBuilder, userConceptId, VISIBILITY.getVisibility());
  UserVisalloProperties.USERNAME.setProperty(userBuilder, username, VISIBILITY.getVisibility());
  UserVisalloProperties.DISPLAY_NAME.setProperty(userBuilder, displayName, VISIBILITY.getVisibility());
  UserVisalloProperties.CREATE_DATE.setProperty(userBuilder, new Date(), VISIBILITY.getVisibility());
  UserVisalloProperties.PASSWORD_SALT.setProperty(userBuilder, salt, VISIBILITY.getVisibility());
  UserVisalloProperties.PASSWORD_HASH.setProperty(userBuilder, passwordHash, VISIBILITY.getVisibility());
  UserVisalloProperties.STATUS.setProperty(
      userBuilder,
      UserStatus.OFFLINE.toString(),
      VISIBILITY.getVisibility()
  );
  if (emailAddress != null) {
    UserVisalloProperties.EMAIL_ADDRESS.setProperty(userBuilder, emailAddress, VISIBILITY.getVisibility());
  }
  User user = createFromVertex(userBuilder.save(this.authorizations));
  graph.flush();
  afterNewUserAdded(user);
  return user;
}

代码示例来源:origin: org.visallo/visallo-model-vertexium

@Override
public Workspace add(String workspaceId, String title, User user) {
  if (workspaceId == null) {
    workspaceId = WORKSPACE_ID_PREFIX + getGraph().getIdGenerator().nextId();

代码示例来源:origin: org.visallo/visallo-web

String id = graphVertexId == null ? graph.getIdGenerator().nextId() : graphVertexId;

代码示例来源:origin: org.visallo/visallo-web

VisibilityValidator.validate(graph, visibilityTranslator, resourceBundle, visibilityJson, user, authorizations);
String id = resolvedVertexId == null ? graph.getIdGenerator().nextId() : resolvedVertexId;

相关文章