Examples of PrimaryKeyJoinColumnMetadata


Examples of org.eclipse.persistence.internal.jpa.metadata.columns.PrimaryKeyJoinColumnMetadata

       
        // Process all the primary key join columns first.
        Annotation primaryKeyJoinColumns = getAnnotation(PrimaryKeyJoinColumns.class);
        if (primaryKeyJoinColumns != null) {
            for (Annotation primaryKeyJoinColumn : (Annotation[]) MetadataHelper.invokeMethod("value", primaryKeyJoinColumns)) {
                m_primaryKeyJoinColumns.add(new PrimaryKeyJoinColumnMetadata(primaryKeyJoinColumn, accessibleObject));
            }
        }
       
        // Process the single primary key join column second.
        Annotation primaryKeyJoinColumn = getAnnotation(PrimaryKeyJoinColumn.class);
        if (primaryKeyJoinColumn != null) {
            m_primaryKeyJoinColumns.add(new PrimaryKeyJoinColumnMetadata(primaryKeyJoinColumn, accessibleObject));
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.columns.PrimaryKeyJoinColumnMetadata

       
        // Process all the primary key join columns first.
        Annotation primaryKeyJoinColumns = getAnnotation(PrimaryKeyJoinColumns.class);
        if (primaryKeyJoinColumns != null) {
            for (Annotation primaryKeyJoinColumn : (Annotation[]) MetadataHelper.invokeMethod("value", primaryKeyJoinColumns)) {
                m_primaryKeyJoinColumns.add(new PrimaryKeyJoinColumnMetadata(primaryKeyJoinColumn, accessibleObject));
            }
        }
       
        // Process the single primary key join column second.
        Annotation primaryKeyJoinColumn = getAnnotation(PrimaryKeyJoinColumn.class);
        if (primaryKeyJoinColumn != null) {
            m_primaryKeyJoinColumns.add(new PrimaryKeyJoinColumnMetadata(primaryKeyJoinColumn, accessibleObject));
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.columns.PrimaryKeyJoinColumnMetadata

    public SecondaryTableMetadata(Annotation secondaryTable, MetadataAccessibleObject accessibleObject) {
        super(secondaryTable, accessibleObject);
      
        if (secondaryTable != null) {
            for (Annotation primaryKeyJoinColumn : (Annotation[]) MetadataHelper.invokeMethod("pkJoinColumns", secondaryTable)) {
                m_primaryKeyJoinColumns.add(new PrimaryKeyJoinColumnMetadata(primaryKeyJoinColumn, accessibleObject));
            }
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.columns.PrimaryKeyJoinColumnMetadata

    public CollectionTableMetadata(Annotation collectionTable, MetadataAccessibleObject accessibleObject) {
        super(collectionTable, accessibleObject);
       
        if (collectionTable != null) {
            for (Annotation primaryKeyJoinColumn : (Annotation[]) MetadataHelper.invokeMethod("primaryKeyJoinColumns", collectionTable)) {
                m_primaryKeyJoinColumns.add(new PrimaryKeyJoinColumnMetadata(primaryKeyJoinColumn, accessibleObject));
            }
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.columns.PrimaryKeyJoinColumnMetadata

        // Set the primary key join columns if some are present.
        // Process all the primary key join columns first.
        MetadataAnnotation primaryKeyJoinColumns = getAnnotation(PrimaryKeyJoinColumns.class);
        if (primaryKeyJoinColumns != null) {
            for (Object primaryKeyJoinColumn : (Object[]) primaryKeyJoinColumns.getAttributeArray("value")) {
                m_primaryKeyJoinColumns.add(new PrimaryKeyJoinColumnMetadata((MetadataAnnotation)primaryKeyJoinColumn, accessibleObject));
            }
        }
       
        // Process the single primary key join column second.
        MetadataAnnotation primaryKeyJoinColumn = getAnnotation(PrimaryKeyJoinColumn.class);
        if (primaryKeyJoinColumn != null) {
            m_primaryKeyJoinColumns.add(new PrimaryKeyJoinColumnMetadata(primaryKeyJoinColumn, accessibleObject));
        }
       
        // Set the mapped by id if one is present.
        if (isAnnotationPresent(MapsId.class)) {
            // Call getAttributeString in this case because we rely on the
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.columns.PrimaryKeyJoinColumnMetadata

        if (primaryKeyJoinColumns.isEmpty()) {
            if (getDescriptor().hasCompositePrimaryKey()) {
                // Add a default one for each part of the composite primary
                // key. Foreign and primary key to have the same name.
                for (DatabaseField primaryKeyField : getDescriptor().getPrimaryKeyFields()) {
                    PrimaryKeyJoinColumnMetadata primaryKeyJoinColumn = new PrimaryKeyJoinColumnMetadata(getProject());
                    primaryKeyJoinColumn.setReferencedColumnName(primaryKeyField.getName());
                    primaryKeyJoinColumn.setName(primaryKeyField.getName());
                    primaryKeyJoinColumns.add(primaryKeyJoinColumn);
                }
            } else {
                // Add a default one for the single case, not setting any
                // foreign and primary key names. They will default based
                // on which accessor is using them.
                primaryKeyJoinColumns.add(new PrimaryKeyJoinColumnMetadata(getProject()));
            }
        } else {
            // If we are a multitenant entity and the number of primary key join
            // columns does not equal the number of primary key fields we must
            // add the multitenant primary key tenant discriminator fields.
            if (getDescriptor().hasSingleTableMultitenant() && primaryKeyJoinColumns.size() != getDescriptor().getPrimaryKeyFields().size()) {
                SingleTableMultitenantPolicy policy = (SingleTableMultitenantPolicy) getDescriptor().getClassDescriptor().getMultitenantPolicy();
                Map<DatabaseField, String> tenantFields = policy.getTenantDiscriminatorFields();
               
                // Go through the key sets ...
                for (DatabaseField tenantField : tenantFields.keySet()) {
                    if (tenantField.isPrimaryKey()) {
                        PrimaryKeyJoinColumnMetadata primaryKeyJoinColumn = new PrimaryKeyJoinColumnMetadata();
                        primaryKeyJoinColumn.setName(tenantField.getName());
                        primaryKeyJoinColumn.setReferencedColumnName(tenantField.getName());
                        primaryKeyJoinColumn.setProject(getProject());
                        primaryKeyJoinColumns.add(primaryKeyJoinColumn);
                    }
                }
            }
        }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.columns.PrimaryKeyJoinColumnMetadata

       
        // Process all the primary key join columns first.
        Annotation primaryKeyJoinColumns = getAnnotation(PrimaryKeyJoinColumns.class);
        if (primaryKeyJoinColumns != null) {
            for (Annotation primaryKeyJoinColumn : (Annotation[]) MetadataHelper.invokeMethod("value", primaryKeyJoinColumns)) {
                m_primaryKeyJoinColumns.add(new PrimaryKeyJoinColumnMetadata(primaryKeyJoinColumn, accessibleObject));
            }
        }
       
        // Process the single primary key join column second.
        Annotation primaryKeyJoinColumn = getAnnotation(PrimaryKeyJoinColumn.class);
        if (primaryKeyJoinColumn != null) {
            m_primaryKeyJoinColumns.add(new PrimaryKeyJoinColumnMetadata(primaryKeyJoinColumn, accessibleObject));
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.columns.PrimaryKeyJoinColumnMetadata

    public SecondaryTableMetadata(Annotation secondaryTable, MetadataAccessibleObject accessibleObject) {
        super(secondaryTable, accessibleObject);
      
        if (secondaryTable != null) {
            for (Annotation primaryKeyJoinColumn : (Annotation[]) MetadataHelper.invokeMethod("pkJoinColumns", secondaryTable)) {
                m_primaryKeyJoinColumns.add(new PrimaryKeyJoinColumnMetadata(primaryKeyJoinColumn, accessibleObject));
            }
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.columns.PrimaryKeyJoinColumnMetadata

    public CollectionTableMetadata(Annotation collectionTable, MetadataAccessibleObject accessibleObject) {
        super(collectionTable, accessibleObject);
       
        if (collectionTable != null) {
            for (Annotation primaryKeyJoinColumn : (Annotation[]) MetadataHelper.invokeMethod("primaryKeyJoinColumns", collectionTable)) {
                m_primaryKeyJoinColumns.add(new PrimaryKeyJoinColumnMetadata(primaryKeyJoinColumn, accessibleObject));
            }
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.metadata.columns.PrimaryKeyJoinColumnMetadata

        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.
            if (isAnnotationPresent(JPA_PRIMARY_KEY_JOIN_COLUMN)) {
                m_primaryKeyJoinColumns.add(new PrimaryKeyJoinColumnMetadata(getAnnotation(JPA_PRIMARY_KEY_JOIN_COLUMN), this));
            }
        }
       
        addMultipleTableKeyFields(m_primaryKeyJoinColumns, getDescriptor().getPrimaryTable(), MetadataLogger.INHERITANCE_PK_COLUMN, MetadataLogger.INHERITANCE_FK_COLUMN);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.