/** * INTERNAL: */ public void setExcludeDefaultListeners(boolean excludeDefaultListeners) { m_descriptor.getEventManager().setExcludeDefaultListeners(excludeDefaultListeners); }
/** * INTERNAL: * Indicates if the strategy on the descriptor's inheritance policy is * JOINED. */ public boolean usesJoinedInheritanceStrategy() { return m_descriptor.getInheritancePolicy().isJoinedStrategy(); }
/** * INTERNAL: * all tables for reference class plus childrenTables */ public Vector getAllTables() { if(allTables == null) { return this.getDescriptor().getTables(); } else { return allTables; } }
/** * INTERNAL: * Setup the default classExtractionMethod, or if one was specified by the user make sure it is valid. */ protected void initializeClassExtractor(AbstractSession session) throws DescriptorException { if (getClassExtractor() == null) { if (isChildDescriptor()) { setClassExtractor(getParentDescriptor().getInheritancePolicy().getClassExtractor()); } } else { getClassExtractor().initialize(getDescriptor(), session); } }
/** * INTERNAL: * Return the root parent descriptor */ public ClassDescriptor getRootParentDescriptor() { if (isRootParentDescriptor()) { return getDescriptor(); } else { return getParentDescriptor().getInheritancePolicy().getRootParentDescriptor(); } }
/** * INTERNAL: * Get the parent DescriptorQueryManager. * Caution must be used in using this method as it expects the descriptor * to have inheritance. * Calling this when the descriptor that does not use inheritance will cause problems, #hasInheritance() must * always first be called. */ public DescriptorQueryManager getParentDescriptorQueryManager() { return getDescriptor().getInheritancePolicy().getParentDescriptor().getQueryManager(); }
/** * INTERNAL: * Returns value of the abstract class indicator for the Java class. */ protected Object getClassIndicatorValue() { return getClassIndicatorValue(getDescriptor().getJavaClass()); }
/** * INTERNAL: * call addChildTableJoinExpression on all parents */ public void addChildTableJoinExpressionToAllParents(DatabaseTable table, Expression expression) { ClassDescriptor parentDescriptor = getParentDescriptor(); while(parentDescriptor != null) { InheritancePolicy parentPolicy = parentDescriptor.getInheritancePolicy(); parentPolicy.addChildTableJoinExpression(table, expression); parentDescriptor = parentPolicy.getParentDescriptor(); } }
/** * PUBLIC: * Return if the descriptor defines inheritence and is a child. */ public boolean isChildDescriptor() { return hasInheritance() && getInheritancePolicy().isChildDescriptor(); }
/** * INTERNAL: */ public boolean excludeSuperclassListeners() { return m_descriptor.getEventManager().excludeSuperclassListeners(); }
/** * INTERNAL: * Sets the strategy on the descriptor's inheritance policy to SINGLE_TABLE. * The default is JOINED. */ public void setSingleTableInheritanceStrategy() { m_descriptor.getInheritancePolicy().setSingleTableStrategy(); }
/** * INTERNAL: */ public void setEntityEventListener(MetadataEntityListener listener) { m_descriptor.getEventManager().setEntityEventListener(listener); }
/** * INTERNAL: */ public void setExcludeSuperclassListeners(boolean excludeSuperclassListeners) { m_descriptor.getEventManager().setExcludeSuperclassListeners(excludeSuperclassListeners); }
/** * INTERNAL: */ public void addEntityListenerEventListener(MetadataEntityListener listener) { m_descriptor.getEventManager().addEntityListenerEventListener(listener); }
/** * INTERNAL: */ public void addDefaultEventListener(MetadataEntityListener listener) { m_descriptor.getEventManager().addDefaultEventListener(listener); }
/** * INTERNAL: */ public void setClassIndicatorField(DatabaseField field) { m_descriptor.getInheritancePolicy().setClassIndicatorField(field); }
/** * INTERNAL: * Return if the event manager has any event listeners, or event methods. * If nothing is listening to event they can be avoided. */ public boolean hasAnyEventListeners() { // Check listeners in case of collection added to directly as occurs // for aggregates that have a clone of the event manager but not the // listeners. return hasAnyEventListeners || hasAnyListeners() || hasEntityEventListener() || hasEntityListenerEventListeners(); }
/** * INTERNAL: * Set the existence check option from a string constant. */ public void setExistenceChecking(String token) throws DescriptorException { getQueryManager().setExistenceCheck(token); }
/** * PUBLIC: * Set the descriptor not to use the class' full name as the indicator. * The class indicator is used with inheritance to determine the class from a row. * By default a class indicator mapping is required, this can be set to true if usage of the class name is desired. * The field must be of a large enough size to store the fully qualified class name. */ public void dontUseClassNameAsIndicator() { setShouldUseClassNameAsIndicator(false); }
/** * PUBLIC: * This protocol can be used to associate multiple tables with foreign key * information. The join criteria will be generated based on the fields * provided. By default TopLink associates multiple tables using a primary * key join where the primary keys fields are named the same. */ public void addMultipleTableForeignKeyField(DatabaseField sourceField, DatabaseField targetField) throws DescriptorException { addMultipleTableForeignKeys(sourceField, targetField, true); }