org.mybatis.generator.internal.rules.Rules Java Examples

The following examples show how to use org.mybatis.generator.internal.rules.Rules. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ExtendedDAOMethodNameCalculator.java    From mybatis-generator-plus with Apache License 2.0 6 votes vote down vote up
public String getUpdateByExampleWithoutBLOBsMethodName(
        IntrospectedTable introspectedTable) {
    StringBuilder sb = new StringBuilder();

    sb.append("update"); //$NON-NLS-1$
    sb.append(introspectedTable.getFullyQualifiedTable()
            .getDomainObjectName());

    Rules rules = introspectedTable.getRules();

    if (!rules.generateUpdateByExampleWithBLOBs()) {
        sb.append("ByExample"); //$NON-NLS-1$
    } else if (rules.generateRecordWithBLOBsClass()) {
        sb.append("ByExample"); //$NON-NLS-1$
    } else {
        sb.append("ByExampleWithoutBLOBs"); //$NON-NLS-1$
    }

    return sb.toString();
}
 
Example #2
Source File: ExtendedDAOMethodNameCalculator.java    From mybatis-generator-plus with Apache License 2.0 6 votes vote down vote up
public String getUpdateByExampleWithBLOBsMethodName(
        IntrospectedTable introspectedTable) {
    StringBuilder sb = new StringBuilder();
    sb.append("update"); //$NON-NLS-1$
    sb.append(introspectedTable.getFullyQualifiedTable()
            .getDomainObjectName());

    Rules rules = introspectedTable.getRules();

    if (!rules.generateUpdateByExampleWithoutBLOBs()) {
        sb.append("ByExample"); //$NON-NLS-1$
    } else if (rules.generateRecordWithBLOBsClass()) {
        sb.append("ByExample"); //$NON-NLS-1$
    } else {
        sb.append("ByExampleWithBLOBs"); //$NON-NLS-1$
    }

    return sb.toString();
}
 
Example #3
Source File: ExtendedDAOMethodNameCalculator.java    From mybatis-generator-plus with Apache License 2.0 6 votes vote down vote up
/**
 * 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();
    sb.append("select"); //$NON-NLS-1$
    sb.append(introspectedTable.getFullyQualifiedTable()
            .getDomainObjectName());
    sb.append("ByExample"); //$NON-NLS-1$

    Rules rules = introspectedTable.getRules();

    if (rules.generateSelectByExampleWithoutBLOBs()) {
        sb.append("WithBLOBs"); //$NON-NLS-1$
    }

    return sb.toString();
}
 
Example #4
Source File: ExtendedDAOMethodNameCalculator.java    From mybatis-generator-plus with Apache License 2.0 6 votes vote down vote up
/**
 * 1. if this will be the only selectByExample, then the result should be
 * selectByExample. 2. Else the method name should be
 * selectByExampleWithoutBLOBs
 */
public String getSelectByExampleWithoutBLOBsMethodName(
        IntrospectedTable introspectedTable) {
    StringBuilder sb = new StringBuilder();
    sb.append("select"); //$NON-NLS-1$
    sb.append(introspectedTable.getFullyQualifiedTable()
            .getDomainObjectName());
    sb.append("ByExample"); //$NON-NLS-1$

    Rules rules = introspectedTable.getRules();

    if (rules.generateSelectByExampleWithBLOBs()) {
        sb.append("WithoutBLOBs"); //$NON-NLS-1$
    }

    return sb.toString();
}
 
Example #5
Source File: ExtendedDAOMethodNameCalculator.java    From mybatis-generator-plus with Apache License 2.0 6 votes vote down vote up
/**
 * 1. if this will be the only updateByPrimaryKey, then the result should be
 * updateByPrimaryKey. 2. If the other method is enabled, but there are
 * seperate base and blob classes, then the method name should be
 * updateByPrimaryKey 3. Else the method name should be
 * updateByPrimaryKeyWithBLOBs
 */
public String getUpdateByPrimaryKeyWithBLOBsMethodName(
        IntrospectedTable introspectedTable) {
    StringBuilder sb = new StringBuilder();
    sb.append("update"); //$NON-NLS-1$
    sb.append(introspectedTable.getFullyQualifiedTable()
            .getDomainObjectName());

    Rules rules = introspectedTable.getRules();

    if (!rules.generateUpdateByPrimaryKeyWithoutBLOBs()) {
        sb.append("ByPrimaryKey"); //$NON-NLS-1$
    } else if (rules.generateRecordWithBLOBsClass()) {
        sb.append("ByPrimaryKey"); //$NON-NLS-1$
    } else {
        sb.append("ByPrimaryKeyWithBLOBs"); //$NON-NLS-1$
    }

    return sb.toString();
}
 
Example #6
Source File: ExtendedDAOMethodNameCalculator.java    From mybatis-generator-plus with Apache License 2.0 6 votes vote down vote up
/**
 * 1. if this will be the only updateByPrimaryKey, then the result should be
 * updateByPrimaryKey. 2. If the other method is enabled, but there are
 * seperate base and blob classes, then the method name should be
 * updateByPrimaryKey 3. Else the method name should be
 * updateByPrimaryKeyWithoutBLOBs
 */
public String getUpdateByPrimaryKeyWithoutBLOBsMethodName(
        IntrospectedTable introspectedTable) {
    StringBuilder sb = new StringBuilder();

    sb.append("update"); //$NON-NLS-1$
    sb.append(introspectedTable.getFullyQualifiedTable()
            .getDomainObjectName());

    Rules rules = introspectedTable.getRules();

    if (!rules.generateUpdateByPrimaryKeyWithBLOBs()) {
        sb.append("ByPrimaryKey"); //$NON-NLS-1$
    } else if (rules.generateRecordWithBLOBsClass()) {
        sb.append("ByPrimaryKey"); //$NON-NLS-1$
    } else {
        sb.append("ByPrimaryKeyWithoutBLOBs"); //$NON-NLS-1$
    }

    return sb.toString();
}
 
Example #7
Source File: ExtendedDAOMethodNameCalculator.java    From mybatis-generator-core-fix with Apache License 2.0 6 votes vote down vote up
/**
 * 1. if this will be the only updateByPrimaryKey, then the result should be
 * updateByPrimaryKey. 2. If the other method is enabled, but there are
 * seperate base and blob classes, then the method name should be
 * updateByPrimaryKey 3. Else the method name should be
 * updateByPrimaryKeyWithoutBLOBs
 */
public String getUpdateByPrimaryKeyWithoutBLOBsMethodName(
        IntrospectedTable introspectedTable) {
    StringBuilder sb = new StringBuilder();

    sb.append("update"); //$NON-NLS-1$
    sb.append(introspectedTable.getFullyQualifiedTable()
            .getDomainObjectName());

    Rules rules = introspectedTable.getRules();

    if (!rules.generateUpdateByPrimaryKeyWithBLOBs()) {
        sb.append("ByPrimaryKey"); //$NON-NLS-1$
    } else if (rules.generateRecordWithBLOBsClass()) {
        sb.append("ByPrimaryKey"); //$NON-NLS-1$
    } else {
        sb.append("ByPrimaryKeyWithoutBLOBs"); //$NON-NLS-1$
    }

    return sb.toString();
}
 
Example #8
Source File: ExtendedDAOMethodNameCalculator.java    From mybatis-generator-core-fix with Apache License 2.0 6 votes vote down vote up
/**
 * 1. if this will be the only updateByPrimaryKey, then the result should be
 * updateByPrimaryKey. 2. If the other method is enabled, but there are
 * seperate base and blob classes, then the method name should be
 * updateByPrimaryKey 3. Else the method name should be
 * updateByPrimaryKeyWithBLOBs
 */
public String getUpdateByPrimaryKeyWithBLOBsMethodName(
        IntrospectedTable introspectedTable) {
    StringBuilder sb = new StringBuilder();
    sb.append("update"); //$NON-NLS-1$
    sb.append(introspectedTable.getFullyQualifiedTable()
            .getDomainObjectName());

    Rules rules = introspectedTable.getRules();

    if (!rules.generateUpdateByPrimaryKeyWithoutBLOBs()) {
        sb.append("ByPrimaryKey"); //$NON-NLS-1$
    } else if (rules.generateRecordWithBLOBsClass()) {
        sb.append("ByPrimaryKey"); //$NON-NLS-1$
    } else {
        sb.append("ByPrimaryKeyWithBLOBs"); //$NON-NLS-1$
    }

    return sb.toString();
}
 
Example #9
Source File: ExtendedDAOMethodNameCalculator.java    From mybatis-generator-core-fix with Apache License 2.0 6 votes vote down vote up
/**
 * 1. if this will be the only selectByExample, then the result should be
 * selectByExample. 2. Else the method name should be
 * selectByExampleWithoutBLOBs
 */
