|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ibatis.abator.internal.sqlmap.SqlMapGeneratorDefaultImpl
Field Summary | |
protected JavaModelGenerator |
javaModelGenerator
This is the java model generator associated with the current generation context. |
protected java.util.Map |
properties
Contains any properties passed in from the SqlMap configuration element. |
protected java.lang.String |
targetPackage
This is the target package from the SqlMap configuration element |
protected java.lang.String |
targetProject
This is the target project from the SqlMap configuration element |
protected java.util.List |
warnings
|
Constructor Summary | |
SqlMapGeneratorDefaultImpl()
Constructs an instance of SqlMapGeneratorDefaultImpl |
Method Summary | |
protected void |
addAttribute(java.lang.StringBuffer sb,
java.lang.String name,
java.lang.String value)
Utility method that adds an XML attribute to a StringBuffer. |
protected void |
addQuotedString(java.lang.StringBuffer sb,
java.lang.String value,
boolean spaceBefore)
Utility method . |
protected java.lang.String |
formatLongString(java.lang.String s,
int maxLineLength,
int indentLevel)
Utility method. |
protected java.lang.String |
getBaseResultMapElement(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration,
int indentLevel)
This method should return a String which is formatted XML for the result map (without any BLOBs if they exist in the table). |
protected java.lang.String |
getByExampleWhereClauseFragment(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration,
int indentLevel)
This method should return well formatted XML for the example where clause SQL fragment (an sql fragment). |
protected java.lang.String |
getDeleteByExample(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration,
int indentLevel)
This method should return well formatted XML for the delete by example statement. |
java.lang.String |
getDeleteByExampleStatementId()
|
protected java.lang.String |
getDeleteByPrimaryKey(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration,
int indentLevel)
This method should return well formatted XML for the delete by primary key statement. |
java.lang.String |
getDeleteByPrimaryKeyStatementId()
|
protected java.lang.String |
getDocType()
Creates the DOCTYPE for the SqlMap |
protected java.lang.String |
getElementComment(int indentLevel)
Returns a suitable comment to warn users that the element was generated, and when it was generated. |
protected java.lang.String |
getExampleWhereClauseId()
Calculates the name of the example where clause element |
protected java.lang.String |
getFileComment(TableConfiguration tableConfiguration)
Returns a file level comment. |
java.util.List |
getGeneratedXMLFiles(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration,
ProgressCallback callback)
|
protected java.lang.String |
getInsertElement(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration,
int indentLevel)
This method should return a String which is formatted XML for the insert statement. |
java.lang.String |
getInsertStatementId()
|
protected java.lang.String |
getResultMapName(FullyQualifiedTable table)
Calculates the name of the result map. |
protected java.lang.String |
getResultMapWithBLOBsElement(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration,
int indentLevel)
This method should return a String which is formatted XML for the result map (with any BLOBs if they exist in the table). |
protected java.lang.String |
getSelectByExample(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration,
int indentLevel)
This method should return well formatted XML for the select by example statement that returns all fields in the table (except BLOB fields). |
java.lang.String |
getSelectByExampleStatementId()
|
protected java.lang.String |
getSelectByExampleWithBLOBs(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration,
int indentLevel)
This method should return well formatted XML for the select by example statement that returns all fields in the table (including BLOB fields). |
java.lang.String |
getSelectByExampleWithBLOBsStatementId()
|
protected java.lang.String |
getSelectByPrimaryKey(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration,
int indentLevel)
This method should return well formatted XML for the select by primary key statement. |
java.lang.String |
getSelectByPrimaryKeyStatementId()
|
protected java.lang.String |
getSelectKey(ColumnDefinition columnDefinition,
TableConfiguration tableConfiguration,
int indentLevel)
This method should return well formatted XML for the select key element used to automatically generate keys. |
protected GeneratedXmlFile |
getSqlMap(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration)
Creates the default implementation of the Sql Map |
protected java.lang.String |
getSqlMapElement(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration)
Creates the sqlMap element (the root element, and all child elements). |
protected java.lang.String |
getSqlMapFileName(FullyQualifiedTable table)
Calculates a file name for the current table. |
java.lang.String |
getSqlMapNamespace(FullyQualifiedTable table)
|
protected java.lang.String |
getSqlMapPackage(FullyQualifiedTable table)
Calculates the package for the current table. |
protected java.lang.String |
getUpdateByPrimaryKey(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration,
int indentLevel)
This method should return well formatted XML for the update by primary key statement that updates all fields in the table (excluding BLOB fields). |
java.lang.String |
getUpdateByPrimaryKeyStatementId()
|
protected java.lang.String |
getUpdateByPrimaryKeyWithBLOBs(ColumnDefinitions columnDefinitions,
TableConfiguration tableConfiguration,
int indentLevel)
This method should return well formatted XML for the update by primary key statement that updates all fields in the table (including BLOB fields). |
java.lang.String |
getUpdateByPrimaryKeyWithBLOBsStatementId()
|
protected void |
indent(java.lang.StringBuffer sb,
int indentLevel)
Utility method that indents the buffer by the default amount (two spaces per indent level). |
protected void |
newLine(java.lang.StringBuffer sb)
Utility method. |
void |
setJavaModelGenerator(JavaModelGenerator javaModelGenerator)
|
void |
setProperties(java.util.Map properties)
|
void |
setTargetPackage(java.lang.String targetPackage)
|
void |
setTargetProject(java.lang.String targetProject)
|
void |
setWarnings(java.util.List warnings)
Abator will supply a list to this method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.List warnings
protected java.util.Map properties
protected java.lang.String targetPackage
protected java.lang.String targetProject
protected JavaModelGenerator javaModelGenerator
Constructor Detail |
public SqlMapGeneratorDefaultImpl()
Method Detail |
public void setProperties(java.util.Map properties)
setProperties
in interface SqlMapGenerator
public void setTargetPackage(java.lang.String targetPackage)
setTargetPackage
in interface SqlMapGenerator
public void setJavaModelGenerator(JavaModelGenerator javaModelGenerator)
setJavaModelGenerator
in interface SqlMapGenerator
public java.util.List getGeneratedXMLFiles(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, ProgressCallback callback)
getGeneratedXMLFiles
in interface SqlMapGenerator
protected GeneratedXmlFile getSqlMap(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration)
columnDefinitions
- introspected column definitions for the current tabletableConfiguration
- table configuration for the current table
protected java.lang.String getDocType()
protected java.lang.String getSqlMapElement(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration)
columnDefinitions
- introspected column definitions for the current tabletableConfiguration
- table configuration for the current table
protected java.lang.String getFileComment(TableConfiguration tableConfiguration)
tableConfiguration
- table configuration for the current table
protected java.lang.String getElementComment(int indentLevel)
indentLevel
- the required indent level
protected java.lang.String getBaseResultMapElement(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, int indentLevel)
columnDefinitions
- introspected column definitions for the current tabletableConfiguration
- table configuration for the current tableindentLevel
- the required indent level
protected java.lang.String getResultMapWithBLOBsElement(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, int indentLevel)
columnDefinitions
- introspected column definitions for the current tabletableConfiguration
- table configuration for the current tableindentLevel
- the required indent level
protected java.lang.String getInsertElement(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, int indentLevel)
columnDefinitions
- introspected column definitions for the current tabletableConfiguration
- table configuration for the current tableindentLevel
- the required indent level
protected java.lang.String getUpdateByPrimaryKeyWithBLOBs(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, int indentLevel)
columnDefinitions
- introspected column definitions for the current tabletableConfiguration
- table configuration for the current tableindentLevel
- the required indent level
protected java.lang.String getUpdateByPrimaryKey(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, int indentLevel)
columnDefinitions
- introspected column definitions for the current tabletableConfiguration
- table configuration for the current tableindentLevel
- the required indent level
protected java.lang.String getDeleteByPrimaryKey(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, int indentLevel)
columnDefinitions
- introspected column definitions for the current tabletableConfiguration
- table configuration for the current tableindentLevel
- the required indent level
protected java.lang.String getDeleteByExample(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, int indentLevel)
columnDefinitions
- introspected column definitions for the current tabletableConfiguration
- table configuration for the current tableindentLevel
- the required indent level
protected java.lang.String getSelectByPrimaryKey(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, int indentLevel)
columnDefinitions
- introspected column definitions for the current tabletableConfiguration
- table configuration for the current tableindentLevel
- the required indent level
protected void indent(java.lang.StringBuffer sb, int indentLevel)
sb
- a StringBuffer to append toindentLevel
- the required indent levelprotected void addAttribute(java.lang.StringBuffer sb, java.lang.String name, java.lang.String value)
sb
- the StringBuffer to append toname
- the name of the attributevalue
- the value of the attribute (this method will add the enclosing
quotation marks automatically)protected void addQuotedString(java.lang.StringBuffer sb, java.lang.String value, boolean spaceBefore)
sb
- the StringBuffer to append tovalue
- the value to append (the value will be surrounded by quotation
marks by this method)spaceBefore
- if true, a space will be added before the valueprotected void newLine(java.lang.StringBuffer sb)
sb
- the StringBuffer to be appended toprotected java.lang.String formatLongString(java.lang.String s, int maxLineLength, int indentLevel)
s
- the String to be formattedmaxLineLength
- the maximum line lengthindentLevel
- the required indent level of all lines
protected java.lang.String getSelectKey(ColumnDefinition columnDefinition, TableConfiguration tableConfiguration, int indentLevel)
columnDefinition
- the column related to the select key statementtableConfiguration
- table configuration for the current tableindentLevel
- the required indent level
public java.lang.String getSqlMapNamespace(FullyQualifiedTable table)
getSqlMapNamespace
in interface SqlMapGenerator
protected java.lang.String getResultMapName(FullyQualifiedTable table)
table
- the current table
protected java.lang.String getSqlMapFileName(FullyQualifiedTable table)
table
- the current table
public java.lang.String getDeleteByPrimaryKeyStatementId()
getDeleteByPrimaryKeyStatementId
in interface SqlMapGenerator
public java.lang.String getDeleteByExampleStatementId()
getDeleteByExampleStatementId
in interface SqlMapGenerator
public java.lang.String getInsertStatementId()
getInsertStatementId
in interface SqlMapGenerator
public java.lang.String getSelectByPrimaryKeyStatementId()
getSelectByPrimaryKeyStatementId
in interface SqlMapGenerator
public java.lang.String getSelectByExampleStatementId()
getSelectByExampleStatementId
in interface SqlMapGenerator
public java.lang.String getSelectByExampleWithBLOBsStatementId()
getSelectByExampleWithBLOBsStatementId
in interface SqlMapGenerator
public java.lang.String getUpdateByPrimaryKeyWithBLOBsStatementId()
getUpdateByPrimaryKeyWithBLOBsStatementId
in interface SqlMapGenerator
public java.lang.String getUpdateByPrimaryKeyStatementId()
getUpdateByPrimaryKeyStatementId
in interface SqlMapGenerator
protected java.lang.String getSqlMapPackage(FullyQualifiedTable table)
table
- the current table
protected java.lang.String getExampleWhereClauseId()
protected java.lang.String getByExampleWhereClauseFragment(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, int indentLevel)
columnDefinitions
- introspected column definitions for the current tabletableConfiguration
- table configuration for the current tableindentLevel
- the required indent level
protected java.lang.String getSelectByExample(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, int indentLevel)
columnDefinitions
- introspected column definitions for the current tabletableConfiguration
- table configuration for the current tableindentLevel
- the required indent level
protected java.lang.String getSelectByExampleWithBLOBs(ColumnDefinitions columnDefinitions, TableConfiguration tableConfiguration, int indentLevel)
columnDefinitions
- introspected column definitions for the current tabletableConfiguration
- table configuration for the current tableindentLevel
- the required indent level
public void setTargetProject(java.lang.String targetProject)
setTargetProject
in interface SqlMapGenerator
public void setWarnings(java.util.List warnings)
SqlMapGenerator
setWarnings
in interface SqlMapGenerator
warnings
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |