/** * 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); } }
/** * 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; } } }
setCurrentMapping(null); setCurrentDescriptor(getSession().getDescriptor(sourceObject)); setCurrentItem(null);
/** * 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; } } }
setCurrentMapping(null); setCurrentDescriptor(getSession().getDescriptor(sourceObject)); setCurrentItem(null);
/** * 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); } }
/** * Iterate on the mapping's reference object and * recursively iterate on the reference object's * reference objects. * This is used for aggregate and aggregate collection mappings, which are not iterated on by default. */ public void iterateForAggregateMapping(Object aggregateObject, DatabaseMapping mapping, ClassDescriptor descriptor) { if (aggregateObject == null) { return; } setCurrentMapping(mapping); // aggregate descriptors are passed in because they could be part of an inheritance tree setCurrentDescriptor(descriptor); if (shouldIterateOnAggregates()) {// false by default internalIterateAggregateObject(aggregateObject); if (shouldBreak()) { setShouldBreak(false); return; } } iterateReferenceObjects(aggregateObject); }
/** * Iterate on the value holder for its mapping. */ public void iterateValueHolderForMapping(ValueHolderInterface valueHolder, DatabaseMapping mapping) { setCurrentMapping(mapping); setCurrentDescriptor(null); if (shouldIterateOnIndirectionObjects()) {// false by default internalIterateValueHolder(valueHolder); } if (shouldIterateOverUninstantiatedIndirectionObjects() || (shouldIterateOverIndirectionObjects() && valueHolder.isInstantiated())) { // force instantiation only if specified mapping.iterateOnRealAttributeValue(this, valueHolder.getValue()); } }
/** * Iterate on the value holder for its mapping. */ public void iterateValueHolderForMapping(ValueHolderInterface valueHolder, DatabaseMapping mapping) { setCurrentMapping(mapping); setCurrentDescriptor(null); if (shouldIterateOnIndirectionObjects()) {// false by default internalIterateValueHolder(valueHolder); } if (shouldIterateOverUninstantiatedIndirectionObjects() || (shouldIterateOverIndirectionObjects() && valueHolder.isInstantiated())) { // force instantiation only if specified mapping.iterateOnRealAttributeValue(this, valueHolder.getValue()); } }
setCurrentMapping(mapping); setCurrentDescriptor(getDescriptorFor(referenceObject));
setCurrentMapping(mapping); setCurrentDescriptor(getDescriptorFor(referenceObject));
/** * Iterate on the value holder for its mapping. */ public void iterateValueHolderForMapping(ValueHolderInterface valueHolder, DatabaseMapping mapping) { setCurrentMapping(mapping); setCurrentDescriptor(null); if (shouldIterateOnIndirectionObjects()) {// false by default internalIterateValueHolder(valueHolder); } if (shouldIterateOverUninstantiatedIndirectionObjects() || (shouldIterateOverIndirectionObjects() && valueHolder.isInstantiated())) { // force instantiation only if specified mapping.iterateOnRealAttributeValue(this, valueHolder.getValue()); } }
setCurrentMapping(mapping); setCurrentDescriptor(getDescriptorFor(referenceObject));
return; setCurrentMapping(mapping);
/** * Iterate on the indirection object for its mapping. */ public void iterateIndirectContainerForMapping(IndirectContainer container, DatabaseMapping mapping) { setCurrentMapping(mapping); setCurrentDescriptor(null); if (shouldIterateOnIndirectionObjects()) {// false by default internalIterateIndirectContainer(container); } if (shouldIterateOverUninstantiatedIndirectionObjects() || (shouldIterateOverIndirectionObjects() && container.isInstantiated())) { // force instantiation only if specified mapping.iterateOnRealAttributeValue(this, container); } else if (shouldIterateOverIndirectionObjects()) { // PERF: Allow the indirect container to iterate any cached elements. if (container instanceof IndirectCollection) { mapping.iterateOnRealAttributeValue(this, ((IndirectCollection)container).getAddedElements()); } } }
/** * Iterate on the indirection object for its mapping. */ public void iterateIndirectContainerForMapping(IndirectContainer container, DatabaseMapping mapping) { setCurrentMapping(mapping); setCurrentDescriptor(null); if (shouldIterateOnIndirectionObjects()) {// false by default internalIterateIndirectContainer(container); } if (shouldIterateOverUninstantiatedIndirectionObjects() || (shouldIterateOverIndirectionObjects() && container.isInstantiated())) { // force instantiation only if specified mapping.iterateOnRealAttributeValue(this, container); } else if (shouldIterateOverIndirectionObjects()) { // PERF: Allow the indirect container to iterate any cached elements. if (container instanceof IndirectCollection) { mapping.iterateOnRealAttributeValue(this, ((IndirectCollection)container).getAddedElements()); } } }
/** * Iterate on the indirection object for its mapping. */ public void iterateIndirectContainerForMapping(IndirectContainer container, DatabaseMapping mapping) { setCurrentMapping(mapping); setCurrentDescriptor(null); if (shouldIterateOnIndirectionObjects()) {// false by default internalIterateIndirectContainer(container); } if (shouldIterateOverUninstantiatedIndirectionObjects() || (shouldIterateOverIndirectionObjects() && container.isInstantiated())) { // force instantiation only if specified mapping.iterateOnRealAttributeValue(this, container); } else if (shouldIterateOverIndirectionObjects()) { // PERF: Allow the indirect container to iterate any cached elements. if (container instanceof IndirectCollection) { mapping.iterateOnRealAttributeValue(this, ((IndirectCollection)container).getAddedElements()); } } }