Interface DirectMapping<ABSTRACT_SESSION extends CoreAbstractSession,ATTRIBUTE_ACCESSOR extends CoreAttributeAccessor,CONTAINER_POLICY extends CoreContainerPolicy,CONVERTER extends CoreConverter,DESCRIPTOR extends CoreDescriptor,FIELD extends CoreField,MARSHALLER extends Marshaller,SESSION extends CoreSession,UNMARSHALLER extends Unmarshaller,XML_RECORD extends XMLRecord>
-
- All Superinterfaces:
Mapping<ABSTRACT_SESSION,ATTRIBUTE_ACCESSOR,CONTAINER_POLICY,DESCRIPTOR,FIELD,XML_RECORD>
,XMLConverterMapping<MARSHALLER,SESSION,UNMARSHALLER>
- All Known Implementing Classes:
XMLBinaryDataMapping
,XMLDirectMapping
,XMLFragmentMapping
public interface DirectMapping<ABSTRACT_SESSION extends CoreAbstractSession,ATTRIBUTE_ACCESSOR extends CoreAttributeAccessor,CONTAINER_POLICY extends CoreContainerPolicy,CONVERTER extends CoreConverter,DESCRIPTOR extends CoreDescriptor,FIELD extends CoreField,MARSHALLER extends Marshaller,SESSION extends CoreSession,UNMARSHALLER extends Unmarshaller,XML_RECORD extends XMLRecord> extends Mapping<ABSTRACT_SESSION,ATTRIBUTE_ACCESSOR,CONTAINER_POLICY,DESCRIPTOR,FIELD,XML_RECORD>, XMLConverterMapping<MARSHALLER,SESSION,UNMARSHALLER>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Object
getAttributeValue(java.lang.Object object, ABSTRACT_SESSION session, AbstractUnmarshalRecord record)
CONVERTER
getConverter()
Return the converter on the mapping.java.lang.Object
getFieldValue(java.lang.Object object, CoreAbstractSession session, AbstractMarshalRecord record)
AbstractNullPolicy
getNullPolicy()
java.lang.Object
getNullValue()
java.lang.Object
getObjectValue(java.lang.Object object, SESSION session)
java.lang.String
getXPath()
Get the XPath Stringboolean
hasConverter()
boolean
isCDATA()
void
setAttributeClassification(java.lang.Class attributeClassification)
Some databases do not properly support all of the base data types.void
setAttributeClassificationName(java.lang.String attributeClassificationName)
INTERNAL: Set the name of the class for MW usage.void
setCollapsingStringValues(boolean collapse)
Indicates that this mapping should collapse all string values before setting them in the object on unmarshal.void
setConverter(CONVERTER converter)
Set the converter on the mapping.void
setField(FIELD theField)
ADVANCED: Set the field in the mapping.void
setIsCDATA(boolean CDATA)
void
setIsWriteOnly(boolean b)
void
setNormalizingStringValues(boolean normalize)
Indicates that this mapping should normalize all string values before setting them in the object on unmarshal.void
setNullPolicy(AbstractNullPolicy aNullPolicy)
Set the AbstractNullPolicy on the mapping
The default policy is NullPolicy.void
setNullValue(java.lang.Object nullValue)
Allow for the value used for null to be specified.void
setNullValueMarshalled(boolean value)
Set whether this mapping's value should be marshalled, in the case that it is equal to the default null value.void
setXPath(java.lang.String xpathString)
Set the Mapping field name attribute to the given XPath Stringjava.lang.Object
valueFromObject(java.lang.Object object, FIELD field, ABSTRACT_SESSION abstractSession)
-
Methods inherited from interface org.eclipse.persistence.internal.oxm.mappings.Mapping
convertClassNamesToClasses, getAttributeAccessor, getAttributeClassification, getAttributeName, getAttributeValueFromObject, getContainerPolicy, getDescriptor, getField, getReferenceDescriptor, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isCollectionMapping, isReadOnly, isReferenceMapping, isTransformationMapping, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setGetMethodName, setIsReadOnly, setProperties, setSetMethodName, writeSingleValue
-
Methods inherited from interface org.eclipse.persistence.internal.oxm.mappings.XMLConverterMapping
convertDataValueToObjectValue, convertObjectValueToDataValue
-
-
-
-
Method Detail
-
getAttributeValue
java.lang.Object getAttributeValue(java.lang.Object object, ABSTRACT_SESSION session, AbstractUnmarshalRecord record)
-
getConverter
CONVERTER getConverter()
Return the converter on the mapping. A converter can be used to convert between the object's value and database value of the attribute.
-
getFieldValue
java.lang.Object getFieldValue(java.lang.Object object, CoreAbstractSession session, AbstractMarshalRecord record)
-
getNullPolicy
AbstractNullPolicy getNullPolicy()
-
getNullValue
java.lang.Object getNullValue()
-
getObjectValue
java.lang.Object getObjectValue(java.lang.Object object, SESSION session)
-
getXPath
java.lang.String getXPath()
Get the XPath String- Returns:
- String the XPath String associated with this Mapping
-
hasConverter
boolean hasConverter()
-
isCDATA
boolean isCDATA()
-
setAttributeClassification
void setAttributeClassification(java.lang.Class attributeClassification)
Some databases do not properly support all of the base data types. For these databases, the base data type must be explicitly specified in the mapping to tell EclipseLink to force the instance variable value to that data type
-
setAttributeClassificationName
void setAttributeClassificationName(java.lang.String attributeClassificationName)
INTERNAL: Set the name of the class for MW usage.
-
setCollapsingStringValues
void setCollapsingStringValues(boolean collapse)
Indicates that this mapping should collapse all string values before setting them in the object on unmarshal. Collapse removes leading and trailing whitespaces, and replaces any sequence of whitepsace characters with a single space.- Parameters:
collapse
-
-
setConverter
void setConverter(CONVERTER converter)
Set the converter on the mapping. A converter can be used to convert between the object's value and database value of the attribute.
-
setField
void setField(FIELD theField)
ADVANCED: Set the field in the mapping. This can be used for advanced field types, such as XML nodes, or to set the field type.
-
setIsCDATA
void setIsCDATA(boolean CDATA)
-
setIsWriteOnly
void setIsWriteOnly(boolean b)
-
setNormalizingStringValues
void setNormalizingStringValues(boolean normalize)
Indicates that this mapping should normalize all string values before setting them in the object on unmarshal. Normalize replaces any CR, LF or Tab characters with a single space character.- Parameters:
normalize
-
-
setNullPolicy
void setNullPolicy(AbstractNullPolicy aNullPolicy)
Set the AbstractNullPolicy on the mapping
The default policy is NullPolicy.- Parameters:
aNullPolicy
-
-
setNullValue
void setNullValue(java.lang.Object nullValue)
Allow for the value used for null to be specified. This can be used to convert database null values to application specific values, when null values are not allowed by the application (such as in primitives). Note: the default value for NULL is used on reads, writes, and query SQL generation
-
setNullValueMarshalled
void setNullValueMarshalled(boolean value)
Set whether this mapping's value should be marshalled, in the case that it is equal to the default null value.
-
setXPath
void setXPath(java.lang.String xpathString)
Set the Mapping field name attribute to the given XPath String- Parameters:
xpathString
- String
-
valueFromObject
java.lang.Object valueFromObject(java.lang.Object object, FIELD field, ABSTRACT_SESSION abstractSession)
-
-