Class QueryImpl
- java.lang.Object
-
- com.healthmarketscience.jackcess.impl.query.QueryImpl
-
- All Implemented Interfaces:
PropertyMaps.Owner,Query
- Direct Known Subclasses:
BaseSelectQueryImpl,DataDefinitionQueryImpl,PassthroughQueryImpl,UnionQueryImpl,UpdateQueryImpl
public abstract class QueryImpl extends Object implements Query, PropertyMaps.Owner
Base class for classes which encapsulate information about an Access query. ThetoSQLString()method can be used to convert this object into the actual SQL string which this query data represents.- Author:
- James Ahlborn
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classQueryImpl.RowStruct containing the information from a single row of the system query table.-
Nested classes/interfaces inherited from interface com.healthmarketscience.jackcess.query.Query
Query.Type
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static QueryImplcreate(int objectFlag, String name, List<QueryImpl.Row> rows, int objectId)Creates a concrete Query instance from the given query data alone, for tests of the sql it generates.static QueryImplcreate(DatabaseImpl database, int objectFlag, String name, List<QueryImpl.Row> rows, int objectId)Creates a concrete Query instance from the given query data.StringgetName()Returns the name of the query.QueryNameMapImplgetNameMap()intgetObjectFlag()intgetObjectId()Returns the unique object id of the query.StringgetOwnerAccessType()List<String>getParameters()Returns the rows from the system query table from which the query information was derived.PropertyMapgetProperties()PropertyMapsgetPropertyMaps()List<QueryImpl.Row>getRows()Returns the rows from the system query table from which the query information was derived.Query.TypegetType()Returns the type of the query.QueryImpl.RowgetTypeRow()booleanisHidden()Whether or not this query has been marked as hidden.voidpropertiesUpdated()Invoked when new properties are saved.StringtoSQLString()Returns the actual SQL string which this query data represents.StringtoString()
-
-
-
Method Detail
-
getName
public String getName()
Returns the name of the query.
-
getType
public Query.Type getType()
Returns the type of the query.
-
isHidden
public boolean isHidden()
Description copied from interface:QueryWhether or not this query has been marked as hidden.
-
getObjectId
public int getObjectId()
Returns the unique object id of the query.- Specified by:
getObjectIdin interfaceQuery
-
getObjectFlag
public int getObjectFlag()
- Specified by:
getObjectFlagin interfaceQuery
-
getProperties
public PropertyMap getProperties() throws IOException
- Specified by:
getPropertiesin interfaceQuery- Returns:
- the properties for this query
- Throws:
IOException
-
getPropertyMaps
public PropertyMaps getPropertyMaps() throws IOException
- Returns:
- all PropertyMaps for this query (and its columns)
- Throws:
IOException- Usage:
- Advanced: This method is for advanced/internal use.
-
getNameMap
public QueryNameMapImpl getNameMap() throws IOException
- Specified by:
getNameMapin interfaceQuery- Returns:
- the name map for this query, which cannot be changed, or
nullif the query has none - Throws:
IOException
-
propertiesUpdated
public void propertiesUpdated() throws IOExceptionDescription copied from interface:PropertyMaps.OwnerInvoked when new properties are saved.- Specified by:
propertiesUpdatedin interfacePropertyMaps.Owner- Throws:
IOException
-
getRows
public List<QueryImpl.Row> getRows()
Returns the rows from the system query table from which the query information was derived.
-
getTypeRow
public QueryImpl.Row getTypeRow()
-
getParameters
public List<String> getParameters()
Description copied from interface:QueryReturns the rows from the system query table from which the query information was derived.- Specified by:
getParametersin interfaceQuery
-
getOwnerAccessType
public String getOwnerAccessType()
- Specified by:
getOwnerAccessTypein interfaceQuery
-
toSQLString
public String toSQLString()
Returns the actual SQL string which this query data represents.- Specified by:
toSQLStringin interfaceQuery
-
create
public static QueryImpl create(int objectFlag, String name, List<QueryImpl.Row> rows, int objectId)
Creates a concrete Query instance from the given query data alone, for tests of the sql it generates. The query has no database, so its properties cannot be read.- Parameters:
objectFlag- the flag indicating the type of the queryname- the name of the queryrows- the rows from the system query table containing the data describing this queryobjectId- the unique object id of this query- Returns:
- a Query instance for the given query data
-
create
public static QueryImpl create(DatabaseImpl database, int objectFlag, String name, List<QueryImpl.Row> rows, int objectId)
Creates a concrete Query instance from the given query data.- Parameters:
database- the database which holds the queryobjectFlag- the flag indicating the type of the queryname- the name of the queryrows- the rows from the system query table containing the data describing this queryobjectId- the unique object id of this query- Returns:
- a Query instance for the given query data
-
-