コード例 #1
0
ファイル: Neo4jDialect.java プロジェクト: twwwt/hibernate-ogm
 private void putProperty(EntityKey entityKey, Node node, TupleOperation operation) {
   try {
     node.setProperty(operation.getColumn(), operation.getValue());
   } catch (ConstraintViolationException e) {
     throw log.constraintViolation(entityKey, operation, e);
   }
 }
コード例 #2
0
 private void putProperty(EntityKey entityKey, Node node, TupleOperation operation) {
   try {
     node.setProperty(operation.getColumn(), operation.getValue());
   } catch (ConstraintViolationException e) {
     String message = e.getMessage();
     if (message.contains("already exists")) {
       throw log.mustNotInsertSameEntityTwice(String.valueOf(operation), e);
     } else {
       throw log.constraintViolation(entityKey, String.valueOf(operation), e);
     }
   }
 }
コード例 #3
0
 private void putTupleOperation(
     EntityKey entityKey,
     Tuple tuple,
     Node node,
     TupleOperation operation,
     TupleContext tupleContext,
     Set<String> processedAssociationRoles) {
   if (tupleContext.getTupleTypeContext().isPartOfAssociation(operation.getColumn())) {
     // the column represents a to-one association, map it as relationship
     putOneToOneAssociation(tuple, node, operation, tupleContext, processedAssociationRoles);
   } else if (isPartOfRegularEmbedded(
       entityKey.getMetadata().getColumnNames(), operation.getColumn())) {
     entityQueries
         .get(entityKey.getMetadata())
         .updateEmbeddedColumn(
             dataBase, entityKey.getColumnValues(), operation.getColumn(), operation.getValue());
   } else {
     putProperty(entityKey, node, operation);
   }
 }