当前位置: 首页>>代码示例>>Java>>正文


Java InnerClass类代码示例

本文整理汇总了Java中org.mybatis.generator.api.dom.java.InnerClass的典型用法代码示例。如果您正苦于以下问题:Java InnerClass类的具体用法?Java InnerClass怎么用?Java InnerClass使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


InnerClass类属于org.mybatis.generator.api.dom.java包,在下文中一共展示了InnerClass类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addClassComment

import org.mybatis.generator.api.dom.java.InnerClass; //导入依赖的package包/类
public void addClassComment(InnerClass innerClass, IntrospectedTable introspectedTable, boolean markAsDoNotDelete) {
    if (suppressAllComments) {
        return;
    }
    StringBuilder sb = new StringBuilder();
    innerClass.addJavaDocLine("/**");
    sb.append(" * ");
    sb.append(introspectedTable.getFullyQualifiedTable());
    innerClass.addJavaDocLine(sb.toString().replace("\n", " "));
    sb.setLength(0);
    sb.append(" * @author ");
    sb.append(systemPro.getProperty("user.name"));
    sb.append(" ");
    sb.append(currentDateStr);
    innerClass.addJavaDocLine(" */");
}
 
开发者ID:xiachuanshou,项目名称:shop-manager,代码行数:17,代码来源:MyCommentGenerator.java

示例2: addClassComment

