OneToOneAttributeSourceImpl(
      MappingDocument sourceMappingDocument,
      AttributeSourceContainer container,
      final JaxbOneToOneElement oneToOneElement,
      final String logicalTableName,
      NaturalIdMutability naturalIdMutability) {
    super(sourceMappingDocument, naturalIdMutability, oneToOneElement.getPropertyRef());
    this.oneToOneElement = oneToOneElement;
    this.containingTableName = logicalTableName;
    this.valueSources =
        Helper.buildValueSources(
            sourceMappingDocument(),
            new Helper.ValueSourcesAdapter() {
              @Override
              public String getColumnAttribute() {
                // Not applicable to one-to-one
                return null;
              }

              @Override
              public String getFormulaAttribute() {
                return oneToOneElement.getFormulaAttribute();
              }

              @Override
              public List<JaxbColumnElement> getColumn() {
                // Not applicable to one-to-one
                return null;
              }

              @Override
              public List<String> getFormula() {
                return oneToOneElement.getFormula();
              }

              @Override
              public String getContainingTableName() {
                return logicalTableName;
              }

              @Override
              public boolean isIncludedInInsertByDefault() {
                return true;
              }

              @Override
              public boolean isIncludedInUpdateByDefault() {
                return false;
              }
            });

    this.attributeRole = container.getAttributeRoleBase().append(oneToOneElement.getName());
    this.attributePath = container.getAttributePathBase().append(oneToOneElement.getName());
  }
 @Override
 public ForeignKeyDirection getForeignKeyDirection() {
   return oneToOneElement.isConstrained()
       ? ForeignKeyDirection.FROM_PARENT
       : ForeignKeyDirection.TO_PARENT;
 }
 @Override
 public String getReferencedEntityName() {
   return oneToOneElement.getClazz() != null
       ? bindingContext().qualifyClassName(oneToOneElement.getClazz())
       : oneToOneElement.getEntityName();
 }
 @Override
 public String getExplicitForeignKeyName() {
   return oneToOneElement.getForeignKey();
 }
 @Override
 protected boolean requiresImmediateFetch() {
   return !oneToOneElement.isConstrained();
 }
 @Override
 public Collection<? extends ToolingHintSource> getToolingHintSources() {
   return oneToOneElement.getMeta();
 }
 @Override
 protected String getOuterJoinSelectionString() {
   return oneToOneElement.getOuterJoin() != null ? oneToOneElement.getOuterJoin().value() : null;
 }
 @Override
 protected String getLazySelectionString() {
   return oneToOneElement.getLazy() != null ? oneToOneElement.getLazy().value() : null;
 }
 @Override
 public Set<CascadeStyle> getCascadeStyles() {
   return Helper.interpretCascadeStyles(oneToOneElement.getCascade(), bindingContext());
 }
 @Override
 public String getPropertyAccessorName() {
   return oneToOneElement.getAccess();
 }
 @Override
 public String getName() {
   return oneToOneElement.getName();
 }