/** * INTERNAL: * Checks if the class is involved in inheritance */ public boolean hasClassIndicator() { return getClassIndicatorField() != null; }
/** * INTERNAL: * Checks if the class is invloved in inheritance */ public boolean hasClassIndicator() { return getClassIndicatorField() != null; }
/** * INTERNAL: * Checks if the class is involved in inheritance */ public boolean hasClassIndicator() { return getClassIndicatorField() != null; }
/** * PUBLIC: * Return the class indicator field name. * This is the name of the field in the table that stores what type of object this is. */ public String getClassIndicatorFieldName() { if (getClassIndicatorField() == null) { return null; } else { return getClassIndicatorField().getQualifiedName(); } }
/** * PUBLIC: * Return the class indicator field name. * This is the name of the field in the table that stores what type of object this is. */ public String getClassIndicatorFieldName() { if (getClassIndicatorField() == null) { return null; } else { return getClassIndicatorField().getQualifiedName(); } }
/** * PUBLIC: * Return the class indicator field name. * This is the name of the field in the table that stores what type of object this is. */ public String getClassIndicatorFieldName() { if (getClassIndicatorField() == null) { return null; } else { return getClassIndicatorField().getQualifiedName(); } }
/** * INTERNAL: * Add abstract class indicator information to the database row. This is * required when building a row for an insert or an update of a concrete child * descriptor. * This is only used to build a template row. */ public void addClassIndicatorFieldToInsertRow(AbstractRecord databaseRow) { if (hasClassExtractor()) { return; } DatabaseField field = getClassIndicatorField(); databaseRow.put(field, null); }
/** * INTERNAL: * Add abstract class indicator information to the database row. This is * required when building a row for an insert or an update of a concrete child * descriptor. * This is only used to build a template row. */ public void addClassIndicatorFieldToInsertRow(AbstractRecord databaseRow) { if (hasClassExtractor()) { return; } DatabaseField field = getClassIndicatorField(); databaseRow.put(field, null); }
/** * INTERNAL: * Add abstract class indicator information to the database row. This is * required when building a row for an insert or an update of a concrete child * descriptor. * This is only used to build a template row. */ public void addClassIndicatorFieldToInsertRow(AbstractRecord databaseRow) { if (hasClassExtractor()) { return; } DatabaseField field = getClassIndicatorField(); databaseRow.put(field, null); }
/** * INTERNAL: * Add abstract class indicator information to the database row. This is * required when building a row for an insert or an update of a concrete child * descriptor. */ public void addClassIndicatorFieldToRow(AbstractRecord databaseRow) { if (hasClassExtractor()) { return; } DatabaseField field = getClassIndicatorField(); Object value = getClassIndicatorValue(); databaseRow.put(field, value); }
/** * INTERNAL: * Add abstract class indicator information to the database row. This is * required when building a row for an insert or an update of a concrete child * descriptor. */ public void addClassIndicatorFieldToRow(AbstractRecord databaseRow) { if (hasClassExtractor()) { return; } DatabaseField field = getClassIndicatorField(); Object value = getClassIndicatorValue(); databaseRow.put(field, value); }
/** * INTERNAL: * Add abstract class indicator information to the database row. This is * required when building a row for an insert or an update of a concrete child * descriptor. */ public void addClassIndicatorFieldToRow(AbstractRecord databaseRow) { if (hasClassExtractor()) { return; } DatabaseField field = getClassIndicatorField(); Object value = getClassIndicatorValue(); databaseRow.put(field, value); }
/** * INTERNAL: * This method is invoked only for the abstract descriptors. */ public Class classFromRow(AbstractRecord rowFromDatabase, AbstractSession session) throws DescriptorException { if (hasClassExtractor()) { return getClassExtractor().extractClassFromRow(rowFromDatabase, session); } Object classFieldValue = session.getDatasourcePlatform().getConversionManager().convertObject(rowFromDatabase.get(getClassIndicatorField()), getClassIndicatorField().getType()); if (classFieldValue == null) { throw DescriptorException.missingClassIndicatorField(rowFromDatabase, getDescriptor()); } return classFromValue(classFieldValue, session); }
/** * INTERNAL: * This method is invoked only for the abstract descriptors. */ @Override public Class classFromRow(AbstractRecord rowFromDatabase, AbstractSession session) throws DescriptorException { if (hasClassExtractor()) { return getClassExtractor().extractClassFromRow(rowFromDatabase, session); } Object classFieldValue = session.getDatasourcePlatform().getConversionManager().convertObject(rowFromDatabase.get(getClassIndicatorField()), getClassIndicatorField().getType()); if (classFieldValue == null) { throw DescriptorException.missingClassIndicatorField(rowFromDatabase, getDescriptor()); } return classFromValue(classFieldValue, session); }
/** * 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; }
/** * 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; }
/** * 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; }
/** * INTERNAL: * Initialize the expression to use for queries to the class and its subclasses. */ protected void initializeWithAllSubclassesExpression() throws DescriptorException { if (getWithAllSubclassesExpression() == null) { if (hasClassExtractor()) { return; } if (isChildDescriptor() && shouldReadSubclasses()) { setWithAllSubclassesExpression(new ExpressionBuilder().getField(getClassIndicatorField()).in(getAllChildClassIndicators())); } } }
/** * INTERNAL: * Initialize the expression to use for queries to the class and its subclasses. */ protected void initializeWithAllSubclassesExpression() throws DescriptorException { if (getWithAllSubclassesExpression() == null) { if (hasClassExtractor()) { return; } if (isChildDescriptor() && shouldReadSubclasses()) { setWithAllSubclassesExpression(new ExpressionBuilder().getField(getClassIndicatorField()).in(getAllChildClassIndicators())); } } }
/** * INTERNAL: * Initialize the expression to use for queries to the class and its subclasses. */ protected void initializeWithAllSubclassesExpression() throws DescriptorException { if (getWithAllSubclassesExpression() == null) { if (hasClassExtractor()) { return; } if (isChildDescriptor() && shouldReadSubclasses()) { setWithAllSubclassesExpression(new ExpressionBuilder().getField(getClassIndicatorField()).in(getAllChildClassIndicators())); } } }