public String getSelectByExampleWithoutBLOBsMethodName(
        IntrospectedTable introspectedTable) {
    StringBuilder sb = new StringBuilder();
    sb.append("select"); //$NON-NLS-1$
    sb.append(introspectedTable.getFullyQualifiedTable()
            .getDomainObjectName());
    sb.append("ByExample"); //$NON-NLS-1$

    Rules rules = introspectedTable.getRules();

    if (rules.generateSelectByExampleWithBLOBs()) {
        sb.append("WithoutBLOBs"); //$NON-NLS-1$
    }

    return sb.toString();
}
 
Example #10
Source File: ExtendedDAOMethodNameCalculator.java    From mybatis-generator-core-fix with Apache License 2.0 6 votes vote down vote up
/**
 * 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();
    sb.append("select"); //$NON-NLS-1$
    sb.append(introspectedTable.getFullyQualifiedTable()
            .getDomainObjectName());
    sb.append("ByExample"); //$NON-NLS-1$

    Rules rules = introspectedTable.getRules();

    if (rules.generateSelectByExampleWithoutBLOBs()) {
        sb.append("WithBLOBs"); //$NON-NLS-1$
    }

    return sb.toString();
}
 
Example #11
Source File: ExtendedDAOMethodNameCalculator.java    From mybatis-generator-core-fix with Apache License 2.0 6 votes vote down vote up
public String getUpdateByExampleWithBLOBsMethodName(
        IntrospectedTable introspectedTable) {
    StringBuilder sb = new StringBuilder();
    sb.append("update"); //$NON-NLS-1$
    sb.append(introspectedTable.getFullyQualifiedTable()
            .getDomainObjectName());

    Rules rules = introspectedTable.getRules();

    if (!rules.generateUpdateByExampleWithoutBLOBs()) {
        sb.append("ByExample"); //$NON-NLS-1$
    } else if (rules.generateRecordWithBLOBsClass()) {
        sb.append("ByExample"); //$NON-NLS-1$
    } else {
        sb.append("ByExampleWithBLOBs"); //$NON-NLS-1$
    }

    return sb.toString();
}
 
Example #12
Source File: ExtendedDAOMethodNameCalculator.java    From mybatis-generator-core-fix with Apache License 2.0 6 votes vote down vote up
public String getUpdateByExampleWithoutBLOBsMethodName(
        IntrospectedTable introspectedTable) {
    StringBuilder sb = new StringBuilder();

    sb.append("update"); //$NON-NLS-1$
    sb.append(introspectedTable.getFullyQualifiedTable()
            .getDomainObjectName());

    Rules rules = introspectedTable.getRules();

    if (!rules.generateUpdateByExampleWithBLOBs()) {
        sb.append("ByExample"); //$NON-NLS-1$
    } else if (rules.generateRecordWithBLOBsClass()) {
        sb.append("ByExample"); //$NON-NLS-1$
    } else {
        sb.append("ByExampleWithoutBLOBs"); //$NON-NLS-1$
    }

    return sb.toString();
}
 
Example #13
Source File: DefaultDAOMethodNameCalculator.java    From mybatis-generator-plus with Apache License 2.0 5 votes vote down vote up
public String getUpdateByExampleWithBLOBsMethodName(
        IntrospectedTable introspectedTable) {
    Rules rules = introspectedTable.getRules();

    if (!rules.generateUpdateByExampleWithoutBLOBs()) {
        return "updateByExample"; //$NON-NLS-1$
    } else if (rules.generateRecordWithBLOBsClass()) {
        return "updateByExample"; //$NON-NLS-1$
    } else {
        return "updateByExampleWithBLOBs"; //$NON-NLS-1$
    }
}
 
Example #14
Source File: DefaultDAOMethodNameCalculator.java    From mybatis-generator-plus with Apache License 2.0 5 votes vote down vote up
/**
 * 1. if this will be the only updateByPrimaryKey, then the result should be
 * updateByPrimaryKey. 2. If the other method is enabled, but there are
 * seperate base and blob classes, then the method name should be
 * updateByPrimaryKey 3. Else the method name should be
 * updateByPrimaryKeyWithBLOBs
 */
public String getUpdateByPrimaryKeyWithBLOBsMethodName(
        IntrospectedTable introspectedTable) {
    Rules rules = introspectedTable.getRules();

    if (!rules.generateUpdateByPrimaryKeyWithoutBLOBs()) {
        return "updateByPrimaryKey"; //$NON-NLS-1$
    } else if (rules.generateRecordWithBLOBsClass()) {
        return "updateByPrimaryKey"; //$NON-NLS-1$
    } else {
        return "updateByPrimaryKeyWithBLOBs"; //$NON-NLS-1$
    }
}
 
