Top Description Fields Constructors Methods
org.eclipse.persistence.queries

public Class EntityResult

extends SQLResult
Class Inheritance
Imports
java.security.AccessController, .PrivilegedActionException, java.util.HashMap, .Iterator, .Map, org.eclipse.persistence.exceptions.QueryException, .ValidationException, org.eclipse.persistence.internal.helper.DatabaseField, org.eclipse.persistence.internal.localization.ExceptionLocalization, org.eclipse.persistence.internal.security.PrivilegedAccessHelper, .PrivilegedClassForName, org.eclipse.persistence.internal.sessions.AbstractRecord, org.eclipse.persistence.mappings.DatabaseMapping, .OneToOneMapping, org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.sessions.DatabaseRecord

Purpose: Concrete class to represent the EntityResult structure as defined by the EJB 3.0 Persistence specification. This class is a subcomponent of the SQLResultSetMapping

Author
Gordon Yorke
Since
TopLink Java Essentials
See Also
SQLResultSetMapping

Field Summary

Modifier and TypeField and Description
protected DatabaseField
discriminatorColumn

Stores the column that will contain the value to determine the correct subclass to create if applicable.

protected transient Class<?>
protected String
entityClassName

Stores the class name of result

protected Map<K, V>
fieldResults

Stores the list of FieldResult

Inherited from org.eclipse.persistence.queries.SQLResult:
sqlResultSetMapping

Constructor Summary

AccessConstructor and Description
public
EntityResult(Class<?> entityClass)

public
EntityResult(String entityClassName)

Method Summary

Modifier and TypeMethod and Description
public void
public void
convertClassNamesToClasses(ClassLoader classLoader)

Overrides org.eclipse.persistence.queries.SQLResult.convertClassNamesToClasses.

INTERNAL: Convert all the class-name-based settings in this query to actual class-based settings.
public DatabaseField
getDiscriminatorColumn()

Returns the column name for the column that will store the value used to determine the subclass type if applicable.

public Map<K, V>
getFieldResults()

Accessor for the internally stored list of FieldResult.

public Object
getValueFromRecord(DatabaseRecord record, ResultSetMappingQuery query)

Implements abstract org.eclipse.persistence.queries.SQLResult.getValueFromRecord.

INTERNAL: This method is a convenience method for extracting values from Results
public void
getValueFromRecordForMapping(DatabaseRecord entityRecord, DatabaseMapping mapping, FieldResult fieldResult, DatabaseRecord databaseRecord)

INTERNAL: This method is for processing all FieldResults for a mapping.

public boolean
isEntityResult()

Overrides org.eclipse.persistence.queries.SQLResult.isEntityResult.

Return true if this is an entity result.
public DatabaseField
processValueFromRecordForMapping(ClassDescriptor descriptor, String[] attributeNames, int currentLoc)

INTERNAL: This method is for processing a single FieldResult, returning the DatabaseField it refers to.

public void
setDiscriminatorColumn(String column)

Sets the column name for the column that will store the value used to determine the subclass type if applicable.

public void
Inherited from org.eclipse.persistence.queries.SQLResult:
getSQLResultMappingisColumnResultisConstructorResultsetSQLResultMapping

Field Detail

discriminatorColumnback to summary
protected DatabaseField discriminatorColumn

Stores the column that will contain the value to determine the correct subclass to create if applicable.

entityClassback to summary
protected transient Class<?> entityClass
entityClassNameback to summary
protected String entityClassName

Stores the class name of result

fieldResultsback to summary
protected Map<K, V> fieldResults

Stores the list of FieldResult

Constructor Detail

EntityResultback to summary
public EntityResult(Class<?> entityClass)
EntityResultback to summary
public EntityResult(String entityClassName)

Method Detail

addFieldResultback to summary
public void addFieldResult(FieldResult fieldResult)
convertClassNamesToClassesback to summary
public void convertClassNamesToClasses(ClassLoader classLoader)

Overrides org.eclipse.persistence.queries.SQLResult.convertClassNamesToClasses.

INTERNAL: Convert all the class-name-based settings in this query to actual class-based settings. This method is used when converting a project that has been built with class names to a project with classes.

Annotations
@Override
getDiscriminatorColumnback to summary
public DatabaseField getDiscriminatorColumn()

Returns the column name for the column that will store the value used to determine the subclass type if applicable.

getFieldResultsback to summary
public Map<K, V> getFieldResults()

Accessor for the internally stored list of FieldResult. Calling this method will result in a collection being created to store the FieldResult

getValueFromRecordback to summary
public Object getValueFromRecord(DatabaseRecord record, ResultSetMappingQuery query)

Implements abstract org.eclipse.persistence.queries.SQLResult.getValueFromRecord.

INTERNAL: This method is a convenience method for extracting values from Results

Annotations
@Override
getValueFromRecordForMappingback to summary
public void getValueFromRecordForMapping(DatabaseRecord entityRecord, DatabaseMapping mapping, FieldResult fieldResult, DatabaseRecord databaseRecord)

INTERNAL: This method is for processing all FieldResults for a mapping. Adds DatabaseFields to the passed in entityRecord

isEntityResultback to summary
public boolean isEntityResult()

Overrides org.eclipse.persistence.queries.SQLResult.isEntityResult.

Doc from org.eclipse.persistence.queries.SQLResult.isEntityResult.

Return true if this is an entity result.

Annotations
@Override
processValueFromRecordForMappingback to summary
public DatabaseField processValueFromRecordForMapping(ClassDescriptor descriptor, String[] attributeNames, int currentLoc)

INTERNAL: This method is for processing a single FieldResult, returning the DatabaseField it refers to.

setDiscriminatorColumnback to summary
public void setDiscriminatorColumn(String column)

Sets the column name for the column that will store the value used to determine the subclass type if applicable.

setDiscriminatorColumnback to summary
public void setDiscriminatorColumn(DatabaseField column)