|
I finally had another look at this. I am wondering whether the best approach would be via EntityInfo? Right now we only have getId and getIdName. This id and name are the document id. We are loosing the potential distinction between the document (Lucene) id and a potential entity id/identifier. If we would have a getDocumentId and getIdDocumentIdName as well as a getEntityId and getEntityIdName our problem would be solved ( we probably could put the id and id name into a wrapper class).
I think it is quite natural to speak of a document vs entity id, even if no ORM is involved. In the case where @Id == @DocumentId the return values are of course identical. We could also have a method of the form isEntityAndDocumentIdShared.
On the metadata side we just have to make sure to keep the distinction as well and expose it, so that we can use it when loading entities and creating EntityInfo instances.
Thoughts?
|