/** * INTERNAL: * Return the relationshipPartner mapping for this bi-directional mapping. If the relationshipPartner is null then * this is a uni-directional mapping. */ public DatabaseMapping getRelationshipPartner() { if ((this.relationshipPartner == null) && (this.relationshipPartnerAttributeName != null)) { setRelationshipPartner(getReferenceDescriptor().getMappingForAttributeName(getRelationshipPartnerAttributeName())); } return this.relationshipPartner; }
/** * A subclass should implement this method if it wants non default behaviour. */ protected void initializeSelectionQuery(AbstractSession session) throws DescriptorException { if (((ObjectLevelReadQuery)getSelectionQuery()).getReferenceClass() == null) { throw DescriptorException.referenceClassNotSpecified(this); } getSelectionQuery().setDescriptor(getReferenceDescriptor()); }
if (((ForeignReferenceMapping)mapping).hasConstraintDependency()) { Class ownedClass; ClassDescriptor refDescriptor = ((ForeignReferenceMapping)mapping).getReferenceDescriptor(); if (refDescriptor == null) { refDescriptor = session.getDescriptor(((ForeignReferenceMapping)mapping).getReferenceClass()); } else if (((ForeignReferenceMapping)mapping).hasInverseConstraintDependency()) { Class ownerClass; ClassDescriptor refDescriptor = ((ForeignReferenceMapping)mapping).getReferenceDescriptor(); if (refDescriptor == null) { refDescriptor = session.getDescriptor(((ForeignReferenceMapping)mapping).getReferenceClass());
descriptor = ((AggregateObjectMapping)mapping).getReferenceDescriptor(); } else if (mapping.isForeignReferenceMapping()) { descriptor = ((ForeignReferenceMapping)mapping).getReferenceDescriptor();