jodd.db.orm.sqlgen.chunks
Class TableChunk

java.lang.Object
  extended by jodd.db.orm.sqlgen.chunks.SqlChunk
      extended by jodd.db.orm.sqlgen.chunks.TableChunk
All Implemented Interfaces:
java.lang.Cloneable

public class TableChunk
extends SqlChunk

Table chunk resolves table name, optional table alias and defines table references.

If previous chunk is also a table, comma separator will be added between two table definitions, otherwise, regular space will be added if needed to separate from previous chunk.

Tables must be processed first, before all other chunks processing, since other chunks depends on it.


Field Summary
protected  DbEntityDescriptor ded
           
protected  java.lang.Class entity
           
protected  java.lang.String entityName
           
protected  java.lang.String tableAlias
           
 
Fields inherited from class jodd.db.orm.sqlgen.chunks.SqlChunk
CHUNK_INSERT, CHUNK_MATCH, CHUNK_RAW, CHUNK_REFERENCE, CHUNK_SELECT_COLUMNS, CHUNK_TABLE, CHUNK_UPDATE, CHUNK_VALUE, chunkType, COLS_ALL, COLS_NA, COLS_ONLY_EXISTING, COLS_ONLY_IDS, nextChunk, previousChunk, templateData
 
Constructor Summary
protected TableChunk(java.lang.Class entity, java.lang.String entityName, java.lang.String tableAlias)
           
  TableChunk(java.lang.Object entity)
           
  TableChunk(java.lang.Object entity, java.lang.String alias)
           
  TableChunk(java.lang.String tableRef)
           
  TableChunk(java.lang.String entityName, java.lang.String alias)
           
 
Method Summary
 SqlChunk clone()
          Clones all parsed chunk data to an instance that is ready for processing.
 void init(TemplateData templateData)
          Resolves and registers table references.
 void process(java.lang.StringBuilder out)
          Process the chunk and appends data to the output.
 
Methods inherited from class jodd.db.orm.sqlgen.chunks.SqlChunk
appendMissingSpace, defineParameter, getNextChunk, getPreviousChunk, insertChunkAfter, isPreviousChunkOfSameType, isPreviousChunkOfType, isPreviousMacroChunk, isPreviousRawChunk, lookupName, lookupTableRef, lookupType, resolveClass, resolveTable, separateByCommaOrSpace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entity

protected final java.lang.Class entity

entityName

protected final java.lang.String entityName

tableAlias

protected final java.lang.String tableAlias

ded

protected DbEntityDescriptor ded
Constructor Detail

TableChunk

public TableChunk(java.lang.Object entity)

TableChunk

public TableChunk(java.lang.Object entity,
                  java.lang.String alias)

TableChunk

public TableChunk(java.lang.String entityName,
                  java.lang.String alias)

TableChunk

protected TableChunk(java.lang.Class entity,
                     java.lang.String entityName,
                     java.lang.String tableAlias)

TableChunk

public TableChunk(java.lang.String tableRef)
Method Detail

init

public void init(TemplateData templateData)
Resolves and registers table references.

Overrides:
init in class SqlChunk

process

public void process(java.lang.StringBuilder out)
Description copied from class: SqlChunk
Process the chunk and appends data to the output.

Specified by:
process in class SqlChunk

clone

public SqlChunk clone()
Description copied from class: SqlChunk
Clones all parsed chunk data to an instance that is ready for processing.

Specified by:
clone in class SqlChunk


Copyright © 2003-2011 Jodd Team