Class QueryProcessor
- java.lang.Object
-
- net.ontopia.topicmaps.query.impl.rdbms.QueryProcessor
-
- All Implemented Interfaces:
QueryProcessorIF
public class QueryProcessor extends Object implements QueryProcessorIF
INTERNAL: This is the front-end to the RDBMS-specific query processor.
-
-
Field Summary
Fields Modifier and Type Field Description protected RDBMSAccessaccessprotected LocatorIFbaseprotected QueryProcessorbprocessorprotected RDBMSMappingmappingprotected TologParserparserprotected PredicateFactoryIFpredicateFactoryprotected TopicMapIFtopicmapprotected TransactionIFtxn
-
Constructor Summary
Constructors Constructor Description QueryProcessor(TopicMapIF topicmap)QueryProcessor(TopicMapIF topicmap, LocatorIF base)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryResultIFexecute(String query)PUBLIC: Parses and executes the query, returning the results.QueryResultIFexecute(String query, Map arguments)PUBLIC: Parses and executes the query binding the parameters in the query to the values given in the 'arguments' map, returning the results.QueryResultIFexecute(String query, Map arguments, DeclarationContextIF context)PUBLIC: Parses and executes the query in the given context binding the parameters in the query to the values given in the 'arguments' map, returning the results.QueryResultIFexecute(String query, DeclarationContextIF context)PUBLIC: Parses and executes the query in the given context, returning the results.QueryProcessorgetBasicQueryProcessor()ObjectRelationalMappingIFgetMapping()StringgetProperty(String name)TopicMapIFgetTopicMap()TransactionIFgetTransaction()voidload(Reader ruleset)DEPRECATED: Loads a set of rules into the query processor from a reader object.voidload(String ruleset)DEPRECATED: Loads a set of rules into the query processor from a string.ParsedQueryIFparse(String query)PUBLIC: Parses the query, returning an object representing the result.ParsedQueryIFparse(String query, DeclarationContextIF context)PUBLIC: Parses the query in the given context, returning an object representing the result.protected ParsedQueryparseQuery(String query, DeclarationContextIF context)ParsedModificationStatementIFparseUpdate(String statement)PUBLIC: Parses the update statement, returning an object representing the result.ParsedModificationStatementIFparseUpdate(String statement, DeclarationContextIF context)PUBLIC: Parses the update statement in the given context, returning an object representing the result.voidsetContext(DeclarationContextIF context)intupdate(String query)PUBLIC: Runs the update statement, returning the number of modified objects.intupdate(String query, Map<String,?> arguments)PUBLIC: Runs the update statement with the given parameters, returning the number of modified objects.intupdate(String query, Map<String,?> arguments, DeclarationContextIF context)PUBLIC: Runs the update statement in the given declaration context with the given parameters, returning the number of modified objects.intupdate(String query, DeclarationContextIF context)PUBLIC: Runs the update statement in the given declaration context, returning the number of modified objects.
-
-
-
Field Detail
-
predicateFactory
protected PredicateFactoryIF predicateFactory
-
topicmap
protected TopicMapIF topicmap
-
base
protected LocatorIF base
-
parser
protected TologParser parser
-
txn
protected TransactionIF txn
-
access
protected RDBMSAccess access
-
mapping
protected RDBMSMapping mapping
-
bprocessor
protected QueryProcessor bprocessor
-
-
Constructor Detail
-
QueryProcessor
public QueryProcessor(TopicMapIF topicmap)
-
QueryProcessor
public QueryProcessor(TopicMapIF topicmap, LocatorIF base)
-
-
Method Detail
-
execute
public QueryResultIF execute(String query) throws InvalidQueryException
Description copied from interface:QueryProcessorIFPUBLIC: Parses and executes the query, returning the results.- Specified by:
executein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
execute
public QueryResultIF execute(String query, DeclarationContextIF context) throws InvalidQueryException
Description copied from interface:QueryProcessorIFPUBLIC: Parses and executes the query in the given context, returning the results.- Specified by:
executein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
execute
public QueryResultIF execute(String query, Map arguments) throws InvalidQueryException
Description copied from interface:QueryProcessorIFPUBLIC: Parses and executes the query binding the parameters in the query to the values given in the 'arguments' map, returning the results.- Specified by:
executein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
execute
public QueryResultIF execute(String query, Map arguments, DeclarationContextIF context) throws InvalidQueryException
Description copied from interface:QueryProcessorIFPUBLIC: Parses and executes the query in the given context binding the parameters in the query to the values given in the 'arguments' map, returning the results.- Specified by:
executein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
update
public int update(String query)
Description copied from interface:QueryProcessorIFPUBLIC: Runs the update statement, returning the number of modified objects.- Specified by:
updatein interfaceQueryProcessorIF
-
update
public int update(String query, DeclarationContextIF context) throws InvalidQueryException
Description copied from interface:QueryProcessorIFPUBLIC: Runs the update statement in the given declaration context, returning the number of modified objects.- Specified by:
updatein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
update
public int update(String query, Map<String,?> arguments) throws InvalidQueryException
Description copied from interface:QueryProcessorIFPUBLIC: Runs the update statement with the given parameters, returning the number of modified objects.- Specified by:
updatein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
update
public int update(String query, Map<String,?> arguments, DeclarationContextIF context) throws InvalidQueryException
Description copied from interface:QueryProcessorIFPUBLIC: Runs the update statement in the given declaration context with the given parameters, returning the number of modified objects.- Specified by:
updatein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
parse
public ParsedQueryIF parse(String query) throws InvalidQueryException
Description copied from interface:QueryProcessorIFPUBLIC: Parses the query, returning an object representing the result.- Specified by:
parsein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
parse
public ParsedQueryIF parse(String query, DeclarationContextIF context) throws InvalidQueryException
Description copied from interface:QueryProcessorIFPUBLIC: Parses the query in the given context, returning an object representing the result.- Specified by:
parsein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
parseQuery
protected ParsedQuery parseQuery(String query, DeclarationContextIF context) throws InvalidQueryException
- Throws:
InvalidQueryException
-
parseUpdate
public ParsedModificationStatementIF parseUpdate(String statement) throws InvalidQueryException
Description copied from interface:QueryProcessorIFPUBLIC: Parses the update statement, returning an object representing the result.- Specified by:
parseUpdatein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
parseUpdate
public ParsedModificationStatementIF parseUpdate(String statement, DeclarationContextIF context) throws InvalidQueryException
Description copied from interface:QueryProcessorIFPUBLIC: Parses the update statement in the given context, returning an object representing the result.- Specified by:
parseUpdatein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
load
public void load(String ruleset) throws InvalidQueryException
Description copied from interface:QueryProcessorIFDEPRECATED: Loads a set of rules into the query processor from a string. The rules will then be available for use in queries throughout the lifetime of the current scope.- Specified by:
loadin interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
load
public void load(Reader ruleset) throws InvalidQueryException, IOException
Description copied from interface:QueryProcessorIFDEPRECATED: Loads a set of rules into the query processor from a reader object. The rules will then be available for use in queries throughout the lifetime of the current scope.- Specified by:
loadin interfaceQueryProcessorIF- Throws:
InvalidQueryExceptionIOException
-
setContext
public void setContext(DeclarationContextIF context)
-
getTopicMap
public TopicMapIF getTopicMap()
-
getTransaction
public TransactionIF getTransaction()
-
getMapping
public ObjectRelationalMappingIF getMapping()
-
getBasicQueryProcessor
public QueryProcessor getBasicQueryProcessor()
-
-