Skip to content

Commit 684e1ad

Browse files
refactor: Remove unused methods, improve logging.
1 parent 37fb30f commit 684e1ad

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

+4-6
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public CompileContext map(Object entity, int horizon) {
117117
// add all the relationships we know about. This includes the relationships that
118118
// won't be modified by the mapping request.
119119
for (MappedRelationship mappedRelationship : mappingContext.getRelationships()) {
120-
LOGGER.debug("context-init: (${})-[:{}]->(${})", mappedRelationship.getStartNodeId(),
120+
LOGGER.debug("context-init: ({})-[:{}]->({})", mappedRelationship.getStartNodeId(),
121121
mappedRelationship.getRelationshipType(), mappedRelationship.getEndNodeId());
122122
compiler.context().registerRelationship(mappedRelationship);
123123
}
@@ -980,11 +980,9 @@ private void reallyCreateRelationship(CompileContext ctx, Long src, Relationship
980980
relBuilder.relate(src, tgt);
981981
LOGGER.debug("context-new: ({})-[{}:{}]->({})", src, relBuilder.reference(), relBuilder.type(), tgt);
982982

983-
if (relBuilder.isNew()) { //We only want to create or log new relationships
984-
ctx.registerTransientRelationship(new SrcTargetKey(src, tgt),
985-
new TransientRelationship(src, relBuilder.reference(), relBuilder.type(), tgt, srcClass,
986-
tgtClass)); // we log the new relationship as part of the transaction context.
987-
}
983+
ctx.registerTransientRelationship(new SrcTargetKey(src, tgt),
984+
new TransientRelationship(src, relBuilder.reference(), relBuilder.type(), tgt, srcClass,
985+
tgtClass)); // we log the new relationship as part of the transaction context.
988986
}
989987

990988
/**

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

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public interface RelationshipBuilder extends PropertyContainerBuilder<Relationsh
5252

5353
void setRelationshipEntity(boolean relationshipEntity);
5454

55-
boolean isNew();
5655
boolean isDirty();
5756

5857
void setDirty(boolean dirty);

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

-5
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,6 @@ public boolean isSingleton() {
8888
return singleton;
8989
}
9090

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

0 commit comments

Comments
 (0)