Package org.apache.openjpa.meta
Class QueryMetaData
- java.lang.Object
- 
- org.apache.openjpa.meta.QueryMetaData
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- SourceTracker,- Commentable,- MetaDataModes
 - Direct Known Subclasses:
- MultiQueryMetaData
 
 public class QueryMetaData extends java.lang.Object implements MetaDataModes, SourceTracker, Commentable, java.io.Serializable Holds metadata about named queries. Information stored in this instance gets transfered to newQueryinstances.- Author:
- Steve Kim
- See Also:
- Serialized Form
 
- 
- 
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
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedQueryMetaData(java.lang.String name, boolean convertPositionalParametersToNamed)Construct with the given name.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHint(java.lang.String key, java.lang.Object value)Add a query hint.java.lang.ClassgetCandidateType()The query candidate class, or null if none.intgetColNumber()Return the column number in the line of the file at which this instance was parsed.java.lang.String[]getComments()Return comments, or empty array if none.java.lang.ClassgetDefiningType()The class that defines this query, or null if none.java.lang.String[]getHintKeys()Query hints.java.lang.Object[]getHintValues()Query hints.java.lang.StringgetLanguage()Return the query language.intgetLineNumber()Return the line number of the file at which this instance was parsed.java.lang.StringgetName()Return the name for this query.OrderedMap<java.lang.Object,java.lang.Class<?>>getParamTypes()java.lang.StringgetQueryString()The full query string, or null if none.java.lang.StringgetResourceName()Return the domain-meaningful name of the resource that was loaded from this source.java.lang.StringgetResultSetMappingName()java.lang.ClassgetResultType()The query result class, or null if none.java.io.FilegetSourceFile()Return the file from which this instance was parsed.intgetSourceMode()The source mode of this query.java.lang.StringgetSourceName()java.lang.ObjectgetSourceScope()Return the domain-dependent scope of this instance within its file.intgetSourceType()Return the type of source.booleanisReadOnly()Whether the query has been marked read-only.voidsetCandidateType(java.lang.Class cls)The query result class, or null if none.voidsetColNumber(int colNum)voidsetComments(java.lang.String[] comments)Set comments.voidsetDefiningType(java.lang.Class cls)The class that defines this query, or null if none.voidsetFrom(Query query)Initialize this instance from the values held in the specifiedQuery.voidsetInto(Query query)Set query template information into the given concrete query instance.voidsetLanguage(java.lang.String language)Set the language for this query.voidsetLineNumber(int lineNum)voidsetParamTypes(OrderedMap<java.lang.Object,java.lang.Class<?>> paramTypes)voidsetQueryString(java.lang.String query)The full query string, or null if none.voidsetReadOnly(boolean readOnly)Whether the query has been marked read-only.voidsetResultSetMappingName(java.lang.String setMappingName)voidsetResultType(java.lang.Class cls)The query result class, or null if none.voidsetSource(java.io.File file, java.lang.Object scope, int srcType, java.lang.String srcName)voidsetSourceMode(int mode)The source mode of this query.java.lang.StringtoString()
 
- 
- 
- 
Method Detail- 
getNamepublic java.lang.String getName() Return the name for this query.
 - 
getDefiningTypepublic java.lang.Class getDefiningType() The class that defines this query, or null if none.
 - 
setDefiningTypepublic void setDefiningType(java.lang.Class cls) The class that defines this query, or null if none.
 - 
isReadOnlypublic boolean isReadOnly() Whether the query has been marked read-only.
 - 
setReadOnlypublic void setReadOnly(boolean readOnly) Whether the query has been marked read-only.
 - 
getCandidateTypepublic java.lang.Class getCandidateType() The query candidate class, or null if none.
 - 
setCandidateTypepublic void setCandidateType(java.lang.Class cls) The query result class, or null if none.
 - 
getResultTypepublic java.lang.Class getResultType() The query result class, or null if none.
 - 
setResultTypepublic void setResultType(java.lang.Class cls) The query result class, or null if none.
 - 
getLanguagepublic java.lang.String getLanguage() Return the query language.
 - 
setLanguagepublic void setLanguage(java.lang.String language) Set the language for this query.
 - 
getQueryStringpublic java.lang.String getQueryString() The full query string, or null if none.
 - 
setQueryStringpublic void setQueryString(java.lang.String query) The full query string, or null if none.
 - 
getHintKeyspublic java.lang.String[] getHintKeys() Query hints.
 - 
getHintValuespublic java.lang.Object[] getHintValues() Query hints.
 - 
addHintpublic void addHint(java.lang.String key, java.lang.Object value)Add a query hint.
 - 
getResultSetMappingNamepublic java.lang.String getResultSetMappingName() 
 - 
setResultSetMappingNamepublic void setResultSetMappingName(java.lang.String setMappingName) 
 - 
setIntopublic void setInto(Query query) Set query template information into the given concrete query instance. However, the language, query string, and candidate class are assumed to be declared in the query instantiation, and hints are not transferred.
 - 
setFrompublic void setFrom(Query query) Initialize this instance from the values held in the specifiedQuery.
 - 
getSourceModepublic int getSourceMode() The source mode of this query.
 - 
setSourceModepublic void setSourceMode(int mode) The source mode of this query.
 - 
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, java.lang.String srcName)
 - 
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) 
 - 
getSourceNamepublic java.lang.String getSourceName() 
 - 
setParamTypespublic void setParamTypes(OrderedMap<java.lang.Object,java.lang.Class<?>> paramTypes) 
 - 
getParamTypespublic OrderedMap<java.lang.Object,java.lang.Class<?>> getParamTypes() - Returns:
- a map of parameter name to type for this named query or null if this data hasn't been set.
 
 
- 
 
-