Hi,
I'm trying to add two bidirectional associations to an Entity referring to the same type :
Code:
@Entity
public class DistributionNode {
@OneToOne(optional=true)
private Sensor currentSensor;
@OneToOne(optional=true)
private Sensor voltageSensor;
}
@Entity
public class Sensor {
@OneToOne(optional=true)
private DistributionNode distributionNode;
}
The problem I have is I don't know how to specify the "mappedBy" property. Normally I would put it on the Sensor.distributionNode since the DistributionNode is the owning side of the relation but since I got two associations, I can't refer to "voltageSensor" or "currentSensor".
Am I missing something?
Thank for your help!