import org.mybatis.generator.api.dom.java.InnerClass; //导入依赖的package包/类
public void addClassComment(InnerClass innerClass,
        IntrospectedTable introspectedTable) {
    if (suppressAllComments) {
        return;
    }
    
    StringBuilder sb = new StringBuilder();

    innerClass.addJavaDocLine("/**"); //$NON-NLS-1$
    innerClass
            .addJavaDocLine(" * This class was generated by MyBatis Generator."); //$NON-NLS-1$

    sb.append(" * This class corresponds to the database table "); //$NON-NLS-1$
    sb.append(introspectedTable.getFullyQualifiedTable());
    innerClass.addJavaDocLine(sb.toString());

    addJavadocTag(innerClass, false);

    innerClass.addJavaDocLine(" */"); //$NON-NLS-1$
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:21,代码来源:DefaultCommentGenerator.java

示例3: addClassComment

import org.mybatis.generator.api.dom.java.InnerClass; //导入依赖的package包/类
public void addClassComment(InnerClass innerClass,
        IntrospectedTable introspectedTable) {
    if (suppressAllComments) {
        return;
    }
    
    StringBuilder sb = new StringBuilder();

    innerClass.addJavaDocLine("/**"); 
    innerClass.addJavaDocLine(" * This class was generated by MyBatis Generator."); 

    sb.append(" * This class corresponds to the database table "); 
    sb.append(introspectedTable.getFullyQualifiedTable());
    innerClass.addJavaDocLine(sb.toString());

    addJavadocTag(innerClass, false);

    innerClass.addJavaDocLine(" */"); 
}
 
开发者ID:xiachengwei5,项目名称:org.mybatis.generator.core-1.3.5,代码行数:20,代码来源:DefaultCommentGenerator.java

示例4: addCurrentMethods

import org.mybatis.generator.api.dom.java.InnerClass; //导入依赖的package包/类
protected void addCurrentMethods(IntrospectedColumn c, InnerClass criteria, String currentType, String currentSqlType){
	
	//EqualTo
	criteria.addMethod(createCurrentMethod(c, "and" + toUpperFirst(c.getJavaProperty()) + "EqualToCurrent" + currentType, "=", currentSqlType));
	//NotEqualTo
	criteria.addMethod(createCurrentMethod(c, "and" + toUpperFirst(c.getJavaProperty()) + "NotEqualToCurrent" + currentType, "<>", currentSqlType));
	//GreterThan
	criteria.addMethod(createCurrentMethod(c, "and" + toUpperFirst(c.getJavaProperty()) + "GreterThanCurrent" + currentType, ">", currentSqlType));
	//GreaterThanOrEqualTo
	criteria.addMethod(createCurrentMethod(c, "and" + toUpperFirst(c.getJavaProperty()) + "GreaterThanOrEqualToCurrent" + currentType, ">=", currentSqlType));
	//LessThan
	criteria.addMethod(createCurrentMethod(c, "and" + toUpperFirst(c.getJavaProperty()) + "LessThanCurrent" + currentType, "<", currentSqlType));
	//LessThanOrEqualTo
	criteria.addMethod(createCurrentMethod(c, "and" + toUpperFirst(c.getJavaProperty()) + "LessThanOrEqualToCurrent" + currentType, "<=", currentSqlType));
	
}
 
开发者ID:ling49043171,项目名称:mark-mybatis-generator,代码行数:17,代码来源:DBDateCriteriaPlugin.java

示例5: addClassComment

import org.mybatis.generator.api.dom.java.InnerClass; //导入依赖的package包/类
@Override
public void addClassComment(InnerClass innerClass,
        IntrospectedTable introspectedTable) {
    if (suppressAllComments) {
        return;
    }
    
    StringBuilder sb = new StringBuilder();

    innerClass.addJavaDocLine("/**"); //$NON-NLS-1$
    innerClass
            .addJavaDocLine(" * This class was generated by MyBatis Generator."); //$NON-NLS-1$

    sb.append(" * This class corresponds to the database table "); //$NON-NLS-1$
    sb.append(introspectedTable.getFullyQualifiedTable());
    innerClass.addJavaDocLine(sb.toString());

    addJavadocTag(innerClass, false);

    innerClass.addJavaDocLine(" */"); //$NON-NLS-1$
}
 
开发者ID:nextyu,项目名称:summer-mybatis-generator,代码行数:22,代码来源:DefaultCommentGenerator.java

示例6: getCriteriaInnerClass

import org.mybatis.generator.api.dom.java.InnerClass; //导入依赖的package包/类
private InnerClass getCriteriaInnerClass(TopLevelClass topLevelClass) {
    Method method;

    InnerClass answer = new InnerClass(FullyQualifiedJavaType
            .getCriteriaInstance());

    answer.setVisibility(JavaVisibility.PUBLIC);
    answer.setStatic(true);
    answer.setSuperClass(FullyQualifiedJavaType
            .getGeneratedCriteriaInstance());

    context.getCommentGenerator().addClassComment(answer,
            introspectedTable, true);

    method = new Method();
    method.setVisibility(JavaVisibility.PROTECTED);
    method.setName("Criteria"); //$NON-NLS-1$
    method.setConstructor(true);
    method.addBodyLine("super();"); //$NON-NLS-1$
    answer.addMethod(method);

    return answer;
}
 
开发者ID:backkoms,项目名称:mybatis-generator-comments,代码行数:24,代码来源:ExampleGenerator.java

示例7: modelExampleClassGenerated

import org.mybatis.generator.api.dom.java.InnerClass; //导入依赖的package包/类
/**
 * 添加给Example类序列化的方法
 *
 * @param topLevelClass
 * @param introspectedTable
 * @return
 */
@Override
public boolean modelExampleClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
    makeSerializable(topLevelClass, introspectedTable);

    for (InnerClass innerClass : topLevelClass.getInnerClasses()) {
        if ("GeneratedCriteria".equals(innerClass.getType().getShortName())) { //$NON-NLS-1$
            innerClass.addSuperInterface(serializable);
        }
        if ("Criteria".equals(innerClass.getType().getShortName())) { //$NON-NLS-1$
            innerClass.addSuperInterface(serializable);
        }
        if ("Criterion".equals(innerClass.getType().getShortName())) { //$NON-NLS-1$
            innerClass.addSuperInterface(serializable);
        }
    }

    return true;
}
 
开发者ID:handosme,项目名称:mybatis-generator-plus,代码行数:26,代码来源:CustomSerializablePlugin.java

示例8: addClassComment

