Class QueryResultMapping
java.lang.Object
org.apache.openjpa.jdbc.meta.QueryResultMapping
- All Implemented Interfaces:
SourceTracker, Commentable, MetaDataModes
Mapping of a query result set to scalar and/or persistence-capable
object-level values.
- Author:
- Pinaki Poddar, Abe White
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classColumn info for a constructor result.static classA constructor result mapping that maps SQL result columns to a constructor of a target class.classA persistence-capable result. -
Field Summary
Fields inherited from interface Commentable
EMPTY_COMMENTSFields inherited from interface MetaDataModes
MODE_ALL, MODE_ANN_MAPPING, MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERYFields inherited from interface SourceTracker
SRC_ANNOTATIONS, SRC_OTHER, SRC_XML -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the id of a mapped column in the query result.addConstructorResult(Class<?> targetClass) Add a mapped constructor result with the given target class.addPCResult(Class<?> candidate) Add a mapped persistence-capable result with the given candidate type.intReturn the column number in the line of the file at which this instance was parsed.Object[]Ids of mapped scalar columns in the result.String[]////////////Return the mapped constructor results in the query result.Class<?> The class that defines this query result, or null if none.intReturn the line number of the file at which this instance was parsed.intRelative order of result mapping in metadata.getName()Return the name for this query result.Return the mapped persistence-capable types in the query result.Return the domain-meaningful name of the resource that was loaded from this source./////////////////////////////intThe source mode of this query result.Return the domain-dependent scope of this instance within its file.intReturn the type of source.voidsetColNumber(int colNum) voidsetComments(String[] comments) Set comments.voidsetDefiningType(Class<?> cls) The class that defines this query result, or null if none.voidsetLineNumber(int lineNum) voidsetListingIndex(int idx) Relative order of result mapping in metadata.voidvoidsetSourceMode(int mode) The source mode of this query result.toString()
-
Method Details
-
getName
Return the name for this query result. -
getDefiningType
The class that defines this query result, or null if none. -
setDefiningType
The class that defines this query result, or null if none. -
getColumnResults
Ids of mapped scalar columns in the result. These will typically be column names.- See Also:
-
addColumnResult
Add the id of a mapped column in the query result. This will typically be a column name.- See Also:
-
getPCResults
Return the mapped persistence-capable types in the query result. -
getConstructorResults
Return the mapped constructor results in the query result. -
addConstructorResult
Add a mapped constructor result with the given target class. -
addPCResult
Add a mapped persistence-capable result with the given candidate type. -
getSourceMode
public int getSourceMode()The source mode of this query result. -
setSourceMode
public void setSourceMode(int mode) The source mode of this query result. -
getListingIndex
public int getListingIndex()Relative order of result mapping in metadata. -
setListingIndex
public void setListingIndex(int idx) Relative order of result mapping in metadata. -
toString
-
getComments
-
setComments
Description copied from interface:CommentableSet comments.- Specified by:
setCommentsin interfaceCommentable
-
getSourceFile
/////////////////////////////- Specified by:
getSourceFilein interfaceSourceTracker
-
getSourceScope
Description copied from interface:SourceTrackerReturn the domain-dependent scope of this instance within its file.- Specified by:
getSourceScopein interfaceSourceTracker
-
getSourceType
public int getSourceType()Description copied from interface:SourceTrackerReturn the type of source.- Specified by:
getSourceTypein interfaceSourceTracker
-
setSource
-
getResourceName
Description copied from interface:SourceTrackerReturn the domain-meaningful name of the resource that was loaded from this source. I.e., if we had loaded the source for a Java class, this would return the name of the class.- Specified by:
getResourceNamein interfaceSourceTracker
-
getLineNumber
public int getLineNumber()Description copied from interface:SourceTrackerReturn the line number of the file at which this instance was parsed.- Specified by:
getLineNumberin interfaceSourceTracker
-
setLineNumber
public void setLineNumber(int lineNum) -
getColNumber
public int getColNumber()Description copied from interface:SourceTrackerReturn the column number in the line of the file at which this instance was parsed.- Specified by:
getColNumberin interfaceSourceTracker
-
setColNumber
public void setColNumber(int colNum)
-