/** * Set the grouping element field on the mapping. * This is an optional setting; however it is a required setting when * there are more than one foreign keys specified */ public void setForeignKeyGroupingElement(String name) { setForeignKeyGroupingElement(new DatabaseField(name)); }
/** * Set the grouping element field on the mapping. * This is an optional setting; however it is a required setting when * there are more than one foreign keys specified */ public void setForeignKeyGroupingElement(String name) { setForeignKeyGroupingElement(new DatabaseField(name)); }
/** * Set the grouping element field on the mapping. * This is an optional setting; however it is a required setting when * there are more than one foreign keys specified */ public void setForeignKeyGroupingElement(String xpath) { setForeignKeyGroupingElement(new XMLField(xpath)); }
/** * INTERNAL: * Initialize the mapping. */ @Override public void initialize(AbstractSession session) throws DescriptorException { super.initialize(session); if ((this.getForeignKeyGroupingElement() == null) && (this.getSourceForeignKeysToTargetKeys().size() > 1)) { throw EISException.groupingElementRequired(); } if (this.getForeignKeyGroupingElement() != null) { DatabaseField field = this.getDescriptor().buildField(this.getForeignKeyGroupingElement()); setForeignKeyGroupingElement(field); } this.initializeSourceForeignKeysToTargetKeys(); if (shouldInitializeSelectionCriteria()) { initializeSelectionCriteria(session); } this.initializeDeleteAllQuery(); }
/** * INTERNAL: * Initialize the mapping. */ @Override public void initialize(AbstractSession session) throws DescriptorException { super.initialize(session); if ((this.getForeignKeyGroupingElement() == null) && (this.getSourceForeignKeysToTargetKeys().size() > 1)) { throw EISException.groupingElementRequired(); } if (this.getForeignKeyGroupingElement() != null) { DatabaseField field = this.getDescriptor().buildField(this.getForeignKeyGroupingElement()); setForeignKeyGroupingElement(field); } this.initializeSourceForeignKeysToTargetKeys(); if (shouldInitializeSelectionCriteria()) { initializeSelectionCriteria(session); } this.initializeDeleteAllQuery(); }
/** * INTERNAL: * Initialize the mapping. */ public void initialize(AbstractSession session) throws DescriptorException { super.initialize(session); if (!this.hasCustomSelectionQuery()) { throw DescriptorException.operationNotSupported("customSelectionQueryRequired"); } if ((this.getForeignKeyGroupingElement() == null) && (this.getSourceForeignKeysToTargetKeys().size() > 1)) { throw EISException.groupingElementRequired(); } if (this.getForeignKeyGroupingElement() != null) { DatabaseField field = this.getDescriptor().buildField(this.getForeignKeyGroupingElement()); setForeignKeyGroupingElement((XMLField)field); } this.initializeSourceForeignKeysToTargetKeys(); this.initializeDeleteAllQuery(); }
/** * INTERNAL: * Configure the EISOneToManyMapping properties based on the metadata. */ protected void processEISOneToManyMapping(EISOneToManyMapping mapping) { // EIS mappings always use foreign keys. String defaultFKFieldName = getDefaultAttributeName() + "_" + getReferenceDescriptor().getPrimaryKeyFieldName(); // Get the join columns (directly or through an association override), // init them and validate. List<JoinColumnMetadata> joinColumns = getJoinColumns(getJoinColumns(), getReferenceDescriptor()); // Get the foreign key (directly or through an association override) and // make sure it is initialized for processing. ForeignKeyMetadata foreignKey = getForeignKey(getForeignKey(), getReferenceDescriptor()); // Now process the foreign key relationship metadata. processForeignKeyRelationship(mapping, joinColumns, foreignKey, getReferenceDescriptor(), defaultFKFieldName, getDescriptor().getPrimaryTable()); if (getReferenceDescriptor().getPrimaryKeyFields().size() > 1) { mapping.setForeignKeyGroupingElement((getDatabaseField(getDescriptor().getPrimaryTable(), MetadataLogger.COLUMN))); } }