org.apache.openjpa.jdbc.meta
Class QueryResultMapping

java.lang.Object
  extended by org.apache.openjpa.jdbc.meta.QueryResultMapping
All Implemented Interfaces:
org.apache.openjpa.lib.meta.SourceTracker, org.apache.openjpa.lib.xml.Commentable, MetaDataModes

public class QueryResultMapping
extends Object
implements MetaDataModes, org.apache.openjpa.lib.meta.SourceTracker, org.apache.openjpa.lib.xml.Commentable

Mapping of a query result set to scalar and/or persistence-capable object-level values.

Author:
Pinaki Poddar, Abe White

Nested Class Summary
 class QueryResultMapping.PCResult
          A persistence-capable result.
 
Field Summary
 
Fields inherited from interface org.apache.openjpa.meta.MetaDataModes
MODE_ALL, MODE_ANN_MAPPING, MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERY
 
Fields inherited from interface org.apache.openjpa.lib.meta.SourceTracker
SRC_ANNOTATIONS, SRC_OTHER, SRC_XML
 
Fields inherited from interface org.apache.openjpa.lib.xml.Commentable
EMPTY_COMMENTS
 
Method Summary
 void addColumnResult(Object id)
          Add the id of a mapped column in the query result.
 QueryResultMapping.PCResult addPCResult(Class candidate)
          Add a mapped persistence-capable result with the given candidate type.
 int getColNumber()
           
 Object[] getColumnResults()
          Ids of mapped scalar columns in the result.
 String[] getComments()
           
 Class getDefiningType()
          The class that defines this query result, or null if none.
 int getLineNumber()
           
 int getListingIndex()
          Relative order of result mapping in metadata.
 String getName()
          Return the name for this query result.
 QueryResultMapping.PCResult[] getPCResults()
          Return the mapped persistence-capable types in the query result.
 String getResourceName()
           
 File getSourceFile()
           
 int getSourceMode()
          The source mode of this query result.
 Object getSourceScope()
           
 int getSourceType()
           
 void setColNumber(int colNum)
           
 void setComments(String[] comments)
           
 void setDefiningType(Class cls)
          The class that defines this query result, or null if none.
 void setLineNumber(int lineNum)
           
 void setListingIndex(int idx)
          Relative order of result mapping in metadata.
 void setSource(File file, Object scope, int srcType)
           
 void setSourceMode(int mode)
          The source mode of this query result.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getName

public String getName()
Return the name for this query result.


getDefiningType

public Class getDefiningType()
The class that defines this query result, or null if none.


setDefiningType

public void setDefiningType(Class cls)
The class that defines this query result, or null if none.


getColumnResults

public Object[] getColumnResults()
Ids of mapped scalar columns in the result. These will typically be column names.

See Also:
Result

addColumnResult

public void addColumnResult(Object id)
Add the id of a mapped column in the query result. This will typically be a column name.

See Also:
Result

getPCResults

public QueryResultMapping.PCResult[] getPCResults()
Return the mapped persistence-capable types in the query result.


addPCResult

public QueryResultMapping.PCResult addPCResult(Class candidate)
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

public String toString()
Overrides:
toString in class Object

getComments

public String[] getComments()
Specified by:
getComments in interface org.apache.openjpa.lib.xml.Commentable

setComments

public void setComments(String[] comments)
Specified by:
setComments in interface org.apache.openjpa.lib.xml.Commentable

getSourceFile

public File getSourceFile()
Specified by:
getSourceFile in interface org.apache.openjpa.lib.meta.SourceTracker

getSourceScope

public Object getSourceScope()
Specified by:
getSourceScope in interface org.apache.openjpa.lib.meta.SourceTracker

getSourceType

public int getSourceType()
Specified by:
getSourceType in interface org.apache.openjpa.lib.meta.SourceTracker

setSource

public void setSource(File file,
                      Object scope,
                      int srcType)

getResourceName

public String getResourceName()
Specified by:
getResourceName in interface org.apache.openjpa.lib.meta.SourceTracker

getLineNumber

public int getLineNumber()
Specified by:
getLineNumber in interface org.apache.openjpa.lib.meta.SourceTracker

setLineNumber

public void setLineNumber(int lineNum)

getColNumber

public int getColNumber()
Specified by:
getColNumber in interface org.apache.openjpa.lib.meta.SourceTracker

setColNumber

public void setColNumber(int colNum)


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.