DATAGRAPH-765 - Document fix ambiguous mappings.

This commit is contained in:
Luanne Misquitta
2016-02-01 11:46:53 +05:30
parent cda2a85134
commit 7c3c591a0c
2 changed files with 11 additions and 1 deletions

View File

@@ -55,7 +55,7 @@ In keeping with the Spring Data ethos, an operations interface is used to define
== Mapping Strategies
Because Neo4j is a schema-free database, Spring Data Neo4j uses a simple mechanism to map Java types to Neo4j nodes using labels.
How that works is explained here: <<reference_programming_model_typerepresentationstrategy,Entity Type Representation>>.
How that works is explained here: <<reference_programming-model_simple-mapping,Simplified Object Graph Mapping>>.
== Transactional Support
Neo4j uses transactions to guarantee the integrity of your data and Spring Data Neo4j supports this fully.

View File

@@ -151,3 +151,13 @@ Thanks to changes in the underlying object-graph mapping mechanism, this is no l
However, please be aware that this will only work because the end node types (Car and Pet) are different types.
If you wanted a person to own two cars, for example, then you'd have to use a `Collection` of cars or use differently-named relationship types.
[[reference_programming_model_relationships_ambiguity]]
== Ambiguity in relationships
In cases where the relationship mappings could be ambiguous, the recommendation is that
* the objects be navigable in both directions and
* the @Relationship annotations are explicit. This means if the entity has setter methods, they must be annotated
Examples of ambiguous relationship mappings are multiple relationship types that resolve to the same types of entities, in a given direction, but whose domain objects are not navigable in both directions.