/** * 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: * 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: * 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: * 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: * 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: * 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); } }