Package oracle.toplink.essentials.mappings

Examples of oracle.toplink.essentials.mappings.DatabaseMapping


     * process itself if it hasn't already done so.
     */
    protected DatabaseMapping getOwningMapping() {
        String ownerAttributeName = getMappedBy();
        MetadataDescriptor ownerDescriptor = getReferenceDescriptor();
        DatabaseMapping mapping = ownerDescriptor.getMappingForAttributeName(ownerAttributeName, this);
       
        // If no mapping was found, there is an error in the mappedBy field,
        // therefore, throw an exception.
        if (mapping == null) {
            m_validator.throwNoMappedByAttributeFound(ownerDescriptor.getJavaClass(), ownerAttributeName, getJavaClass(), getAttributeName());
View Full Code Here


        }
       
        // We didn't find a mapping on this descriptor, check our aggregate
        // descriptors now.
        for (MetadataDescriptor aggregateDmd : m_aggregateDescriptors) {
            DatabaseMapping mapping = aggregateDmd.getMappingForAttributeName(attributeName, referencingAccessor);
           
            if (mapping != null) {
                return mapping;
            }
        }
View Full Code Here

        MetadataDescriptor aggregateDescriptor = getReferenceDescriptor();
       
        // AssociationOverride.name(), the name of the attribute we want to
        // override.
        String name = associationOverride.name();
        DatabaseMapping mapping = aggregateDescriptor.getMappingForAttributeName(name);
       
        if (mapping != null && mapping.isOneToOneMapping()) {
            int index = 0;
           
            for (JoinColumn joinColumn : associationOverride.joinColumns()) {
                // We can't change the mapping from the aggregate descriptor
                // so we have to add field name translations. This needs to be
View Full Code Here

   */
  protected void processAttributeOverride(AggregateObjectMapping mapping, MetadataColumn column) {
        String attributeName = column.getAttributeName();
       
        // Set the attribute name on the aggregate.
        DatabaseMapping aggregateMapping = getReferenceDescriptor().getMappingForAttributeName(attributeName);
       
        if (aggregateMapping == null) {
            m_validator.throwInvalidEmbeddableAttribute(getJavaClass(), mapping.getAttributeName(), getReferenceDescriptor().getJavaClass(), attributeName);
        }
       
        // A sub-class to a mapped superclass may override an embedded attribute
        // override.
        if (m_descriptor.hasAttributeOverrideFor(attributeName)) {
            // Update the field on this metadata column. We do that so that
            // an embedded id can associate the correct id fields.
            column.setDatabaseField(m_descriptor.getAttributeOverrideFor(attributeName).getDatabaseField());
        }
       
        mapping.addFieldNameTranslation(column.getDatabaseField().getQualifiedName(), aggregateMapping.getField().getName());
  }
View Full Code Here

TOP

Related Classes of oracle.toplink.essentials.mappings.DatabaseMapping

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.