Package org.eclipse.persistence.internal.jpa.metadata.accessors.objects

Examples of org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotation


     * INTERNAL:
     * Process the discriminator column metadata (defaulting if necessary),
     * and return the EclipseLink database field.
     */
    public DatabaseField processDiscriminatorColumn() {
        MetadataAnnotation discriminatorColumn = getAnnotation(JPA_DISCRIMINATOR_COLUMN);
       
        if (m_discriminatorColumn == null) {
            m_discriminatorColumn = new DiscriminatorColumnMetadata(discriminatorColumn, this);
        } else {
            if (isAnnotationPresent(JPA_DISCRIMINATOR_COLUMN)) {
View Full Code Here


    public String processDiscriminatorValue() {
        if (! Modifier.isAbstract(getJavaClass().getModifiers())) {
            // Add the indicator to the inheritance root class' descriptor. The
            // default is the short class name.
            if (m_discriminatorValue == null) {
                MetadataAnnotation discriminatorValue = getAnnotation(JPA_DISCRIMINATOR_VALUE);
               
                if (discriminatorValue == null) {
                    // By default return the alias (i.e. entity name if provided
                    // otherwise the short java class name)
                    return getDescriptor().getAlias();
                } else {
                    return (String) discriminatorValue.getAttribute("value");
                }
            } else {
                return m_discriminatorValue;
           
        }
View Full Code Here

     */
    protected void processIndexes() {
        // TODO: This goes against the JPA spec where XML always overrides
        // annotations. This method is appending annotation metadata to XML
        // metadata.
        MetadataAnnotation index = getAnnotation(Index.class);
       
        if (index != null) {
            m_indexes.add(new IndexMetadata(index, this));
        }
       
        MetadataAnnotation indexes = getAnnotation(Indexes.class);
        if (indexes != null) {
            Object[] indexArray = (Object[])indexes.getAttributeArray("value");
            for (Object eachIndex : indexArray) {
                m_indexes.add(new IndexMetadata((MetadataAnnotation) eachIndex, this));           
            }
        }
       
View Full Code Here

        // If there are no primary key join columns specified in XML, look for
        // some defined through annotations.
        if (m_primaryKeyJoinColumns.isEmpty()) {
            // Process all the primary key join columns first.
            if (isAnnotationPresent(JPA_PRIMARY_KEY_JOIN_COLUMNS)) {
                MetadataAnnotation primaryKeyJoinColumns = getAnnotation(JPA_PRIMARY_KEY_JOIN_COLUMNS);
                for (Object primaryKeyJoinColumn : (Object[]) primaryKeyJoinColumns.getAttributeArray("value")) {
                    m_primaryKeyJoinColumns.add(new PrimaryKeyJoinColumnMetadata((MetadataAnnotation) primaryKeyJoinColumn, this));
                }
            }
           
            // Process the single primary key join column second.
View Full Code Here

    protected void processSecondaryTables() {
        if (getDescriptor().getClassDescriptor().isEISDescriptor()) {
            return;
        }
       
        MetadataAnnotation secondaryTable = getAnnotation(JPA_SECONDARY_TABLE);
        MetadataAnnotation secondaryTables = getAnnotation(JPA_SECONDARY_TABLES);
       
        if (m_secondaryTables.isEmpty()) {
            // Look for a SecondaryTables annotation.
            if (secondaryTables != null) {
                for (Object table : (Object[]) secondaryTables.getAttributeArray("value")) {
                    processSecondaryTable(new SecondaryTableMetadata((MetadataAnnotation)table, this));
                }
            } else {
                // Look for a SecondaryTable annotation
                if (secondaryTable != null) {   
View Full Code Here

    /**
     * INTERNAL:
     * Process table information for the given metadata descriptor.
     */
    protected void processTable() {
        MetadataAnnotation table = getAnnotation(JPA_TABLE);
       
        if (m_table == null) {
            // Check for a table annotation. If no annotation is defined, the
            // table will default.
            processTable(new TableMetadata(table, this));
View Full Code Here

            // Set the fetch type.
            setFetch((String) annotation.getAttribute("fetch"));
        }
       
        // Set the join fetch if one is present.
        MetadataAnnotation joinFetch = getAnnotation(JoinFetch.class);
        if (joinFetch != null) {
            m_joinFetch = (String) joinFetch.getAttribute("value");
        }
       
        // Set the batch fetch if one is present.
        MetadataAnnotation batchFetch = getAnnotation(BatchFetch.class);
        if (batchFetch != null) {
            // Get attribute string will return the default ""
            m_batchFetch = (String) batchFetch.getAttributeString("value");
            m_batchFetchSize = (Integer) batchFetch.getAttribute("size");
        }
       
        // Set the cascade on delete if specified.
        m_cascadeOnDelete = isAnnotationPresent(CascadeOnDelete.class);
       
View Full Code Here

    public BasicMapAccessor(MetadataAnnotation basicMap, MetadataAccessibleObject accessibleObject, ClassAccessor classAccessor) {
        super(basicMap, accessibleObject, classAccessor);
       
        m_keyColumn = new ColumnMetadata((MetadataAnnotation) basicMap.getAttribute("keyColumn"), this);

        MetadataAnnotation keyConvert = (MetadataAnnotation) basicMap.getAttribute("keyConverter");
        if (keyConvert != null) {
            m_keyConverter = (String) keyConvert.getAttribute("value");
        }

        MetadataAnnotation valueConvert = (MetadataAnnotation) basicMap.getAttribute("valueConverter");
        if (valueConvert != null) {
            m_valueConverter = (String)valueConvert.getAttribute("value");
        }
       
        setValueColumn(new ColumnMetadata((MetadataAnnotation) basicMap.getAttribute("valueColumn"), this));
        setFetch((String) basicMap.getAttribute("fetch"));
    }
View Full Code Here

        // Once the class accessor is initialized, we can look for an explicit
        // access type specification.
        initAccess();

        // Any mapping type may have a field for EIS/NoSQL data.
        MetadataAnnotation field = getAnnotation("org.eclipse.persistence.nosql.annotations.Field");
        if (field != null) {
            m_field = new ColumnMetadata(field, this);
        }
    }
View Full Code Here

            for (PropertyMetadata property : getProperties()) {
                processProperty(mapping, property);
            }
        } else {
            // Look for annotations.
            MetadataAnnotation properties = getAnnotation(Properties.class);
            if (properties != null) {
                for (Object property : (Object[]) properties.getAttribute("value")) {
                    processProperty(mapping, new PropertyMetadata((MetadataAnnotation)property, this));
                }
            }
           
            MetadataAnnotation property = getAnnotation(Property.class);
            if (property != null) {
                processProperty(mapping, new PropertyMetadata(property, this));
            }   
        }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotation

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.