/** * PUBLIC: * Set the descriptor to only read instance of itself when queried. * This is used with inheritance to configure the result of queries. * By default this is true for root inheritance descriptors, and false for all others. */ public void dontReadSubclassesOnQueries() { setShouldReadSubclasses(false); }
/** * PUBLIC: * Set the descriptor to read instance of itself and its subclasses when queried. * This is used with inheritance to configure the result of queries. * By default this is true for root inheritance descriptors, and false for all others. */ public void readSubclassesOnQueries() { setShouldReadSubclasses(true); }
/** * PUBLIC: * Set the descriptor to only read instance of itself when queried. * This is used with inheritance to configure the result of queries. * By default this is true for root inheritance descriptors, and false for all others. */ public void dontReadSubclassesOnQueries() { setShouldReadSubclasses(false); }
/** * PUBLIC: * Set the descriptor to only read instance of itself when queried. * This is used with inheritance to configure the result of queries. * By default this is true for root inheritance descriptors, and false for all others. */ public void dontReadSubclassesOnQueries() { setShouldReadSubclasses(false); }
/** * PUBLIC: * Set the descriptor to read instance of itself and its subclasses when queried. * This is used with inheritance to configure the result of queries. * By default this is true for root inheritance descriptors, and false for all others. */ public void readSubclassesOnQueries() { setShouldReadSubclasses(true); }
/** * PUBLIC: * Set the descriptor to read instance of itself and its subclasses when queried. * This is used with inheritance to configure the result of queries. * By default this is true for root inheritance descriptors, and false for all others. */ public void readSubclassesOnQueries() { setShouldReadSubclasses(true); }
parentDescriptor.getInheritancePolicy().setShouldReadSubclasses(true); Class parentClass = parentType.getImplClass(); getXmlDescriptor().getInheritancePolicy().setParentClass(parentClass);
parentDescriptor.getInheritancePolicy().setShouldReadSubclasses(true); Class parentClass = parentType.getImplClass(); getXmlDescriptor().getInheritancePolicy().setParentClass(parentClass);
protected ClassDescriptor buildFieldTransformationDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(FieldTransformation.class); descriptor.setDefaultRootElement("field-transformation"); descriptor.getInheritancePolicy().setClassIndicatorField(new XMLField("@xsi:type")); descriptor.getInheritancePolicy().setShouldReadSubclasses(true); descriptor.getInheritancePolicy().addClassIndicator(FieldTransformation.class, getPrimaryNamespaceXPath() + "field-transformation"); descriptor.getInheritancePolicy().addClassIndicator(MethodBasedFieldTransformation.class, getPrimaryNamespaceXPath() + "method-based-field-transformation"); descriptor.getInheritancePolicy().addClassIndicator(TransformerBasedFieldTransformation.class, getPrimaryNamespaceXPath() + "transformer-based-field-transformation"); XMLCompositeObjectMapping fieldMapping = new XMLCompositeObjectMapping(); fieldMapping.setAttributeName("field"); fieldMapping.setReferenceClass(DatabaseField.class); fieldMapping.setXPath(getPrimaryNamespaceXPath() + "field"); fieldMapping.setGetMethodName("getField"); fieldMapping.setSetMethodName("setField"); descriptor.addMapping(fieldMapping); return descriptor; }
protected ClassDescriptor buildFieldTransformationDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(FieldTransformation.class); descriptor.setDefaultRootElement("field-transformation"); descriptor.getInheritancePolicy().setClassIndicatorField(new XMLField("@xsi:type")); descriptor.getInheritancePolicy().setShouldReadSubclasses(true); descriptor.getInheritancePolicy().addClassIndicator(FieldTransformation.class, getPrimaryNamespaceXPath() + "field-transformation"); descriptor.getInheritancePolicy().addClassIndicator(MethodBasedFieldTransformation.class, getPrimaryNamespaceXPath() + "method-based-field-transformation"); descriptor.getInheritancePolicy().addClassIndicator(TransformerBasedFieldTransformation.class, getPrimaryNamespaceXPath() + "transformer-based-field-transformation"); XMLCompositeObjectMapping fieldMapping = new XMLCompositeObjectMapping(); fieldMapping.setAttributeName("field"); fieldMapping.setReferenceClass(DatabaseField.class); fieldMapping.setXPath(getPrimaryNamespaceXPath() + "field"); fieldMapping.setGetMethodName("getField"); fieldMapping.setSetMethodName("setField"); ((XMLField)fieldMapping.getField()).setLeafElementType(fieldQname); descriptor.addMapping(fieldMapping); return descriptor; }
protected ClassDescriptor buildFieldTransformationDescriptor() { XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(FieldTransformation.class); descriptor.setDefaultRootElement("field-transformation"); descriptor.getInheritancePolicy().setClassIndicatorField(new XMLField("@xsi:type")); descriptor.getInheritancePolicy().setShouldReadSubclasses(true); descriptor.getInheritancePolicy().addClassIndicator(FieldTransformation.class, getPrimaryNamespaceXPath() + "field-transformation"); descriptor.getInheritancePolicy().addClassIndicator(MethodBasedFieldTransformation.class, getPrimaryNamespaceXPath() + "method-based-field-transformation"); descriptor.getInheritancePolicy().addClassIndicator(TransformerBasedFieldTransformation.class, getPrimaryNamespaceXPath() + "transformer-based-field-transformation"); XMLCompositeObjectMapping fieldMapping = new XMLCompositeObjectMapping(); fieldMapping.setAttributeName("field"); fieldMapping.setReferenceClass(DatabaseField.class); fieldMapping.setXPath(getPrimaryNamespaceXPath() + "field"); fieldMapping.setGetMethodName("getField"); fieldMapping.setSetMethodName("setField"); ((XMLField)fieldMapping.getField()).setLeafElementType(fieldQname); descriptor.addMapping(fieldMapping); return descriptor; }
setShouldReadSubclasses(!getChildDescriptors().isEmpty());
setShouldReadSubclasses(!getChildDescriptors().isEmpty());
setShouldReadSubclasses(!getChildDescriptors().isEmpty());