gpt4 book ai didi

com.buschmais.xo.api.XOException.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 00:29:05 27 4
gpt4 key购买 nike

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

XOException.<init>介绍

暂无

代码示例

代码示例来源:origin: com.buschmais.xo/xo.neo4j.embedded

private void ensureTransaction() {
  if (transaction == null) {
    throw new XOException("There is no existing transaction.");
  }
}

代码示例来源:origin: com.buschmais.xo/xo.neo4j.embedded

private EmbeddedDirection getDirection(RelationTypeMetadata.Direction direction) {
  switch (direction) {
  case FROM:
    return EmbeddedDirection.OUTGOING;
  case TO:
    return EmbeddedDirection.INCOMING;
  default:
    throw new XOException("Unsupported direction " + direction);
  }
}

代码示例来源:origin: com.puresoltechnologies.extended-objects/titan

@Override
public void begin() {
if (active) {
  throw new XOException("There is already an active transaction.");
}
active = true;
}

代码示例来源:origin: com.puresoltechnologies.ductiledb/ductiledb-xo

@Override
public void begin() {
if (active) {
  throw new XOException("There is already an active transaction.");
}
active = true;
}

代码示例来源:origin: com.buschmais.xo/xo.neo4j.embedded

@SuppressWarnings("unchecked")
DatastoreFactory lookupFactory(URI uri) {
  String factoryClass = getFactoryClassName(uri);
  LOG.debug("try to lookup provider-class {}", factoryClass);
  try {
    return ((Class<? extends DatastoreFactory>) Class.forName(factoryClass)).newInstance();
  } catch (ReflectiveOperationException e) {
    throw new XOException("Cannot create datastore factory.", e);
  }
}

代码示例来源:origin: com.buschmais.xo/xo.neo4j.embedded

@Override
public void begin() {
  if (transaction != null) {
    throw new XOException("There is already an existing transaction.");
  }
  transaction = graphDatabaseService.beginTx();
}

代码示例来源:origin: com.buschmais.xo/xo.spi

public <T> T removeInterceptor(T instance) {
    InvocationHandler invocationHandler = Proxy.getInvocationHandler(instance);
    if (!InterceptorInvocationHandler.class.isAssignableFrom(invocationHandler.getClass())) {
      throw new XOException(invocationHandler + " implementing " + Arrays.asList(invocationHandler.getClass().getInterfaces()) + " is not of expected type " + InterceptorInvocationHandler.class.getName());
    }
    return (T) ((InterceptorInvocationHandler) invocationHandler).getInstance();
  }
}

代码示例来源:origin: com.buschmais.xo/xo.neo4j.embedded

@Override
  public Object convert(Object value) {
    if (value instanceof AbstractEmbeddedPropertyContainer) {
      return ((AbstractEmbeddedPropertyContainer) value).getId();
    }
    throw new XOException("Unsupported value " + value);
  }
}

代码示例来源:origin: com.puresoltechnologies.extended-objects/titan

private static <QL> GremlinExpression extractExpression(Class<?> clazz) {
Gremlin gremlin = clazz.getAnnotation(Gremlin.class);
if (gremlin == null) {
  throw new XOException(clazz.getName() + " must be annotated with "
    + Gremlin.class.getName());
}
return new GremlinExpression(gremlin);
}

代码示例来源:origin: com.puresoltechnologies.extended-objects/titan

private static <QL> GremlinExpression extractExpression(Method method) {
Gremlin gremlin = method.getAnnotation(Gremlin.class);
if (gremlin == null) {
  throw new XOException(method.getName() + " must be annotated with "
    + Gremlin.class.getName());
}
return new GremlinExpression(gremlin);
}

代码示例来源:origin: com.buschmais.xo/xo.neo4j.embedded

@Override
public <QL extends Annotation> DatastoreQuery<QL> createQuery(Class<QL> queryLanguage) {
  if (Cypher.class.equals(queryLanguage)) {
    return (DatastoreQuery<QL>) new EmbeddedNeo4jCypherQuery(this);
  }
  throw new XOException("Unsupported query language: " + queryLanguage.getName());
}

代码示例来源:origin: com.puresoltechnologies.ductiledb/ductiledb-xo

