Refine search
/** * PUBLIC: * Return if the descriptor defines inheritance and is a child. */ public boolean isChildDescriptor() { return hasInheritance() && getInheritancePolicy().isChildDescriptor(); }
/** * PUBLIC: * Return if the descriptor defines inheritance and is a child. */ public boolean isChildDescriptor() { return hasInheritance() && getInheritancePolicy().isChildDescriptor(); }
/** * PUBLIC: * Return if the descriptor defines inheritance and is a child. */ public boolean isChildDescriptor() { return hasInheritance() && getInheritancePolicy().isChildDescriptor(); }
/** * PUBLIC: * This method returns the root descriptor for for this descriptor's class heirarchy. * If the user is not using inheritance then the root class will be this class. */ public ClassDescriptor getRootDescriptor(){ if (this.hasInheritance()){ return this.getInheritancePolicy().getRootParentDescriptor(); } return this; }
/** * PUBLIC: * This method returns the root descriptor for for this descriptor's class heirarchy. * If the user is not using inheritance then the root class will be this class. */ public ClassDescriptor getRootDescriptor(){ if (this.hasInheritance()){ return this.getInheritancePolicy().getRootParentDescriptor(); } return this; }
/** * PUBLIC: * This method returns the root descriptor for for this descriptor's class heirarchy. * If the user is not using inheritance then the root class will be this class. */ public ClassDescriptor getRootDescriptor(){ if (this.hasInheritance()){ return this.getInheritancePolicy().getRootParentDescriptor(); } return this; }
/** * INTERNAL * This method returns the inheritance field value for an object to conform in an in-memory query. * Similar to getFieldValue, but deals with an instance rather than a Class object directly */ public Object typeValueFromObject(Object object, AbstractSession session) { // get the descriptor directly from the object, and use it to find the Java class ClassDescriptor objectDescriptor = session.getClassDescriptor(object); if (!objectDescriptor.hasInheritance() || objectDescriptor.getInheritancePolicy().shouldUseClassNameAsIndicator() || objectDescriptor.getInheritancePolicy().hasClassExtractor() ) { return (objectDescriptor.getJavaClassName()); } else { return objectDescriptor.getInheritancePolicy().getClassIndicatorMapping().get(objectDescriptor.getJavaClass()); } }
/** * INTERNAL * This method returns the inheritance field value for an object to conform in an in-memory query. * Similar to getFieldValue, but deals with an instance rather than a Class object directly */ public Object typeValueFromObject(Object object, AbstractSession session) { // get the descriptor directly from the object, and use it to find the Java class ClassDescriptor objectDescriptor = session.getClassDescriptor(object); if (!objectDescriptor.hasInheritance() || objectDescriptor.getInheritancePolicy().shouldUseClassNameAsIndicator() || objectDescriptor.getInheritancePolicy().hasClassExtractor() ) { return (objectDescriptor.getJavaClassName()); } else { return objectDescriptor.getInheritancePolicy().getClassIndicatorMapping().get(objectDescriptor.getJavaClass()); } }
public Vector withAllSubclasses(CommitOrderDependencyNode node) { Vector results = new Vector(); results.addElement(node); if (node.getDescriptor().hasInheritance()) { InheritancePolicy p = node.getDescriptor().getInheritancePolicy(); // For bug 3019934 replace getChildDescriptors with getAllChildDescriptors. for (Enumeration e = p.getAllChildDescriptors().elements(); e.hasMoreElements();) { results.addElement(getOwner().nodeFor((ClassDescriptor)e.nextElement())); } } return results; } }
/** * Read all rows from the database. * @return Vector containing the database rows. * @exception DatabaseException - an error has occurred on the database. */ public Vector selectAllRows() throws DatabaseException { // Check for multiple table inheritance which may require multiple queries. if (!((ObjectLevelReadQuery)this.query).shouldOuterJoinSubclasses()) { ClassDescriptor descriptor = getDescriptor(); if (descriptor.hasInheritance() && descriptor.getInheritancePolicy().requiresMultipleTableSubclassRead() && (!descriptor.getInheritancePolicy().hasView())) { return descriptor.getInheritancePolicy().selectAllRowUsingMultipleTableSubclassRead((ObjectLevelReadQuery)this.query); } } return selectAllRowsFromTable(); }
/** * Read all rows from the database. * @return Vector containing the database rows. * @exception DatabaseException - an error has occurred on the database. */ public Vector selectAllRows() throws DatabaseException { // Check for multiple table inheritance which may require multiple queries. if (!((ObjectLevelReadQuery)this.query).shouldOuterJoinSubclasses()) { ClassDescriptor descriptor = getDescriptor(); if (descriptor.hasInheritance() && descriptor.getInheritancePolicy().requiresMultipleTableSubclassRead() && (!descriptor.getInheritancePolicy().hasView())) { return descriptor.getInheritancePolicy().selectAllRowUsingMultipleTableSubclassRead((ReadAllQuery)this.query); } } return selectAllRowsFromTable(); }
/** * PUBLIC: * Return true if this descriptor should using an additional join expresison. */ public boolean shouldUseAdditionalJoinExpression() { // Return true, if the query manager has an additional join expression // and this descriptor is not part of an inheritance hierarchy using a // view (CR#3701077) return ((getQueryManager().getAdditionalJoinExpression() != null) && ! (hasInheritance() && getInheritancePolicy().hasView())); }
@Override public boolean addClassIndicatorFieldToRow(AbstractMarshalRecord abstractMarshalRecord) { if (descriptor.hasInheritance() && !xPathObjectBuilder.isXsiTypeIndicatorField()) { InheritanceRecord inheritanceRecord = new InheritanceRecord(abstractMarshalRecord); descriptor.getInheritancePolicy().addClassIndicatorFieldToRow(inheritanceRecord); return true; } return false; }
/** * INTERNAL: */ public DatabaseField getField() { if (field == null) { ClassDescriptor descriptor = getContainingDescriptor(); if (!descriptor.hasInheritance() || descriptor.getInheritancePolicy().hasClassExtractor()){ throw QueryException.invalidTypeExpression(descriptor.getJavaClassName()); } field = descriptor.getInheritancePolicy().getClassIndicatorField(); } return field; }
/** * Read all rows from the database. * @return Vector containing the database rows. * @exception DatabaseException - an error has occurred on the database. */ public Vector selectAllRows() throws DatabaseException { // Check for multiple table inheritance which may require multiple queries. if (!((ObjectLevelReadQuery)this.query).shouldOuterJoinSubclasses()) { ClassDescriptor descriptor = getDescriptor(); if (descriptor.hasInheritance() && descriptor.getInheritancePolicy().requiresMultipleTableSubclassRead() && (!descriptor.getInheritancePolicy().hasView())) { return descriptor.getInheritancePolicy().selectAllRowUsingMultipleTableSubclassRead((ObjectLevelReadQuery)this.query); } } return selectAllRowsFromTable(); }
/** * INTERNAL: */ @Override public DatabaseField getField() { if (field == null) { ClassDescriptor descriptor = getContainingDescriptor(); if (!descriptor.hasInheritance() || descriptor.getInheritancePolicy().hasClassExtractor()){ throw QueryException.invalidTypeExpression(descriptor.getJavaClassName()); } field = descriptor.getInheritancePolicy().getClassIndicatorField(); } return field; }
/** * PUBLIC: * Return true if this descriptor should using an additional join expresison. */ public boolean shouldUseAdditionalJoinExpression() { // Return true, if the query manager has an additional join expression // and this descriptor is not part of an inheritance hierarchy using a // view (CR#3701077) return ((getQueryManager().getAdditionalJoinExpression() != null) && ! (hasInheritance() && getInheritancePolicy().hasView())); }
@Override public boolean addClassIndicatorFieldToRow(AbstractMarshalRecord abstractMarshalRecord) { if (descriptor.hasInheritance() && !xPathObjectBuilder.isXsiTypeIndicatorField()) { InheritanceRecord inheritanceRecord = new InheritanceRecord(abstractMarshalRecord); descriptor.getInheritancePolicy().addClassIndicatorFieldToRow(inheritanceRecord); return true; } return false; }
/** * INTERNAL: */ public DatabaseField getField() { if (field == null) { ClassDescriptor descriptor = getContainingDescriptor(); if (!descriptor.hasInheritance() || descriptor.getInheritancePolicy().hasClassExtractor()){ throw QueryException.invalidTypeExpression(descriptor.getJavaClassName()); } field = descriptor.getInheritancePolicy().getClassIndicatorField(); } return field; }
/** * Read a single row from the database. Create an SQL statement object, * use it to create an SQL command string, and delegate row building * responsibility to the accessor. */ public AbstractRecord selectOneRow() throws DatabaseException { // Check for multiple table inheritance which may require multiple queries. if (!getReadObjectQuery().shouldOuterJoinSubclasses()) { ClassDescriptor descriptor = getDescriptor(); if (descriptor.hasInheritance() && descriptor.getInheritancePolicy().requiresMultipleTableSubclassRead() && (!descriptor.getInheritancePolicy().hasView())) { return descriptor.getInheritancePolicy().selectOneRowUsingMultipleTableSubclassRead((ReadObjectQuery)this.query); } } return selectOneRowFromTable(); }