com.koubei.abator.KoubeiDaoGenerate Maven / Gradle / Ivy
/**
* Project: ibator_koubei
*
* File Created at 2009-10-12
*/
package com.koubei.abator;
import java.text.MessageFormat;
import org.apache.ibatis.ibator.api.dom.java.FullyQualifiedJavaType;
import org.apache.ibatis.ibator.api.dom.java.JavaVisibility;
import org.apache.ibatis.ibator.api.dom.java.Method;
import org.apache.ibatis.ibator.config.IbatorContext;
import org.apache.ibatis.ibator.generator.ibatis2.dao.templates.AbstractDAOTemplate;
/**
* @author 百岁 [email protected]
*
* 2011-3-10
*/
public class KoubeiDaoGenerate extends AbstractDAOTemplate {
private IbatorContext ibatorContext;
public KoubeiDaoGenerate() {
System.out.println("ddd");
}
public void setIbatorContext(IbatorContext ibatorContext) {
this.ibatorContext = ibatorContext;
}
@Override
protected void configureConstructorTemplate() {
Method method = new Method();
method.setConstructor(true);
method.setVisibility(JavaVisibility.PUBLIC);
method.addBodyLine("super();");
setConstructorTemplate(method);
}
@Override
protected void configureMethods() {
Method implOperationLoggerMethod = new Method();
implOperationLoggerMethod.setName("getEntityName");
implOperationLoggerMethod.setFinal(true);
implOperationLoggerMethod.setReturnType(FullyQualifiedJavaType.getStringInstance());
implOperationLoggerMethod.addBodyLine(" return \"{0}\";\n");
implOperationLoggerMethod.setVisibility(JavaVisibility.PUBLIC);
this.addMethod(implOperationLoggerMethod);
// public List