import org.mybatis.generator.api.dom.java.InnerClass; //导入依赖的package包/类
public void addClassComment(InnerClass innerClass, IntrospectedTable introspectedTable, String comment) {
	if (suppressAllComments) {
		return;
	}

	StringBuilder sb = new StringBuilder();
	String remark = comment;
	if (remark != null && remark.length() != 0) {
		innerClass.addJavaDocLine("/**"); //$NON-NLS-1$
		sb.append(" * "); //$NON-NLS-1$
		remark = remark.replaceAll(OutputUtilities.lineSeparator,
				"<br>" + OutputUtilities.lineSeparator + "\t * ");
		sb.append(remark);
		innerClass.addJavaDocLine(sb.toString());
		innerClass.addJavaDocLine(" */"); //$NON-NLS-1$
	}
}
 
开发者ID:fnyexx,项目名称:mybator,代码行数:18,代码来源:DefaultCommentGenerator.java

示例9: getCriteriaInnerClass

import org.mybatis.generator.api.dom.java.InnerClass; //导入依赖的package包/类
private InnerClass getCriteriaInnerClass(TopLevelClass topLevelClass) {
	Method method;

	InnerClass answer = new InnerClass(FullyQualifiedJavaType.getCriteriaInstance());

	answer.setVisibility(JavaVisibility.PUBLIC);
	answer.setStatic(true);
	answer.setSuperClass(FullyQualifiedJavaType.getGeneratedCriteriaInstance());

	context.getCommentGenerator().addClassComment(answer, introspectedTable, true);

	method = new Method();
	method.setVisibility(JavaVisibility.PROTECTED);
	method.setName("Criteria"); //$NON-NLS-1$
	method.setConstructor(true);
	method.addBodyLine("super();"); //$NON-NLS-1$
	answer.addMethod(method);

	return answer;
}
 
开发者ID:fnyexx,项目名称:mybator,代码行数:21,代码来源:ExampleGenerator.java

示例10: addClassComment

