/** * INTERNAL: * Return whether or not is root parent descriptor */ public boolean isRootParentDescriptor() { return getParentDescriptor() == null; }
/** * INTERNAL: * Return whether or not is root parent descriptor */ public boolean isRootParentDescriptor() { return getParentDescriptor() == null; }
/** * INTERNAL: * Return whether or not is root parent descriptor */ public boolean isRootParentDescriptor() { return getParentDescriptor() == null; }
/** * 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(); } }
/** * 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(); } }
/** * 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(); } }
/** * 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 this.descriptor.getInheritancePolicy().getParentDescriptor().getQueryManager(); }
private List<ClassDescriptor> getAllDescriptorsForInheritance(XMLDescriptor descriptor) { ArrayList<ClassDescriptor> descriptors = new ArrayList<ClassDescriptor>(); QNameInheritancePolicy policy = (QNameInheritancePolicy) descriptor.getInheritancePolicy(); descriptors.add(descriptor); descriptors.addAll(policy.getAllChildDescriptors()); ClassDescriptor parent = policy.getParentDescriptor(); while(parent != null) { descriptors.add(parent); parent = parent.getInheritancePolicy().getParentDescriptor(); } return descriptors; }
/** * 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 this.descriptor.getInheritancePolicy().getParentDescriptor().getQueryManager(); }
/** * 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 this.descriptor.getInheritancePolicy().getParentDescriptor().getQueryManager(); }
private List<ClassDescriptor> getAllDescriptorsForInheritance(XMLDescriptor descriptor) { ArrayList<ClassDescriptor> descriptors = new ArrayList<ClassDescriptor>(); QNameInheritancePolicy policy = (QNameInheritancePolicy) descriptor.getInheritancePolicy(); descriptors.add(descriptor); descriptors.addAll(policy.getAllChildDescriptors()); ClassDescriptor parent = policy.getParentDescriptor(); while(parent != null) { descriptors.add(parent); parent = parent.getInheritancePolicy().getParentDescriptor(); } return descriptors; }
/** * INTERNAL: * The first table in the tables is always treated as default. */ protected DatabaseTable extractDefaultTable() { if (getTables().isEmpty()) { if (isChildDescriptor()) { return getInheritancePolicy().getParentDescriptor().extractDefaultTable(); } else { return null; } } return getTables().get(0); }
/** * INTERNAL: * Potentially override the cache invalidation behavior */ protected void initializeCacheInvalidationPolicy() { CacheInvalidationPolicy parentPolicyClone = (CacheInvalidationPolicy)getParentDescriptor().getCacheInvalidationPolicy().clone(); getDescriptor().setCacheInvalidationPolicy(parentPolicyClone); }
/** * INTERNAL: * Potentially override the cache invalidation behavior */ protected void initializeCacheInvalidationPolicy() { CacheInvalidationPolicy parentPolicyClone = (CacheInvalidationPolicy)getParentDescriptor().getCacheInvalidationPolicy().clone(); getDescriptor().setCacheInvalidationPolicy(parentPolicyClone); }
/** * INTERNAL: * Potentially override the optimistic locking behavior */ protected void initializeOptimisticLocking(){ // CR#3214106, do not override if specified in subclass. if (!getDescriptor().usesOptimisticLocking() && getParentDescriptor().usesOptimisticLocking()) { getDescriptor().setOptimisticLockingPolicy((OptimisticLockingPolicy)getParentDescriptor().getOptimisticLockingPolicy().clone()); getDescriptor().getOptimisticLockingPolicy().setDescriptor(getDescriptor()); } }
/** * INTERNAL: * Potentially override the optimistic locking behavior */ protected void initializeOptimisticLocking(){ // CR#3214106, do not override if specified in subclass. if (!getDescriptor().usesOptimisticLocking() && getParentDescriptor().usesOptimisticLocking()) { getDescriptor().setOptimisticLockingPolicy((OptimisticLockingPolicy)getParentDescriptor().getOptimisticLockingPolicy().clone()); getDescriptor().getOptimisticLockingPolicy().setDescriptor(getDescriptor()); } }
/** * INTERNAL: * Potentially override the optimistic locking behavior */ protected void initializeOptimisticLocking(){ // CR#3214106, do not override if specified in subclass. if (!getDescriptor().usesOptimisticLocking() && getParentDescriptor().usesOptimisticLocking()) { getDescriptor().setOptimisticLockingPolicy((OptimisticLockingPolicy)getParentDescriptor().getOptimisticLockingPolicy().clone()); getDescriptor().getOptimisticLockingPolicy().setDescriptor(getDescriptor()); } }
/** * INTERNAL: * Post initialize the child descriptors */ protected void addClassIndicatorTypeToParent(Object indicator) { ClassDescriptor parentDescriptor = getDescriptor().getInheritancePolicy().getParentDescriptor(); if (parentDescriptor.getInheritancePolicy().isChildDescriptor()) { if (parentDescriptor.getInheritancePolicy().shouldReadSubclasses()) { parentDescriptor.getInheritancePolicy().getAllChildClassIndicators().addElement(indicator); } parentDescriptor.getInheritancePolicy().addClassIndicatorTypeToParent(indicator); } }
/** * 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: * 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); } }