Example #15
Source File: DefaultDAOMethodNameCalculator.java    From mybatis-generator-plus with Apache License 2.0 5 votes vote down vote up
/**
 * 1. if this will be the only selectByExample, then the result should be
 * selectByExample. 2. Else the method name should be
 * selectByExampleWithoutBLOBs
 */
public String getSelectByExampleWithoutBLOBsMethodName(
        IntrospectedTable introspectedTable) {
    Rules rules = introspectedTable.getRules();

    if (!rules.generateSelectByExampleWithBLOBs()) {
        return "selectByExample"; //$NON-NLS-1$
    } else {
        return "selectByExampleWithoutBLOBs"; //$NON-NLS-1$
    }
}
 
Example #16
Source File: DefaultDAOMethodNameCalculator.java    From mybatis-generator-plus with Apache License 2.0 5 votes vote down vote up
/**
 * 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) {
    Rules rules = introspectedTable.getRules();

    if (!rules.generateSelectByExampleWithoutBLOBs()) {
        return "selectByExample"; //$NON-NLS-1$
    } else {
        return "selectByExampleWithBLOBs"; //$NON-NLS-1$
    }
}
 
Example #17
Source File: DAOGenerator.java    From mybatis-generator-core-fix with Apache License 2.0 5 votes vote down vote up
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);
    }
}
 
Example #18
Source File: DefaultDAOMethodNameCalculator.java    From mybatis-generator-plus with Apache License 2.0 5 votes vote down vote up
public String getUpdateByExampleWithoutBLOBsMethodName(
        IntrospectedTable introspectedTable) {
    Rules rules = introspectedTable.getRules();

    if (!rules.generateUpdateByExampleWithBLOBs()) {
        return "updateByExample"; //$NON-NLS-1$
    } else if (rules.generateRecordWithBLOBsClass()) {
        return "updateByExample"; //$NON-NLS-1$
    } else {
        return "updateByExampleWithoutBLOBs"; //$NON-NLS-1$
    }
}
 
Example #19
Source File: DAOGenerator.java    From mybatis-generator-plus with Apache License 2.0 5 votes vote down vote up
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);
    }
}
 
Example #20
Source File: DefaultDAOMethodNameCalculator.java    From mybatis-generator-plus with Apache License 2.0 5 votes vote down vote up
/**
 * 1. if this will be the only updateByPrimaryKey, then the result should be
 * updateByPrimaryKey. 2. If the other method is enabled, but there are
 * seperate base and blob classes, then the method name should be
 * updateByPrimaryKey 3. Else the method name should be
 * updateByPrimaryKeyWithoutBLOBs
 */
public String getUpdateByPrimaryKeyWithoutBLOBsMethodName(
        IntrospectedTable introspectedTable) {
    Rules rules = introspectedTable.getRules();

    if (!rules.generateUpdateByPrimaryKeyWithBLOBs()) {
        return "updateByPrimaryKey"; //$NON-NLS-1$
    } else if (rules.generateRecordWithBLOBsClass()) {
        return "updateByPrimaryKey"; //$NON-NLS-1$
    } else {
        return "updateByPrimaryKeyWithoutBLOBs"; //$NON-NLS-1$
    }
}
 
Example #21
Source File: DefaultDAOMethodNameCalculator.java    From mybatis-generator-core-fix with Apache License 2.0 5 votes vote down vote up
public String getUpdateByExampleWithoutBLOBsMethodName(
        IntrospectedTable introspectedTable) {
    Rules rules = introspectedTable.getRules();

    if (!rules.generateUpdateByExampleWithBLOBs()) {
        return "updateByExample"; //$NON-NLS-1$
    } else if (rules.generateRecordWithBLOBsClass()) {
        return "updateByExample"; //$NON-NLS-1$
    } else {
        return "updateByExampleWithoutBLOBs"; //$NON-NLS-1$
    }
}
 
Example #22
Source File: DefaultDAOMethodNameCalculator.java    From mybatis-generator-core-fix with Apache License 2.0 5 votes vote down vote up
public String getUpdateByExampleWithBLOBsMethodName(
        IntrospectedTable introspectedTable) {
    Rules rules = introspectedTable.getRules();

    if (!rules.generateUpdateByExampleWithoutBLOBs()) {
        return "updateByExample"; //$NON-NLS-1$
    } else if (rules.generateRecordWithBLOBsClass()) {
        return "updateByExample"; //$NON-NLS-1$
    } else {
        return "updateByExampleWithBLOBs"; //$NON-NLS-1$
    }
}
 
