* Process a @OneToOne or one-to-one element into a TopLink OneToOne
* mapping.
*/
public void process() {
// Initialize our mapping now with what we found.
OneToOneMapping mapping = initOneToOneMapping();
if (getMappedBy().equals("")) {
// Owning side, look for JoinColumns or PrimaryKeyJoinColumns.
processOwningMappingKeys(mapping);
} else {
// Non-owning side, process the foreign keys from the owner.
OneToOneMapping ownerMapping = null;
if (getOwningMapping().isOneToOneMapping()){
ownerMapping = (OneToOneMapping)getOwningMapping();
} else {
// If improper mapping encountered, throw an exception.
getValidator().throwInvalidMappingEncountered(getJavaClass(), getReferenceClass());
}
mapping.setSourceToTargetKeyFields(ownerMapping.getTargetToSourceKeyFields());
mapping.setTargetToSourceKeyFields(ownerMapping.getSourceToTargetKeyFields());
}
// Add the mapping to the descriptor.
m_descriptor.addMapping(mapping);
}