use of org.mybatis.generator.internal.rules.Rules in project generator by mybatis.
the class ExtendedDAOMethodNameCalculator method getSelectByExampleWithBLOBsMethodName.
/**
* 1. if this will be the only selectByExample, then the result should be
* selectByExample. 2. Else the method name should be
* selectByExampleWithBLOBs
*/
public String getSelectByExampleWithBLOBsMethodName(IntrospectedTable introspectedTable) {
StringBuilder sb = new StringBuilder();
//$NON-NLS-1$
sb.append("select");
sb.append(introspectedTable.getFullyQualifiedTable().getDomainObjectName());
//$NON-NLS-1$
sb.append("ByExample");
Rules rules = introspectedTable.getRules();
if (rules.generateSelectByExampleWithoutBLOBs()) {
//$NON-NLS-1$
sb.append("WithBLOBs");
}
return sb.toString();
}
use of org.mybatis.generator.internal.rules.Rules in project generator by mybatis.
the class DAOGenerator method addUpdateByExampleParmsInnerclass.
protected void addUpdateByExampleParmsInnerclass(TopLevelClass topLevelClass, Interface interfaze) {
Rules rules = introspectedTable.getRules();
if (rules.generateUpdateByExampleSelective() || rules.generateUpdateByExampleWithBLOBs() || rules.generateUpdateByExampleWithoutBLOBs()) {
AbstractDAOElementGenerator methodGenerator = new UpdateByExampleParmsInnerclassGenerator();
initializeAndExecuteGenerator(methodGenerator, topLevelClass, interfaze);
}
}
use of org.mybatis.generator.internal.rules.Rules in project generator by mybatis.
the class ExtendedDAOMethodNameCalculator method getUpdateByExampleWithoutBLOBsMethodName.
public String getUpdateByExampleWithoutBLOBsMethodName(IntrospectedTable introspectedTable) {
StringBuilder sb = new StringBuilder();
//$NON-NLS-1$
sb.append("update");
sb.append(introspectedTable.getFullyQualifiedTable().getDomainObjectName());
Rules rules = introspectedTable.getRules();
if (!rules.generateUpdateByExampleWithBLOBs()) {
//$NON-NLS-1$
sb.append("ByExample");
} else if (rules.generateRecordWithBLOBsClass()) {
//$NON-NLS-1$
sb.append("ByExample");
} else {
//$NON-NLS-1$
sb.append("ByExampleWithoutBLOBs");
}
return sb.toString();
}
Aggregations