/** * INTERNAL: * The referenced object is checked if it is instantiated or not, * also check if it has been changed (as indirect collections avoid instantiation on add/remove. */ public boolean isAttributeValueInstantiatedOrChanged(Object object) { return this.indirectionPolicy.objectIsInstantiatedOrChanged(getAttributeValueFromObject(object)); }
/** * INTERNAL: * The referenced object is checked if it is instantiated or not, * also check if it has been changed (as indirect collections avoid instantiation on add/remove. */ public boolean isAttributeValueInstantiatedOrChanged(Object object) { return this.indirectionPolicy.objectIsInstantiatedOrChanged(getAttributeValueFromObject(object)); }
/** * INTERNAL: * The referenced object is checked if it is instantiated or not, * also check if it has been changed (as indirect collections avoid instantiation on add/remove. */ public boolean isAttributeValueInstantiatedOrChanged(Object object) { return this.indirectionPolicy.objectIsInstantiatedOrChanged(getAttributeValueFromObject(object)); }
/** * @return false for any lazily loaded property of root object being validated */ public boolean isReachable(Object traversableObject, Path.Node traversableProperty, Class<?> rootBeanType, Path pathToTraversableObject, ElementType elementType) { boolean reachable = true; String attributeName = null; if (isRootObjectPath(pathToTraversableObject)) { attributeName = traversableProperty.getName(); //Refer to section 4.2 of Bean Validation spec for more details about Path.Node DatabaseMapping mapping = getMappingForAttributeName(attributeName); if(mapping != null) { if(mapping.isForeignReferenceMapping()) { // For lazy relationships check whether it is instantiated if(mapping.isLazy()) { Object attributeValue = mapping.getAttributeAccessor().getAttributeValueFromObject(traversableObject); reachable = ((ForeignReferenceMapping)mapping).getIndirectionPolicy().objectIsInstantiatedOrChanged(attributeValue); } } else { // For lazy non relationship attributes, check whether it is fetched FetchGroupManager fetchGroupManager = descriptor.getFetchGroupManager(); if (fetchGroupManager != null) { reachable = fetchGroupManager.isAttributeFetched(traversableObject, attributeName); } } } } return reachable; }
Object oldAttribute = this.getAttributeValueFromObject(clone); if (wasAttributeValueFullyBuilt && this.indirectionPolicy.objectIsInstantiatedOrChanged(oldAttribute)){ this.indirectionPolicy.instantiateObject(clone, clonedAttributeValue);
Object oldAttribute = this.getAttributeValueFromObject(clone); if (wasAttributeValueFullyBuilt && this.indirectionPolicy.objectIsInstantiatedOrChanged(oldAttribute)){ this.indirectionPolicy.instantiateObject(clone, clonedAttributeValue);
Object oldAttribute = this.getAttributeValueFromObject(targetObject); if (wasAttributeValueFullyBuilt && this.indirectionPolicy.objectIsInstantiatedOrChanged(oldAttribute)){ this.indirectionPolicy.instantiateObject(targetObject, attributeValue);
Object oldAttribute = this.getAttributeValueFromObject(targetObject); if (wasAttributeValueFullyBuilt && this.indirectionPolicy.objectIsInstantiatedOrChanged(oldAttribute)){ this.indirectionPolicy.instantiateObject(targetObject, attributeValue);
if (this.indirectionPolicy.objectIsInstantiatedOrChanged(oldAttribute)){ this.indirectionPolicy.instantiateObject(object, attributeValue);
if (this.indirectionPolicy.objectIsInstantiatedOrChanged(oldAttribute)){ this.indirectionPolicy.instantiateObject(object, attributeValue);