Skip to content

Commit ae69648

Browse files
refactor: Remove unused methods, improve logging.
1 parent ef2c5ad commit ae69648

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

core/src/main/java/org/neo4j/ogm/context/EntityGraphMapper.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public CompileContext map(Object entity, int horizon) {
116116
// add all the relationships we know about. This includes the relationships that
117117
// won't be modified by the mapping request.
118118
for (MappedRelationship mappedRelationship : mappingContext.getRelationships()) {
119-
LOGGER.debug("context-init: (${})-[:{}]->(${})", mappedRelationship.getStartNodeId(),
119+
LOGGER.debug("context-init: ({})-[:{}]->({})", mappedRelationship.getStartNodeId(),
120120
mappedRelationship.getRelationshipType(), mappedRelationship.getEndNodeId());
121121
compiler.context().registerRelationship(mappedRelationship);
122122
}
@@ -976,11 +976,9 @@ private void reallyCreateRelationship(CompileContext ctx, Long src, Relationship
976976
relBuilder.relate(src, tgt);
977977
LOGGER.debug("context-new: ({})-[{}:{}]->({})", src, relBuilder.reference(), relBuilder.type(), tgt);
978978

979-
if (relBuilder.isNew()) { //We only want to create or log new relationships
980-
ctx.registerTransientRelationship(new SrcTargetKey(src, tgt),
981-
new TransientRelationship(src, relBuilder.reference(), relBuilder.type(), tgt, srcClass,
982-
tgtClass)); // we log the new relationship as part of the transaction context.
983-
}
979+
ctx.registerTransientRelationship(new SrcTargetKey(src, tgt),
980+
new TransientRelationship(src, relBuilder.reference(), relBuilder.type(), tgt, srcClass,
981+
tgtClass)); // we log the new relationship as part of the transaction context.
984982
}
985983

986984
/**

core/src/main/java/org/neo4j/ogm/cypher/compiler/RelationshipBuilder.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public interface RelationshipBuilder extends PropertyContainerBuilder<Relationsh
5151

5252
void setRelationshipEntity(boolean relationshipEntity);
5353

54-
boolean isNew();
5554
boolean isDirty();
5655

5756
void setDirty(boolean dirty);

core/src/main/java/org/neo4j/ogm/cypher/compiler/builders/node/DefaultRelationshipBuilder.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,6 @@ public boolean isSingleton() {
8787
return singleton;
8888
}
8989

90-
@Override
91-
public boolean isNew() {
92-
return true;
93-
}
94-
9590
@Override
9691
public void setSingleton(boolean b) {
9792
this.singleton = b;

0 commit comments

Comments
 (0)