/** * INTERNAL: * Initialize the mapping. */ public void initialize(AbstractSession session) throws DescriptorException { super.initialize(session); if (!this.isSourceKeySpecified()) { // sourceKeyFields will be empty when #setTargetForeignKeyFieldName() is used this.setSourceKeyFields(oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance(getDescriptor().getPrimaryKeyFields())); } this.initializeTargetForeignKeysToSourceKeys(); if (this.shouldInitializeSelectionCriteria()) { this.setSelectionCriteria(this.buildDefaultSelectionCriteria()); } this.initializeDeleteAllQuery(); }
/** * Initialize the delete all query. * This query is used to delete the collection of objects from the * database. */ protected void initializeDeleteAllQuery() { ((DeleteAllQuery)this.getDeleteAllQuery()).setReferenceClass(this.getReferenceClass()); if (!this.hasCustomDeleteAllQuery()) { // the selection criteria are re-used by the delete all query if (this.getSelectionCriteria() == null) { this.getDeleteAllQuery().setSelectionCriteria(this.buildDefaultSelectionCriteria()); } else { this.getDeleteAllQuery().setSelectionCriteria(this.getSelectionCriteria()); } } }