001: /**
002: * Objective Database Abstraction Layer (ODAL)
003: * Copyright (c) 2004, The ODAL Development Group
004: * All rights reserved.
005: * For definition of the ODAL Development Group please refer to LICENCE.txt file
006: *
007: * Distributable under LGPL license.
008: * See terms of license at gnu.org.
009: */package com.completex.objective.components.persistency;
010:
011: import com.completex.objective.components.persistency.core.DatabasePolicy;
012:
013: import java.util.List;
014: import java.util.LinkedHashMap;
015:
016: /**
017: * Query controller
018: *
019: * @author Gennady Krizhevsky
020: */
021: public interface QueryCtl extends Query, ResultableQueryManager {
022:
023: /**
024: *
025: * @return Persistency used
026: */
027: Persistency getPersistency();
028:
029: /**
030: * Return DatabasePolicy used
031: *
032: * @return DatabasePolicy used
033: */
034: DatabasePolicy getDatabasePolicy();
035:
036: /**
037: * Returns QueryFactoryCtl that created this instance
038: *
039: * @param parentQueryFactory
040: */
041: void setParentQueryFactory(QueryFactoryCtl parentQueryFactory);
042:
043: /**
044: * Marks query as "count" one
045: *
046: * @param count
047: */
048: void setCount(boolean count);
049:
050: /**
051: * Indicates that query as must not be cached
052: *
053: * @param bypassCache
054: */
055: void setBypassCache(boolean bypassCache);
056:
057: /**
058: * Returns true if query as must not be cached
059: *
060: * @return true if query as must not be cached
061: */
062: boolean isBypassCache();
063:
064: /**
065: *
066: * @return QueryDefinition of this query
067: */
068: QueryDefinition getQueryDefinition();
069:
070: /**
071: * Returns list of sub-query parameters. If this is not a UNION query
072: * array will have 0-length
073: *
074: * @return <code>List</code> of <code>Parameters</code> of UNION sub-queries
075: * @see Parameters
076: * @see com.completex.objective.components.persistency.core.Union
077: */
078: List collectInnerUnionParameters(QueryCtl queryCtl,
079: List parametersList, boolean addParent);
080:
081: /**
082: *
083: * @return List of UNION sub-queries. If this is not a UNION query
084: * array will have 0-length
085: */
086: List getInnerUnionQueries();
087:
088: /**
089: *
090: * @return QueryFactoryCtl that created this intance
091: */
092: QueryFactoryCtl getParentQueryFactory();
093:
094: /**
095: * Ad-hoc query is one that has
096: * <code>join == null && from == null && singularResultFactory == null</code>
097: *
098: * @return true if this is ad-hoc query
099: */
100: boolean isAdHoc();
101:
102: //
103: // InlineQuery:
104: //
105:
106: /**
107: * Experimental
108: */
109: Query getInlineQuery();
110:
111: void setInlineQuery(QueryCtl inlineQuery);
112:
113: boolean isInlined();
114:
115: boolean hasInlineQuery();
116:
117: int getLastAliasIndex();
118:
119: void setLastAliasIndex(int i);
120:
121: QueryCtl getCombinedInlineQuery();
122:
123: void setCombinedInlineQuery(QueryCtl inlineRootQuery);
124:
125: void setChildren(LinkedHashMap children);
126:
127: void setParent(QueryCtl parent);
128:
129: QueryCtl getParent();
130:
131: boolean isCombinedInline();
132:
133: void setCombinedInline();
134:
135: boolean hasCombinedInlineQuery();
136:
137: /**
138: *
139: * @return inlineLinks
140: */
141: Link[] inlineLinks();
142:
143: QueryCtl resolveQueryToExecute();
144:
145: }
|