/** * INTERNAL: * Called when iterating through descriptors to handle iteration on this mapping when it is used as a MapKey * @param iterator * @param element */ public void iterateOnMapKey(DescriptorIterator iterator, Object element){ if (iterator.shouldIterateOnPrimitives()) { iterator.iteratePrimitiveForMapping(element, this); } }
/** * INTERNAL: * Iterate on the attribute value. * The value holder has already been processed. * PERF: Avoid iteration if not required. */ @Override public void iterateOnRealAttributeValue(DescriptorIterator iterator, Object realAttributeValue) { if (iterator.shouldIterateOnPrimitives()) { super.iterateOnRealAttributeValue(iterator, realAttributeValue); } }
/** * INTERNAL: * Iterate on the attribute value. * The value holder has already been processed. * PERF: Avoid iteration if not required. */ public void iterateOnRealAttributeValue(DescriptorIterator iterator, Object realAttributeValue) { if (iterator.shouldIterateOnPrimitives()) { super.iterateOnRealAttributeValue(iterator, realAttributeValue); } }
/** * INTERNAL: * Called when iterating through descriptors to handle iteration on this mapping when it is used as a MapKey. */ public void iterateOnMapKey(DescriptorIterator iterator, Object element){ if (iterator.shouldIterateOnPrimitives()) { iterator.iteratePrimitiveForMapping(element, this); } }
/** * INTERNAL: * Iterate on the attribute value. * The value holder has already been processed. * PERF: Avoid iteration if not required. */ @Override public void iterateOnRealAttributeValue(DescriptorIterator iterator, Object realAttributeValue) { if (iterator.shouldIterateOnPrimitives()) { super.iterateOnRealAttributeValue(iterator, realAttributeValue); } }
/** * INTERNAL: * Called when iterating through descriptors to handle iteration on this mapping when it is used as a MapKey. */ public void iterateOnMapKey(DescriptorIterator iterator, Object element){ if (iterator.shouldIterateOnPrimitives()) { iterator.iteratePrimitiveForMapping(element, this); } }
/** * INTERNAL: * Perform the iteration operation on the objects attributes through the mappings. */ public void iterate(DescriptorIterator iterator) { List<DatabaseMapping> mappings; // Only iterate on relationships if required. if (iterator.shouldIterateOnPrimitives()) { mappings = this.descriptor.getMappings(); } else { // PERF: Only process relationships. if (this.isSimple) { return; } mappings = this.relationshipMappings; } int mappingsSize = mappings.size(); for (int index = 0; index < mappingsSize; index++) { mappings.get(index).iterate(iterator); } }
/** * INTERNAL: * Perform the iteration operation on the objects attributes through the mappings. */ public void iterate(DescriptorIterator iterator) { List<DatabaseMapping> mappings; // Only iterate on relationships if required. if (iterator.shouldIterateOnPrimitives()) { mappings = this.descriptor.getMappings(); } else { // PERF: Only process relationships. if (this.isSimple) { return; } mappings = this.relationshipMappings; } int mappingsSize = mappings.size(); for (int index = 0; index < mappingsSize; index++) { mappings.get(index).iterate(iterator); } }
/** * INTERNAL: * Iterate on the appropriate attribute. */ @Override public void iterate(DescriptorIterator iterator) { // PERF: Only iterate when required. if (iterator.shouldIterateOnPrimitives()) { iterator.iteratePrimitiveForMapping(getAttributeValueFromObject(iterator.getVisitedParent()), this); } }
/** * INTERNAL: * Iterate on the appropriate attribute. */ @Override public void iterate(DescriptorIterator iterator) { // PERF: Only iterate when required. if (iterator.shouldIterateOnPrimitives()) { iterator.iteratePrimitiveForMapping(getAttributeValueFromObject(iterator.getVisitedParent()), this); } }
/** * INTERNAL: * Iterate on the appropriate attribute. */ public void iterate(DescriptorIterator iterator) { // PERF: Only iterate when required. if (iterator.shouldIterateOnPrimitives()) { iterator.iteratePrimitiveForMapping(getAttributeValueFromObject(iterator.getVisitedParent()), this); } }
/** * Iterate on the primitive value for its mapping. */ public void iteratePrimitiveForMapping(Object primitiveValue, DatabaseMapping mapping) { if (primitiveValue == null) { return; } setCurrentMapping(mapping); setCurrentDescriptor(null); if (shouldIterateOnPrimitives()) {// false by default internalIteratePrimitive(primitiveValue); } }
/** * INTERNAL: * Perform the iteration operation on the objects attributes through the mappings. */ public void iterate(DescriptorIterator iterator) { List<DatabaseMapping> mappings; // Only iterate on relationships if required. if (iterator.shouldIterateOnPrimitives()) { mappings = this.descriptor.getMappings(); } else { ObjectBuilder builder = this.descriptor.getObjectBuilder(); // PERF: Only process relationships. if (builder.isSimple()) { return; } mappings = builder.getRelationshipMappings(); } int mappingsSize = mappings.size(); for (int index = 0; index < mappingsSize; index++) { mappings.get(index).iterate(iterator); } }
/** * Iterate on the primitive value for its mapping. */ public void iteratePrimitiveForMapping(Object primitiveValue, DatabaseMapping mapping) { if (primitiveValue == null) { return; } setCurrentMapping(mapping); setCurrentDescriptor(null); if (shouldIterateOnPrimitives()) {// false by default AttributeGroup currentGroupOriginal = null; AttributeItem currentItemOriginal = null; if(this.usesGroup) { currentGroupOriginal = this.currentGroup; currentItemOriginal = this.currentItem; this.currentGroup = this.currentItem.getGroup(); } internalIteratePrimitive(primitiveValue); if(this.usesGroup) { this.currentGroup = currentGroupOriginal; this.currentItem = currentItemOriginal; } } }
/** * INTERNAL: * Iterate on the attribute value. * The value holder has already been processed. * PERF: Avoid iteration if not required. */ public void iterateOnRealAttributeValue(DescriptorIterator iterator, Object realAttributeValue) { super.iterateOnRealAttributeValue(iterator, realAttributeValue); ContainerPolicy cp = getContainerPolicy(); if (realAttributeValue != null && !iterator.shouldIterateOnPrimitives()) { for (Object iter = cp.iteratorFor(realAttributeValue); cp.hasNext(iter);) { Object wrappedObject = cp.nextEntry(iter, iterator.getSession()); cp.iterateOnMapKey(iterator, wrappedObject); } } }
/** * INTERNAL: * Iterate on the attribute value. * The value holder has already been processed. * PERF: Avoid iteration if not required. */ @Override public void iterateOnRealAttributeValue(DescriptorIterator iterator, Object realAttributeValue) { super.iterateOnRealAttributeValue(iterator, realAttributeValue); ContainerPolicy cp = getContainerPolicy(); if (realAttributeValue != null && !iterator.shouldIterateOnPrimitives()) { for (Object iter = cp.iteratorFor(realAttributeValue); cp.hasNext(iter);) { Object wrappedObject = cp.nextEntry(iter, iterator.getSession()); cp.iterateOnMapKey(iterator, wrappedObject); } } }
/** * INTERNAL: * Iterate on the attribute value. * The value holder has already been processed. * PERF: Avoid iteration if not required. */ @Override public void iterateOnRealAttributeValue(DescriptorIterator iterator, Object realAttributeValue) { super.iterateOnRealAttributeValue(iterator, realAttributeValue); ContainerPolicy cp = getContainerPolicy(); if (realAttributeValue != null && !iterator.shouldIterateOnPrimitives()) { for (Object iter = cp.iteratorFor(realAttributeValue); cp.hasNext(iter);) { Object wrappedObject = cp.nextEntry(iter, iterator.getSession()); cp.iterateOnMapKey(iterator, wrappedObject); } } }
/** * INTERNAL: * Iterate on the appropriate attribute value. */ public void iterate(DescriptorIterator iterator) { // PERF: Only iterate when required. if (iterator.shouldIterateOnPrimitives()) { Object attributeValue = this.getAttributeValueFromObject(iterator.getVisitedParent()); if (attributeValue == null) { return; } ContainerPolicy cp = this.getContainerPolicy(); for (Object iter = cp.iteratorFor(attributeValue); cp.hasNext(iter);) { iterator.iteratePrimitiveForMapping(cp.next(iter, iterator.getSession()), this); } } }
/** * INTERNAL: * Iterate on the appropriate attribute value. */ public void iterate(DescriptorIterator iterator) { // PERF: Only iterate when required. if (iterator.shouldIterateOnPrimitives()) { Object attributeValue = this.getAttributeValueFromObject(iterator.getVisitedParent()); if (attributeValue == null) { return; } ContainerPolicy cp = this.getContainerPolicy(); for (Object iter = cp.iteratorFor(attributeValue); cp.hasNext(iter);) { iterator.iteratePrimitiveForMapping(cp.next(iter, iterator.getSession()), this); } } }
/** * INTERNAL: * Iterate on the appropriate attribute value. */ public void iterate(DescriptorIterator iterator) { // PERF: Only iterate when required. if (iterator.shouldIterateOnPrimitives()) { Object attributeValue = this.getAttributeValueFromObject(iterator.getVisitedParent()); if (attributeValue == null) { return; } ContainerPolicy cp = this.getContainerPolicy(); for (Object iter = cp.iteratorFor(attributeValue); cp.hasNext(iter);) { iterator.iteratePrimitiveForMapping(cp.next(iter, iterator.getSession()), this); } } }