public class DbModelWurblet extends ModelWurblet
| Constructor and Description |
|---|
DbModelWurblet() |
| Modifier and Type | Method and Description |
|---|---|
String |
aas(String str)
Utility method to generate argument list.
|
String |
acs(String str,
String appendStr)
Adds a string to a comma separated list.
|
String |
as(String str)
Utility method to always get a non-null string.
|
void |
assertEntityIsPersistable()
Asserts that SQL statements can be executed for that entity.
|
String |
buildInvocationParameters()
Builds the string of invocation parameters.
|
String |
buildInvocationParameters(boolean limit,
boolean offset)
Builds the string of invocation parameters.
|
String |
buildMethodParameters()
Builds the string of method parameters.
|
String |
buildMethodParameters(boolean limit,
boolean offset)
Builds the string of method parameters.
|
String |
createJdbcGetterName(org.tentackle.model.Attribute attribute)
Creates the "getXXXX" method name for ResultSetWrapper.
|
String |
createJdbcSetterName(org.tentackle.model.Attribute attribute)
Creates the "setXXXX" method name for PreparedStatementWrapper.
|
String |
createOrderBy()
Creates the order by clause.
|
String |
createOrderBy(List<WurbletParameter> sortKeys)
Creates the order by clause.
|
String |
createRelationArgString(org.tentackle.model.Relation relation,
boolean select)
Creates the argument string for select- or delete statement of a relation.
|
String |
createRelationDeleteCode(org.tentackle.model.Relation relation)
Creates the java code to delete a relation.
|
String |
createRelationLinkCode(org.tentackle.model.Relation relation)
Creates the java code to set the link of a relation.
|
String |
createRelationSelectCode(org.tentackle.model.Relation relation)
Creates the java code to select a relation.
|
String |
createRelationSetFirstArgMethodName(org.tentackle.model.Relation relation)
Creates the set-first-arg method name (useful only in object relations).
|
String |
createRelationUpdateReferenceCode(org.tentackle.model.Relation relation)
Creates the java code to update the reference of a relation.
|
String |
createStatementId()
Creates the name of a statement id.
Because statement ids are final, the name is in uppercase. |
Set<ComponentJoin> |
getComponentJoins()
Gets the component joins.
|
org.tentackle.model.Attribute |
getContextAttribute()
Gets the context attribute.
|
List<org.tentackle.model.AttributeSorting> |
getDefaultSorting()
Goes up the inheritance tree until a default sorting is found.
|
List<WurbletParameter> |
getDefaultSortKeys()
Gets the default sorting keys.
|
List<org.tentackle.model.Relation> |
getEagerRelations()
The TT persistence layer provides an optimized select for a single eager relations via a Join.
|
String |
getJdbcCode(org.tentackle.model.Attribute attribute,
String modelCode)
Creates java code applicable to the JDBC layer from model variable access code.
Applies .toExternal() if attribute is an application specific type. |
org.tentackle.model.DataType |
getJdbcDataType(org.tentackle.model.Attribute attribute)
Gets the effective DataType used agains Tentackle's JDBC wrapper layer.
|
List<org.tentackle.model.Relation> |
getJoinedRelations()
Gets the non-component joined relations.
|
String |
getModelCode(org.tentackle.model.Attribute attribute,
String jdbcCode)
Creates java code applicable to the application model from JDBC variable access code.
Applies .toInternal() if attribute is an application specific type. |
List<String> |
getRelationArgs(org.tentackle.model.Relation relation,
boolean select)
Gets the relation arguments for delete or select methods.
|
boolean |
isAttracked()
Returns whether the entity is attracked or fulltracked.
|
boolean |
isClassIdRequiredInWhereClause()
Returns whether the classid needs to be inluded in the WHERE-clause.
|
boolean |
isClassIdRequiredInWhereClause(org.tentackle.model.Entity entity)
Returns whether the classid needs to be inluded in the WHERE-clause.
|
boolean |
isEntityPersistable()
Returns whether SQL statements can be executed for that entity.
|
boolean |
isFullTracked()
Returns whether the entity is fulltracked.
|
boolean |
isRelationTransient(org.tentackle.model.Relation relation)
Returns whether the relation is transient.
|
boolean |
isTracked()
Returns whether the entity is tracked.
|
boolean |
isWithDefaultSorting()
Returns whether default sorting is configured for the entity.
|
String |
pcs(String str,
String prependStr)
Prepends a string to a comma separated list.
|
void |
run()
Overridden to process some arguments.
|
appendCommaSeparated, createListRelationDeleteMethodName, createRelationSelectMethodName, deriveClassNameForEntity, getAllParameters, getArgs, getEntity, getExpression, getExpressionParameters, getExtraParameters, getJoins, getMethodName, getMethodParameters, getModelDirName, getModelName, getOption, getOptionArgs, getPdoClassName, getSortingParameters, isAttributeDerived, isContextIdAttributeValid, isGenerified, isIdAttribute, isIdOrSerialAttribute, isPartOfInheritanceHierarchy, isPdo, isRemote, isSerialAttribute, isSetGetRequired, isWithSorting, orderByInheritanceLevelAndClassId, prependCommaSeparated, setRemotepublic void run()
throws org.wurbelizer.wurbel.WurbelException
--context=<key> defines the context id (--context= turns off default context) --tracked return a TrackedArrayList instead of an ArrayList (if not [TRACKED] given in model) --attracked (same as tracked but generate is...Modified per attribute) --fulltracked (same as attracked but keep last persisted values as well) --untracked to disable [TRACKED, ATTRACKED or FULLTRACKED] from model --makevalidcontext sets the context from the object instead of context --makevalidcontext=- turns off the default makeValidContext --or use OR instead of AND for multiple keys
run in interface org.wurbelizer.wurblet.Wurbletrun in class ModelWurbletorg.wurbelizer.wurbel.WurbelException - if running the wurblet failedpublic boolean isTracked()
public boolean isAttracked()
public boolean isFullTracked()
public org.tentackle.model.Attribute getContextAttribute()
public boolean isClassIdRequiredInWhereClause(org.tentackle.model.Entity entity)
entity - the entitypublic boolean isClassIdRequiredInWhereClause()
public boolean isEntityPersistable()
public void assertEntityIsPersistable()
throws org.wurbelizer.wurbel.WurbelException
org.wurbelizer.wurbel.WurbelException - if notpublic List<org.tentackle.model.AttributeSorting> getDefaultSorting()
public List<WurbletParameter> getDefaultSortKeys()
public boolean isWithDefaultSorting()
public Set<ComponentJoin> getComponentJoins() throws org.wurbelizer.wurbel.WurbelException
org.wurbelizer.wurbel.WurbelException - if a join could not be createdpublic List<org.tentackle.model.Relation> getJoinedRelations()
public String createOrderBy(List<WurbletParameter> sortKeys) throws org.wurbelizer.wurbel.WurbelException
sortKeys - the sorting keysorg.wurbelizer.wurbel.WurbelException - if failedpublic String createOrderBy() throws org.wurbelizer.wurbel.WurbelException
org.wurbelizer.wurbel.WurbelException - if failedpublic String createStatementId() throws org.wurbelizer.wurbel.WurbelException
org.wurbelizer.wurbel.WurbelException - if guardname could not be determinedpublic String buildMethodParameters(boolean limit, boolean offset) throws org.wurbelizer.wurbel.WurbelException
limit - optional limit rowsoffset - optional skip rowsorg.wurbelizer.wurbel.WurbelException - if failedpublic String buildMethodParameters() throws org.wurbelizer.wurbel.WurbelException
org.wurbelizer.wurbel.WurbelException - if failefpublic String buildInvocationParameters(boolean limit, boolean offset)
limit - optional limit rowsoffset - optional skip rowspublic String buildInvocationParameters()
public String acs(String str, String appendStr)
str - the stringappendStr - the string to appendpublic String pcs(String str, String prependStr)
str - the string builderprependStr - the string to prependpublic String aas(String str)
str - the argument stringpublic String as(String str)
str - the source stringpublic org.tentackle.model.DataType getJdbcDataType(org.tentackle.model.Attribute attribute)
throws org.wurbelizer.wurbel.WurbelException
attribute - the model attributeorg.wurbelizer.wurbel.WurbelException - if type is misconfiguredpublic String createJdbcSetterName(org.tentackle.model.Attribute attribute) throws org.wurbelizer.wurbel.WurbelException
attribute - the model attributeorg.wurbelizer.wurbel.WurbelException - if type is misconfiguredpublic String createJdbcGetterName(org.tentackle.model.Attribute attribute) throws org.wurbelizer.wurbel.WurbelException
attribute - the model attributeorg.wurbelizer.wurbel.WurbelException - if type is misconfiguredpublic String getModelCode(org.tentackle.model.Attribute attribute, String jdbcCode) throws org.wurbelizer.wurbel.WurbelException
attribute - the attributejdbcCode - the jdbc codeorg.wurbelizer.wurbel.WurbelException - if some model errorpublic String getJdbcCode(org.tentackle.model.Attribute attribute, String modelCode) throws org.wurbelizer.wurbel.WurbelException
attribute - the attributemodelCode - the jdbc codeorg.wurbelizer.wurbel.WurbelException - if some model errorpublic boolean isRelationTransient(org.tentackle.model.Relation relation)
relation - the relationpublic List<String> getRelationArgs(org.tentackle.model.Relation relation, boolean select)
relation - the relationselect - is true if args for select-method, else delete-methodpublic String createRelationArgString(org.tentackle.model.Relation relation, boolean select)
relation - the relation.select - is true if for selectStatement, else deleteStatementpublic String createRelationSelectCode(org.tentackle.model.Relation relation)
relation - the relationpublic String createRelationUpdateReferenceCode(org.tentackle.model.Relation relation)
relation - the relationpublic String createRelationSetFirstArgMethodName(org.tentackle.model.Relation relation)
relation - the relationpublic String createRelationDeleteCode(org.tentackle.model.Relation relation)
relation - the relationpublic String createRelationLinkCode(org.tentackle.model.Relation relation)
relation - the relationpublic List<org.tentackle.model.Relation> getEagerRelations()
Copyright © 2016 Krake Softwaretechnik. All rights reserved.