Example #23
Source File: DefaultDAOMethodNameCalculator.java    From mybatis-generator-core-fix with Apache License 2.0 5 votes vote down vote up
/**
 * 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) {
    Rules rules = introspectedTable.getRules();

    if (!rules.generateSelectByExampleWithoutBLOBs()) {
        return "selectByExample"; //$NON-NLS-1$
    } else {
        return "selectByExampleWithBLOBs"; //$NON-NLS-1$
    }
}
 
Example #24
Source File: DefaultDAOMethodNameCalculator.java    From mybatis-generator-core-fix with Apache License 2.0 5 votes vote down vote up
/**
 * 1. if this will be the only selectByExample, then the result should be
 * selectByExample. 2. Else the method name should be
 * selectByExampleWithoutBLOBs
 */
public String getSelectByExampleWithoutBLOBsMethodName(
        IntrospectedTable introspectedTable) {
    Rules rules = introspectedTable.getRules();

    if (!rules.generateSelectByExampleWithBLOBs()) {
        return "selectByExample"; //$NON-NLS-1$
    } else {
        return "selectByExampleWithoutBLOBs"; //$NON-NLS-1$
    }
}
 
Example #25
Source File: DefaultDAOMethodNameCalculator.java    From mybatis-generator-core-fix with Apache License 2.0 5 votes vote down vote up
/**
 * 1. if this will be the only updateByPrimaryKey, then the result should be
 * updateByPrimaryKey. 2. If the other method is enabled, but there are
 * seperate base and blob classes, then the method name should be
 * updateByPrimaryKey 3. Else the method name should be
 * updateByPrimaryKeyWithBLOBs
 */
public String getUpdateByPrimaryKeyWithBLOBsMethodName(
        IntrospectedTable introspectedTable) {
    Rules rules = introspectedTable.getRules();

    if (!rules.generateUpdateByPrimaryKeyWithoutBLOBs()) {
        return "updateByPrimaryKey"; //$NON-NLS-1$
    } else if (rules.generateRecordWithBLOBsClass()) {
        return "updateByPrimaryKey"; //$NON-NLS-1$
    } else {
        return "updateByPrimaryKeyWithBLOBs"; //$NON-NLS-1$
    }
}
 
Example #26
Source File: DefaultDAOMethodNameCalculator.java    From mybatis-generator-core-fix with Apache License 2.0 5 votes vote down vote up
/**
 * 1. if this will be the only updateByPrimaryKey, then the result should be
 * updateByPrimaryKey. 2. If the other method is enabled, but there are
 * seperate base and blob classes, then the method name should be
 * updateByPrimaryKey 3. Else the method name should be
 * updateByPrimaryKeyWithoutBLOBs
 */
public String getUpdateByPrimaryKeyWithoutBLOBsMethodName(
        IntrospectedTable introspectedTable) {
    Rules rules = introspectedTable.getRules();

    if (!rules.generateUpdateByPrimaryKeyWithBLOBs()) {
        return "updateByPrimaryKey"; //$NON-NLS-1$
    } else if (rules.generateRecordWithBLOBsClass()) {
        return "updateByPrimaryKey"; //$NON-NLS-1$
    } else {
        return "updateByPrimaryKeyWithoutBLOBs"; //$NON-NLS-1$
    }
}
 
Example #27
Source File: IntrospectedTable.java    From mybatis-generator-plus with Apache License 2.0 4 votes vote down vote up
public Rules getRules() {
    return rules;
}
 
Example #28
Source File: IntrospectedTable.java    From mapper-generator-javafx with Apache License 2.0 4 votes vote down vote up
public Rules getRules() {
    return rules;
}
 
Example #29
Source File: IntrospectedTable.java    From mybatis-generator-plus with Apache License 2.0 2 votes vote down vote up
/**
 * This method exists to give plugins the opportunity to replace the
 * calculated rules if necessary.
 * 
 * @param rules
 */
public void setRules(Rules rules) {
    this.rules = rules;
}
 
Example #30
Source File: IntrospectedTable.java    From mybatis-generator-core-fix with Apache License 2.0 2 votes vote down vote up
/**
 * This method exists to give plugins the opportunity to replace the calculated rules if necessary.
 *
 * @param rules
 *            the new rules
 */
public void setRules(Rules rules) {
    this.rules = rules;
}