/** * Fetch and return the descriptor for the specified object. */ protected ClassDescriptor getDescriptorFor(Object object) { ClassDescriptor result = getSession().getDescriptor(object); if (result == null) { throw DescriptorException.missingDescriptor(object.getClass().getName()); } return result; }
/** * Fetch and return the descriptor for the specified object. */ protected ClassDescriptor getDescriptorFor(Object object) { ClassDescriptor result = getSession().getDescriptor(object); if (result == null) { throw DescriptorException.missingDescriptor(object.getClass().getName()); } return result; }
/** * Fetch and return the descriptor for the specified object. */ protected ClassDescriptor getDescriptorFor(Object object) { ClassDescriptor result = getSession().getDescriptor(object); if (result == null) { throw DescriptorException.missingDescriptor(object.getClass().getName()); } return result; }
/** * INTERNAL: * Iterate on the specified element. */ @Override public void iterateOnElement(DescriptorIterator iterator, Object element) { // CR#... Aggregate collections must iterate as aggregates, not regular mappings. // For some reason the element can be null, this makes absolutely no sense, but we have a test case for it... if (element != null) { iterator.iterateForAggregateMapping(element, this, getReferenceDescriptor(element.getClass(), iterator.getSession())); } }
/** * INTERNAL: * Iterate on the specified element. */ public void iterateOnElement(DescriptorIterator iterator, Object element) { // CR#... Aggregate collections must iterate as aggregates, not regular mappings. // For some reason the element can be null, this makes absolutely no sense, but we have a test case for it... if (element != null) { iterator.iterateForAggregateMapping(element, this, getReferenceDescriptor(element.getClass(), iterator.getSession())); } }
/** * INTERNAL: * Iterate on the specified element. */ @Override public void iterateOnElement(DescriptorIterator iterator, Object element) { // CR#... Aggregate collections must iterate as aggregates, not regular mappings. // For some reason the element can be null, this makes absolutely no sense, but we have a test case for it... if (element != null) { iterator.iterateForAggregateMapping(element, this, getReferenceDescriptor(element.getClass(), iterator.getSession())); } }
/** * Iterate on the specified attribute value. */ protected void iterateOnAttributeValue(DescriptorIterator iterator, Object attributeValue) { iterator.iterateForAggregateMapping(attributeValue, this, getReferenceDescriptor(attributeValue, iterator.getSession())); }
/** * Iterate on the specified attribute value. */ protected void iterateOnAttributeValue(DescriptorIterator iterator, Object attributeValue) { iterator.iterateForAggregateMapping(attributeValue, this, getReferenceDescriptor(attributeValue, iterator.getSession())); }
/** * Iterate on the specified attribute value. */ protected void iterateOnAttributeValue(DescriptorIterator iterator, Object attributeValue) { iterator.iterateForAggregateMapping(attributeValue, this, getReferenceDescriptor(attributeValue, iterator.getSession())); }
/** * INTERNAL: * Iterate on the attribute value. * The value holder has already been processed. */ @Override public void iterateOnRealAttributeValue(DescriptorIterator iterator, Object realAttributeValue) { // This may be wrapped as the caller in iterate on foreign reference does not unwrap as the type is generic. Object unwrappedAttributeValue = getReferenceDescriptor().getObjectBuilder().unwrapObject(realAttributeValue, iterator.getSession()); iterator.iterateReferenceObjectForMapping(unwrappedAttributeValue, this); }
/** * INTERNAL: * Iterate on the attribute value. * The value holder has already been processed. */ @Override public void iterateOnRealAttributeValue(DescriptorIterator iterator, Object realAttributeValue) { // This may be wrapped as the caller in iterate on foreign reference does not unwrap as the type is generic. Object unwrappedAttributeValue = getReferenceDescriptor().getObjectBuilder().unwrapObject(realAttributeValue, iterator.getSession()); iterator.iterateReferenceObjectForMapping(unwrappedAttributeValue, this); }
/** * INTERNAL: * Iterate on the attribute value. * The value holder has already been processed. */ public void iterateOnRealAttributeValue(DescriptorIterator iterator, Object realAttributeValue) { // This may be wrapped as the caller in iterate on foreign reference does not unwrap as the type is generic. Object unwrappedAttributeValue = getReferenceDescriptor().getObjectBuilder().unwrapObject(realAttributeValue, iterator.getSession()); iterator.iterateReferenceObjectForMapping(unwrappedAttributeValue, this); }
/** * Iterate on the specified attribute value. */ protected void iterateOnAttributeValue(DescriptorIterator descriptorIterator, Object attributeValue) { if (attributeValue == null) { return; } ContainerPolicy cp = this.getContainerPolicy(); for (Object iter = cp.iteratorFor(attributeValue); cp.hasNext(iter);) { super.iterateOnAttributeValue(descriptorIterator, cp.next(iter, descriptorIterator.getSession())); } }
/** * Iterate on the specified attribute value. */ @Override protected void iterateOnAttributeValue(DescriptorIterator descriptorIterator, Object attributeValue) { if (attributeValue == null) { return; } ContainerPolicy cp = this.getContainerPolicy(); for (Object iter = cp.iteratorFor(attributeValue); cp.hasNext(iter);) { super.iterateOnAttributeValue(descriptorIterator, cp.next(iter, descriptorIterator.getSession())); } }
/** * Iterate on the specified attribute value. */ @Override protected void iterateOnAttributeValue(DescriptorIterator descriptorIterator, Object attributeValue) { if (attributeValue == null) { return; } ContainerPolicy cp = this.getContainerPolicy(); for (Object iter = cp.iteratorFor(attributeValue); cp.hasNext(iter);) { super.iterateOnAttributeValue(descriptorIterator, cp.next(iter, descriptorIterator.getSession())); } }
/** * INTERNAL: * Iterate on the specified element. */ @Override public void iterateOnElement(DescriptorIterator iterator, Object element) { super.iterateOnElement(iterator, element); ContainerPolicy cp = getContainerPolicy(); for (Object iter = cp.iteratorFor(element); cp.hasNext(iter);) { Object wrappedObject = cp.nextEntry(iter, iterator.getSession()); cp.iterateOnMapKey(iterator, wrappedObject); } }
/** * INTERNAL: * Iterate on the specified element. */ @Override public void iterateOnElement(DescriptorIterator iterator, Object element) { super.iterateOnElement(iterator, element); ContainerPolicy cp = getContainerPolicy(); for (Object iter = cp.iteratorFor(element); cp.hasNext(iter);) { Object wrappedObject = cp.nextEntry(iter, iterator.getSession()); cp.iterateOnMapKey(iterator, wrappedObject); } }
/** * This is the root method called to start the iteration. */ public void startIterationOn(Object sourceObject) { if (getVisitedObjects().containsKey(sourceObject)) { return; } getVisitedObjects().put(sourceObject, sourceObject); setCurrentMapping(null); setCurrentDescriptor(getSession().getDescriptor(sourceObject)); iterate(sourceObject); // start the recursion if ((getCurrentDescriptor() != null) && (!shouldCascadeNoParts()) && !this.shouldBreak()) { iterateReferenceObjects(sourceObject); } }
/** * INTERNAL: * Iterate on the specified element. */ public void iterateOnElement(DescriptorIterator iterator, Object element) { super.iterateOnElement(iterator, element); ContainerPolicy cp = getContainerPolicy(); for (Object iter = cp.iteratorFor(element); cp.hasNext(iter);) { Object wrappedObject = cp.nextEntry(iter, iterator.getSession()); Object object = cp.unwrapIteratorResult(wrappedObject); cp.iterateOnMapKey(iterator, wrappedObject); } }
/** * 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); } } }