Okay, here's the majority of the relevant code. There's obviously a lot more, but this at least shows the relationship between the two classes. I've cut out the rest of the corresponding ManyToOnes in Cage, but they're essentially identical. Let me know if you need more than this and I'll pastebin the whole classes. The ContainedIn annotations are currently commented out to allow indexing to run at all. If I uncomment those, that's when the problem occurs.
Code:
@Entity
@Indexed
@Table(name = "PERSON")
public class Person implements java.io.Serializable, Selectable {
<snip>
@OneToMany(fetch = FetchType.LAZY, mappedBy = "personByBarcodeCreatorKey")
//@ContainedIn
public Set<Cage> getCagesForBarcodeCreatorKey() {
return this.cagesForBarcodeCreatorKey;
}
public void setCagesForBarcodeCreatorKey(Set<Cage> cagesForBarcodeCreatorKey) {
this.cagesForBarcodeCreatorKey = cagesForBarcodeCreatorKey;
}
@OneToMany(fetch = FetchType.LAZY, mappedBy = "personByTerminatedBy")
//@ContainedIn
public Set<Cage> getCagesForTerminatedBy() {
return this.cagesForTerminatedBy;
}
public void setCagesForTerminatedBy(Set<Cage> cagesForTerminatedBy) {
this.cagesForTerminatedBy = cagesForTerminatedBy;
}
@OneToMany(fetch = FetchType.LAZY, mappedBy = "personByCageOwnerKey")
@OrderBy("barcodeValue desc")
//@ContainedIn
public Set<Cage> getCagesForCageOwnerKey() {
return this.cagesForCageOwnerKey;
}
public void setCagesForCageOwnerKey(Set<Cage> cagesForCageOwnerKey) {
this.cagesForCageOwnerKey = cagesForCageOwnerKey;
}
@OneToMany(fetch = FetchType.LAZY, mappedBy = "personByModifiedBy")
//@ContainedIn
public Set<Cage> getCagesForModifiedBy() {
return this.cagesForModifiedBy;
}
public void setCagesForModifiedBy(Set<Cage> cagesForModifiedBy) {
this.cagesForModifiedBy = cagesForModifiedBy;
}
@OneToMany(fetch = FetchType.LAZY, mappedBy = "personByFinancedBy")
//@ContainedIn
public Set<Cage> getCagesForFinancedBy() {
return this.cagesForFinancedBy;
}
public void setCagesForFinancedBy(Set<Cage> cagesForFinancedBy) {
this.cagesForFinancedBy = cagesForFinancedBy;
}
<snip>
}
Code:
@Entity
@Indexed
@Table(name = "CAGE", uniqueConstraints = @UniqueConstraint(columnNames = "BARCODE_VALUE"))
public class Cage implements java.io.Serializable, Selectable {
<snip>
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "BARCODE_CREATOR_KEY", nullable = false)
@NotNull
@IndexedEmbedded(depth = 1)
public Person getPersonByBarcodeCreatorKey() {
return this.personByBarcodeCreatorKey;
}
public void setPersonByBarcodeCreatorKey(Person personByBarcodeCreatorKey) {
this.personByBarcodeCreatorKey = personByBarcodeCreatorKey;
}
</snip>
}