/** * INTERNAL: * Return if this mapping requires its attribute value to be cloned. */ public boolean isCloningRequired() { return isMutable() || getDescriptor().getCopyPolicy().buildsNewInstance(); }
/** * INTERNAL: * Return if this mapping requires its attribute value to be cloned. */ @Override public boolean isCloningRequired() { return isMutable() || getDescriptor().getCopyPolicy().buildsNewInstance(); }
/** * INTERNAL: * Return if this mapping requires its attribute value to be cloned. */ @Override public boolean isCloningRequired() { return isMutable() || getDescriptor().getCopyPolicy().buildsNewInstance(); }
/** * INTERNAL: * Allows for subclasses to convert the attribute value. */ public Object getAttributeValue(Object fieldValue, Session session) { // PERF: Direct variable access. Object attributeValue = fieldValue; if ((fieldValue == null) && (this.nullValue != null)) {// Translate default null value return this.nullValue; } // Allow for user defined conversion to the object value. if (this.converter != null) { attributeValue = this.converter.convertDataValueToObjectValue(attributeValue, session); } else { // PERF: Avoid conversion check when not required. if ((attributeValue == null) || (attributeValue.getClass() != this.attributeObjectClassification)) { try { attributeValue = session.getDatasourcePlatform().convertObject(attributeValue, this.attributeClassification); } catch (ConversionException e) { throw ConversionException.couldNotBeConverted(this, getDescriptor(), e); } } } if (attributeValue == null) {// Translate default null value, conversion may have produced null. attributeValue = this.nullValue; } return attributeValue; }
/** * INTERNAL: * Allows for subclasses to convert the attribute value. */ public Object getObjectValue(Object fieldValue, Session session) { // PERF: Direct variable access. Object attributeValue = fieldValue; if ((fieldValue == null) && (this.nullValue != null)) {// Translate default null value return this.nullValue; } // Allow for user defined conversion to the object value. if (this.converter != null) { attributeValue = this.converter.convertDataValueToObjectValue(attributeValue, session); } else { // PERF: Avoid conversion check when not required. if ((attributeValue == null) || (attributeValue.getClass() != this.attributeObjectClassification)) { if ((attributeValue != null) || !this.bypassDefaultNullValueCheck) { try { attributeValue = session.getDatasourcePlatform().convertObject(attributeValue, this.attributeClassification); } catch (ConversionException e) { throw ConversionException.couldNotBeConverted(this, getDescriptor(), e); } } } } if (attributeValue == null) {// Translate default null value, conversion may have produced null. attributeValue = this.nullValue; } return attributeValue; }
/** * INTERNAL: * Allows for subclasses to convert the attribute value. */ public Object getObjectValue(Object fieldValue, Session session) { // PERF: Direct variable access. Object attributeValue = fieldValue; if ((fieldValue == null) && (this.nullValue != null)) {// Translate default null value return this.nullValue; } // Allow for user defined conversion to the object value. if (this.converter != null) { attributeValue = this.converter.convertDataValueToObjectValue(attributeValue, session); } else { // PERF: Avoid conversion check when not required. if ((attributeValue == null) || (attributeValue.getClass() != this.attributeObjectClassification)) { if ((attributeValue != null) || !this.bypassDefaultNullValueCheck) { try { attributeValue = session.getDatasourcePlatform().convertObject(attributeValue, this.attributeClassification); } catch (ConversionException e) { throw ConversionException.couldNotBeConverted(this, getDescriptor(), e); } } } } if (attributeValue == null) {// Translate default null value, conversion may have produced null. attributeValue = this.nullValue; } return attributeValue; }
attributeValue = session.getDatasourcePlatform().convertObject(null, this.attributeClassification); } catch (ConversionException e) { throw ConversionException.couldNotBeConverted(this, getDescriptor(), e);
attributeValue = session.getDatasourcePlatform().convertObject(null, this.attributeClassification); } catch (ConversionException e) { throw ConversionException.couldNotBeConverted(this, getDescriptor(), e);
/** * INTERNAL: * The mapping is initialized with the given session. * This mapping is fully initialized after this. */ public void initialize(AbstractSession session) throws DescriptorException { super.initialize(session); if (getField() == null) { session.getIntegrityChecker().handleError(DescriptorException.fieldNameNotSetInMapping(this)); } if (keyTableForMapKey == null){ setField(getDescriptor().buildField(getField())); } else { setField(getDescriptor().buildField(getField(), keyTableForMapKey)); } setFields(collectFields()); if (getConverter() != null) { getConverter().initialize(this, session); } // Must unwrap Struct types on WLS. if (getField().getSqlType() == java.sql.Types.STRUCT) { getDescriptor().setIsNativeConnectionRequired(true); } }
setField(getDescriptor().buildField(getField())); } else { setField(getDescriptor().buildField(getField(), keyTableForMapKey)); getDescriptor().setIsNativeConnectionRequired(true);
setField(getDescriptor().buildField(getField())); } else { setField(getDescriptor().buildField(getField(), keyTableForMapKey)); getDescriptor().setIsNativeConnectionRequired(true);