@Override
public Set<String> getEntityDiscriminators(DuctileVertex vertex) {
Set<String> discriminators = new HashSet<>();
for (String label : vertex.getBaseVertex().getTypes()) {
  discriminators.add(label);
}
if (discriminators.size() == 0) {
  throw new XOException(
    "A vertex was found without discriminators. Does another framework alter the database?");
}
return discriminators;
}

代码示例来源:origin: com.puresoltechnologies.ductiledb/ductiledb-xo

private static GremlinExpression extractExpression(AnnotatedElement<?> typeExpression) {
Query gremlin = typeExpression.getAnnotation(Query.class);
if (gremlin == null) {
  throw new XOException(typeExpression + " must be annotated with " + Gremlin.class.getName());
}
return new GremlinExpression(gremlin);
}

代码示例来源:origin: com.puresoltechnologies.extended-objects/titan

private static GremlinExpression extractExpression(
  AnnotatedElement<?> typeExpression) {
Gremlin gremlin = typeExpression.getAnnotation(Gremlin.class);
if (gremlin == null) {
  throw new XOException(typeExpression + " must be annotated with "
    + Gremlin.class.getName());
}
return new GremlinExpression(gremlin);
}

代码示例来源:origin: com.puresoltechnologies.ductiledb/ductiledb-xo

@Override
public void rollback() {
if (!active) {
  throw new XOException("There is no active transaction.");
}
active = false;
graph.tx().rollback();
}

代码示例来源:origin: com.buschmais.xo/xo.neo4j.embedded

@Override
public <R> R createRepository(XOSession xoSession, Class<R> type) {
  if (TypedNeo4jRepository.class.isAssignableFrom(type)) {
    Class<?> typeParameter = ClassHelper.getTypeParameter(TypedNeo4jRepository.class, type);
    if (typeParameter == null) {
      throw new XOException("Cannot determine type parameter for " + type.getName());
    }
    return (R) new EmbeddedTypedNeoj4Repository<>(typeParameter, graphDatabaseService, xoSession);
  }
  return (R) new EmbeddedNeo4jRepository(graphDatabaseService, xoSession);
}

代码示例来源:origin: com.puresoltechnologies.ductiledb/ductiledb-xo

@Override
public DuctileStoreSession createSession() {
try {
  BaseConfiguration configuration = new BaseConfiguration();
  configuration.setProperty(Graph.GRAPH, DuctileGraph.class.getName());
  return new DuctileStoreSession(connection, configuration);
} catch (IOException e) {
  throw new XOException("Could not create graph.", e);
}
}

代码示例来源:origin: com.buschmais.xo/xo.test

@Override
public void close() {
  delegate.close();
  ObjectName objectName = getObjectName();
  try {
    getMBeanServer().unregisterMBean(objectName);
  } catch (JMException e) {
    throw new XOException("Cannot unregister trace monitor MBean for object name " + objectName, e);
  }
}

代码示例来源:origin: com.buschmais.xo/xo.neo4j.embedded

@Override
public Datastore<?, ?, ?, ?, ?> createDatastore(XOUnit xoUnit) {
  URI uri = xoUnit.getUri();
  DatastoreFactory datastoreFactory = lookupFactory(uri);
  try {
    return datastoreFactory.createGraphDatabaseService(uri, xoUnit.getProperties());
  } catch (MalformedURLException e) {
    throw new XOException("Cannot create datastore.", e);
  }
}

代码示例来源:origin: com.buschmais.xo/xo.neo4j.spi

public static <L extends Neo4jLabel> PropertyMetadata getIndexedPropertyMetadata(EntityTypeMetadata<NodeMetadata<L>> type,
                                         PrimitivePropertyMethodMetadata<PropertyMetadata> propertyMethodMetadata) {
  if (propertyMethodMetadata == null) {
    IndexedPropertyMethodMetadata<?> indexedProperty = type.getDatastoreMetadata().getUsingIndexedPropertyOf();
    if (indexedProperty == null) {
      throw new XOException("Type " + type.getAnnotatedType().getAnnotatedElement().getName() + " has no indexed property.");
    }
    propertyMethodMetadata = indexedProperty.getPropertyMethodMetadata();
  }
  return propertyMethodMetadata.getDatastoreMetadata();
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com