|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jodd.db.orm.sqlgen.chunks.SqlChunk
public abstract class SqlChunk
Sql chunk generates part of SQL query.
Field Summary | |
---|---|
static int |
COLS_ALL
Marker for using all available columns. |
static int |
COLS_NA
|
static int |
COLS_ONLY_EXISTING
Marker for using only existing columns i.e. that are not-null. |
static int |
COLS_ONLY_IDS
Marker for using only identity columns. |
protected boolean |
isColumnChunk
|
protected boolean |
isJoinOnChunk
|
protected boolean |
isTableChunk
|
protected SqlChunk |
nextChunk
|
protected SqlChunk |
previousChunk
|
protected java.lang.StringBuilder |
query
|
protected DbSqlBuilder |
sqlBuilder
|
Constructor Summary | |
---|---|
SqlChunk()
|
Method Summary | |
---|---|
protected void |
defineParameter(java.lang.StringBuilder query,
java.lang.String name,
java.lang.Object value)
Defines parameter with name and its value. |
SqlChunk |
getNextChunk()
Returns next chunk. |
SqlChunk |
getPreviousChunk()
Returns previous chunk. |
void |
init(DbSqlBuilder sqlBuilder)
Initializes chunk. |
void |
insertChunkAfter(SqlChunk previous)
Appends chunk to previous one and maintaince the double-linked list. |
boolean |
isColumnChunk()
Returns true if this chunk is kind-of column chunk. |
boolean |
isJoinOnChunk()
Returns true if this chunk is kind-of join on chunk. |
boolean |
isTableChunk()
Returns true if this chunk is kind-of table chunk. |
protected DbEntityDescriptor |
lookupName(java.lang.String entityName)
Lookups for entity name and throws exception if entity name not found. |
protected DbEntityDescriptor |
lookupTableRef(java.lang.String tableRef)
Lookups for table reference and throws an exception if table reference not found. |
protected DbEntityDescriptor |
lookupType(java.lang.Class entity)
Lookups for entity name and throws an exception if entity type is invalid. |
abstract void |
process()
Process the chunk and prepares the output. |
java.lang.String |
render()
Returns processed output. |
protected java.lang.String |
resolveTableRef(java.lang.String tableRef)
Returns the real value for table reference. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int COLS_NA
public static final int COLS_ONLY_EXISTING
public static final int COLS_ONLY_IDS
public static final int COLS_ALL
protected SqlChunk previousChunk
protected SqlChunk nextChunk
protected DbSqlBuilder sqlBuilder
protected java.lang.StringBuilder query
protected boolean isTableChunk
protected boolean isJoinOnChunk
protected boolean isColumnChunk
Constructor Detail |
---|
public SqlChunk()
Method Detail |
---|
public SqlChunk getPreviousChunk()
public SqlChunk getNextChunk()
public void insertChunkAfter(SqlChunk previous)
public void init(DbSqlBuilder sqlBuilder)
DbSqlBuilder
instance
and creates new string builder for the result.
public abstract void process()
public java.lang.String render()
public boolean isTableChunk()
true
if this chunk is kind-of table chunk.
public boolean isColumnChunk()
true
if this chunk is kind-of column chunk.
public boolean isJoinOnChunk()
true
if this chunk is kind-of join on chunk.
protected DbEntityDescriptor lookupName(java.lang.String entityName)
protected DbEntityDescriptor lookupType(java.lang.Class entity)
protected DbEntityDescriptor lookupTableRef(java.lang.String tableRef)
protected java.lang.String resolveTableRef(java.lang.String tableRef)
protected void defineParameter(java.lang.StringBuilder query, java.lang.String name, java.lang.Object value)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |