Hi
I have hit a wall with trying to map our domain model. I orginally had a custom class brigde to handle the mapping but unfortunately I was not on the correct path. The problem is due to the complex model that we have and as a result I am getting a circular reference exception. The models looks like this
Code:
PProject {
-- owner
-- fields
}
RProject extends PProject {
-- RObject
}
@Indexed
LP extends PProject {
@IndexEmbedded
-- Set<BRProject> bps
}
BRProject extends RProject {
@Field
- reference
}
RObject {
@ContainedIn
-- Set<BRProject>
@IndexEmbebbed (This causes a problem..circular reference)
-- Set<WProject> rps
@Field
-- reference
}
WProject extends RProject {
}
Basically I am trying to index LPProject and create a LPProject lucene document per instance. The problem occurs when I try to index the set of WProjects. I would like to index the owner of WProject and associated data. So when I add the @IndexEmebbed on the set(Set<WProject> rps) in RObject I get the circular reference issue. The only way I think is to index the RObject entity seperately but the downside to this is that I will have to associated it back to the LProject and do a lot of post processing.
I hope this makes sense I've been looking at this problem since yesterday. Any help would be appreciated.
Cheers
Amin