/** * ADVANCED: * A class extraction method can be registered with the descriptor to override the default inheritance mechanism. * This allows for the class indicator field to not be used, and a user defined one instead. * The method registered must be a static method on the class that the descriptor is for, * the method must take DatabaseRow as argument, and must return the class to use for that row. * This method will be used to decide which class to instantiate when reading from the database. * It is the application's responsiblity to populate any typing information in the database required * to determine the class from the row. * If this method is used then the class indicator field and mapping cannot be used, * also the descriptor's withAllSubclasses and onlyInstances expressions must also be setup correctly. * * @see #setWithAllSubclassesExpression(Expression) * @see #setOnlyInstancesExpression(Expression) */ public void setClassExtractionMethodName(String staticClassClassExtractionMethod) { if ((staticClassClassExtractionMethod == null) || (staticClassClassExtractionMethod.length() == 0)) { return; } if (!(getClassExtractor() instanceof MethodClassExtractor)) { setClassExtractor(new MethodClassExtractor()); } ((MethodClassExtractor)getClassExtractor()).setClassExtractionMethodName(staticClassClassExtractionMethod); }