|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.outerj.daisy.query.model.SqlGenerationContext
Context object used during the generation of SQL from a daisy query.
The main goal of this class is to keep track of which tables are required by the conditions, thus which tables will need to be joined in the "from" clause of the SQL statement. Next to that, it also contains constants for table and field names so that those aren't scattered around everywhere in the code.
Nested Class Summary | |
static class |
SqlGenerationContext.CustomFieldsTable
|
static class |
SqlGenerationContext.DocsCollectionsTable
Meta information about the association table between documents and collections. |
static class |
SqlGenerationContext.DocumentsTable
|
static class |
SqlGenerationContext.DocumentVariantsTable
|
static class |
SqlGenerationContext.ExtractedLinksTable
|
static class |
SqlGenerationContext.FieldsTable
|
static class |
SqlGenerationContext.FieldTypesTable
|
static class |
SqlGenerationContext.LocksTable
|
static class |
SqlGenerationContext.PartsTable
|
static class |
SqlGenerationContext.SummariesTable
|
static interface |
SqlGenerationContext.Table
|
static class |
SqlGenerationContext.VersionsTable
Meta information about the table containing version information. |
Field Summary | |
static SqlGenerationContext.ExtractedLinksTable |
EXTRACTED_LINKS_TABLE
|
static SqlGenerationContext.ExtractedLinksTable |
EXTRACTED_LINKS_TABLE_INVERSE
|
static SqlGenerationContext.LocksTable |
LOCKS_TABLE
|
static SqlGenerationContext.PartsTable |
PARTS_TABLE
|
static SqlGenerationContext.SummariesTable |
SUMMARIES_TABLE
|
static SqlGenerationContext.VersionsTable |
VERSIONS_TABLE
The association table between documents and collections |
Constructor Summary | |
SqlGenerationContext()
|
Method Summary | |
void |
appendDocIdSelectClause(java.lang.StringBuffer sql)
|
void |
appendFromClause(java.lang.StringBuffer sql,
boolean searchLastVersion)
Generates the SQL "from" expression based on the requested field table aliases (using getNewFieldsTableAlias() ) and joined tables
(see needsJoinWithTable(org.outerj.daisy.query.model.SqlGenerationContext.Table) ). |
int |
bindJoins(java.sql.PreparedStatement stmt,
int bindPos)
|
java.lang.String |
getNewAliasCounter()
|
java.lang.String |
getNewCollectionsTableAlias()
|
java.lang.String |
getNewCustomFieldsTableAlias()
|
java.lang.String |
getNewFieldsTableAlias()
Returns a new alias for a join with the "thefields" table, and adds a join with it. |
static java.lang.String |
getVersionField(boolean searchLastVersion)
|
void |
needsJoinWithTable(SqlGenerationContext.Table table)
Adds a table to join with. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final SqlGenerationContext.VersionsTable VERSIONS_TABLE
public static final SqlGenerationContext.ExtractedLinksTable EXTRACTED_LINKS_TABLE
public static final SqlGenerationContext.ExtractedLinksTable EXTRACTED_LINKS_TABLE_INVERSE
public static final SqlGenerationContext.SummariesTable SUMMARIES_TABLE
public static final SqlGenerationContext.PartsTable PARTS_TABLE
public static final SqlGenerationContext.LocksTable LOCKS_TABLE
Constructor Detail |
public SqlGenerationContext()
Method Detail |
public java.lang.String getNewAliasCounter()
public java.lang.String getNewFieldsTableAlias()
public java.lang.String getNewCollectionsTableAlias()
public java.lang.String getNewCustomFieldsTableAlias()
public void needsJoinWithTable(SqlGenerationContext.Table table)
public void appendDocIdSelectClause(java.lang.StringBuffer sql)
public int bindJoins(java.sql.PreparedStatement stmt, int bindPos) throws java.sql.SQLException
java.sql.SQLException
public void appendFromClause(java.lang.StringBuffer sql, boolean searchLastVersion)
getNewFieldsTableAlias()
) and joined tables
(see needsJoinWithTable(org.outerj.daisy.query.model.SqlGenerationContext.Table)
).
The documents table is always included.
public static java.lang.String getVersionField(boolean searchLastVersion)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |