hi,
I am playing around with the repository features 1.2.M1 and I am wondering if the @Reference annotation (defined in spring-data-commons) is supported and seeking clarification about what it does.
I have found that documentation for the feature is pretty thin but I have assumed that is would perform the same function as @DbRef in the mongo-db project.
My use case consists of 2 persisted classes:
@Region(...)
class EntityA {
@Id
String id;
}
@Region(...)
class EntityB {
@Id
String id;
@Reference
EntityA someRef;
}
My assumption is that:
* that EntityB.someRef is persisted as a reference rather than an embedded value
* might be lazily dereferenced
* if an instance of EntityA were retrieved directly via a repository and indirectly via reference field within a single transaction, there would only be a single instance of the object.
After some basic testing, this doesn't appear to be happening.
How should I reset my expectations?
Cheers


Reply With Quote