PDA

View Full Version : @Reference and spring-data-gemfire 1.2.M1



LurgidBee
Jul 9th, 2012, 08:08 PM
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

dturanski
Jul 10th, 2012, 11:00 AM
Not there yet. I'm working on https://jira.springsource.org/browse/SGF-105 for v 1.2