import org.mybatis.generator.api.dom.java.InnerClass; //导入依赖的package包/类
@Override
public void addClassComment(InnerClass innerClass, IntrospectedTable introspectedTable) {
    // 类注释,不管用
    String shortName = innerClass.getType().getShortName();
    innerClass.addJavaDocLine("/**");
    //innerClass.addJavaDocLine(" * 类注释");
    innerClass.addJavaDocLine(" * " + introspectedTable.getFullyQualifiedTable().getRemark());
    innerClass.addJavaDocLine(" * " + shortName);
    innerClass.addJavaDocLine(" * 数据库表:" + introspectedTable.getFullyQualifiedTable());
    // addJavadocTag(innerClass, false);
    innerClass.addJavaDocLine(" */");
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:13,代码来源:BDTCommentGenerator.java

示例11: modelExampleClassGenerated

import org.mybatis.generator.api.dom.java.InnerClass; //导入依赖的package包/类
@Override
public boolean modelExampleClassGenerated(TopLevelClass topLevelClass,
		IntrospectedTable introspectedTable) {
	List<InnerClass> inners = topLevelClass.getInnerClasses();
	for(InnerClass in : inners){
		if(in.getType().getShortName().startsWith("Generated")
				|| in.getType().getShortName().startsWith("Criteria")){
			for(Method m : in.getMethods()){
				if(m.getName().startsWith("and") && m.getParameters().size() > 0){
					m.addBodyLine(0, String.format("if(%s)return (Criteria)this;",getIfExpressionStringBy(m.getParameters())));
				}
			}
		}
		if (in.getType().getShortName().startsWith("Criteria")) {
			Method method = new Method();
			method.setName("setRowNum");
			FullyQualifiedJavaType fqjt = FullyQualifiedJavaType.getCriteriaInstance();
			method.setReturnType(fqjt);
			method.setVisibility(JavaVisibility.PUBLIC);
			Parameter p = new Parameter(FullyQualifiedJavaType.getStringInstance(), "rowNum");
			method.addParameter(p);
			method.addBodyLine(String.format("if(%s)return (Criteria)this;",getIfExpressionStringBy(method.getParameters())));
			method.addBodyLine(setRowNum[0]);
			method.addBodyLine(setRowNum[1]);
			method.addBodyLine(setRowNum[2]);
			method.addBodyLine(setRowNum[3]);
			method.addBodyLine(setRowNum[4]);
			method.addBodyLine("return this;");
			in.addMethod(method);
		}
	}
	return true;
}
 
开发者ID:ling49043171,项目名称:mark-mybatis-generator,代码行数:34,代码来源:NullIgnoreCriteriaPlugin.java

示例12: modelExampleClassGenerated

import org.mybatis.generator.api.dom.java.InnerClass; //导入依赖的package包/类
@Override
public boolean modelExampleClassGenerated(TopLevelClass topLevelClass,
		IntrospectedTable introspectedTable) {
	createToString(topLevelClass);
	for(InnerClass ic : topLevelClass.getInnerClasses()){
		createToString(ic);
	}
	return true;
}
 
开发者ID:ling49043171,项目名称:mark-mybatis-generator,代码行数:10,代码来源:ModelToStringPlugin.java

示例13: createToString

import org.mybatis.generator.api.dom.java.InnerClass; //导入依赖的package包/类
private void createToString(InnerClass cls){
	Method m = new Method();
	m.setReturnType(FullyQualifiedJavaType.getStringInstance());
	m.setVisibility(JavaVisibility.PUBLIC);
	m.setName("toString");
	m.addAnnotation("@Override");
	
	StringBuilder sb = new StringBuilder();
	sb.append("return \"");
	sb.append(cls.getType().getShortName()).append(" [");
	
	int count = 0;
	for(Field f : cls.getFields()){
		if(!f.isStatic()){
			if(count > 0){
				sb.append(",");
			}
			sb.append(f.getName()).append("=\" + ").append(f.getName()).append(" + \"");
			count++;
		}
	}
	if(cls.getSuperClass() == null){
		sb.append("]\";");
	}else{
		sb.append("->\" + super.toString() + \"]\";");
	}
	
	m.addBodyLine(sb.toString());
	
	cls.addMethod(m);
}
 
开发者ID:ling49043171,项目名称:mark-mybatis-generator,代码行数:32,代码来源:ModelToStringPlugin.java

示例14: modelExampleClassGenerated

import org.mybatis.generator.api.dom.java.InnerClass; //导入依赖的package包/类
@Override
public boolean modelExampleClassGenerated(TopLevelClass topLevelClass,
		IntrospectedTable introspectedTable) {

	InnerClass generatedCriteria = null;
	if("GeneratedCriteria".equals(topLevelClass.getType().getShortName())){
		generatedCriteria = topLevelClass;
	}else{
		List<InnerClass> inners = topLevelClass.getInnerClasses();
		for(InnerClass in : inners){
			if(in.getType().getShortName().startsWith("Generated")){
				generatedCriteria = in;
				break;
			}
		}
	}
	
	if(generatedCriteria == null){
		return true;
	}
	
	for(IntrospectedColumn c : introspectedTable.getAllColumns()){
		
		if("Date".equals(c.getFullyQualifiedJavaType().getShortName())){
			addCurrentMethods(c,generatedCriteria, "Date", getCurrentDateString());
		}else if("Timestamp".equals(c.getFullyQualifiedJavaType().getShortName())){
			addCurrentMethods(c,generatedCriteria, "Timestamp", getCurrentTimestampString());
		}else if("Time".equals(c.getFullyQualifiedJavaType().getShortName())){
			addCurrentMethods(c,generatedCriteria, "Time", getCurrentTimeString());
		}
	}
	
	
	return true;
}
 
开发者ID:ling49043171,项目名称:mark-mybatis-generator,代码行数:36,代码来源:DBDateCriteriaPlugin.java


注:本文中的org.mybatis.generator.api.dom.java.InnerClass类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。