Package org.apache.openjpa.jdbc.meta
Class QueryResultMapping
- java.lang.Object
- 
- org.apache.openjpa.jdbc.meta.QueryResultMapping
 
- 
- All Implemented Interfaces:
- SourceTracker,- Commentable,- MetaDataModes
 
 public class QueryResultMapping extends java.lang.Object implements MetaDataModes, SourceTracker, Commentable Mapping of a query result set to scalar and/or persistence-capable object-level values.- Author:
- Pinaki Poddar, Abe White
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description classQueryResultMapping.PCResultA persistence-capable result.
 - 
Field Summary- 
Fields inherited from interface org.apache.openjpa.lib.xml.CommentableEMPTY_COMMENTS
 - 
Fields inherited from interface org.apache.openjpa.meta.MetaDataModesMODE_ALL, MODE_ANN_MAPPING, MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERY
 - 
Fields inherited from interface org.apache.openjpa.lib.meta.SourceTrackerSRC_ANNOTATIONS, SRC_OTHER, SRC_XML
 
- 
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddColumnResult(java.lang.Object id)Add the id of a mapped column in the query result.QueryResultMapping.PCResultaddPCResult(java.lang.Class<?> candidate)Add a mapped persistence-capable result with the given candidate type.intgetColNumber()Return the column number in the line of the file at which this instance was parsed.java.lang.Object[]getColumnResults()Ids of mapped scalar columns in the result.java.lang.String[]getComments()Return comments, or empty array if none.java.lang.Class<?>getDefiningType()The class that defines this query result, or null if none.intgetLineNumber()Return the line number of the file at which this instance was parsed.intgetListingIndex()Relative order of result mapping in metadata.java.lang.StringgetName()Return the name for this query result.QueryResultMapping.PCResult[]getPCResults()Return the mapped persistence-capable types in the query result.java.lang.StringgetResourceName()Return the domain-meaningful name of the resource that was loaded from this source.java.io.FilegetSourceFile()Return the file from which this instance was parsed.intgetSourceMode()The source mode of this query result.java.lang.ObjectgetSourceScope()Return the domain-dependent scope of this instance within its file.intgetSourceType()Return the type of source.voidsetColNumber(int colNum)voidsetComments(java.lang.String[] comments)Set comments.voidsetDefiningType(java.lang.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.voidsetSource(java.io.File file, java.lang.Object scope, int srcType)voidsetSourceMode(int mode)The source mode of this query result.java.lang.StringtoString()
 
- 
- 
- 
Method Detail- 
getNamepublic java.lang.String getName() Return the name for this query result.
 - 
getDefiningTypepublic java.lang.Class<?> getDefiningType() The class that defines this query result, or null if none.
 - 
setDefiningTypepublic void setDefiningType(java.lang.Class<?> cls) The class that defines this query result, or null if none.
 - 
getColumnResultspublic java.lang.Object[] getColumnResults() Ids of mapped scalar columns in the result. These will typically be column names.- See Also:
- Result
 
 - 
addColumnResultpublic void addColumnResult(java.lang.Object id) Add the id of a mapped column in the query result. This will typically be a column name.- See Also:
- Result
 
 - 
getPCResultspublic QueryResultMapping.PCResult[] getPCResults() Return the mapped persistence-capable types in the query result.
 - 
addPCResultpublic QueryResultMapping.PCResult addPCResult(java.lang.Class<?> candidate) Add a mapped persistence-capable result with the given candidate type.
 - 
getSourceModepublic int getSourceMode() The source mode of this query result.
 - 
setSourceModepublic void setSourceMode(int mode) The source mode of this query result.
 - 
getListingIndexpublic int getListingIndex() Relative order of result mapping in metadata.
 - 
setListingIndexpublic void setListingIndex(int idx) Relative order of result mapping in metadata.
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 - 
getCommentspublic java.lang.String[] getComments() Description copied from interface:CommentableReturn comments, or empty array if none.- Specified by:
- getCommentsin interface- Commentable
 
 - 
setCommentspublic void setComments(java.lang.String[] comments) Description copied from interface:CommentableSet comments.- Specified by:
- setCommentsin interface- Commentable
 
 - 
getSourceFilepublic java.io.File getSourceFile() Description copied from interface:SourceTrackerReturn the file from which this instance was parsed.- Specified by:
- getSourceFilein interface- SourceTracker
 
 - 
getSourceScopepublic java.lang.Object getSourceScope() Description copied from interface:SourceTrackerReturn the domain-dependent scope of this instance within its file.- Specified by:
- getSourceScopein interface- SourceTracker
 
 - 
getSourceTypepublic int getSourceType() Description copied from interface:SourceTrackerReturn the type of source.- Specified by:
- getSourceTypein interface- SourceTracker
 
 - 
setSourcepublic void setSource(java.io.File file, java.lang.Object scope, int srcType)
 - 
getResourceNamepublic java.lang.String 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 interface- SourceTracker
 
 - 
getLineNumberpublic int getLineNumber() Description copied from interface:SourceTrackerReturn the line number of the file at which this instance was parsed.- Specified by:
- getLineNumberin interface- SourceTracker
 
 - 
setLineNumberpublic void setLineNumber(int lineNum) 
 - 
getColNumberpublic 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 interface- SourceTracker
 
 - 
setColNumberpublic void setColNumber(int colNum) 
 
- 
 
-