Java Code Examples for org.mybatis.generator.config.Context#getBeginningDelimiter()

The following examples show how to use org.mybatis.generator.config.Context#getBeginningDelimiter() . 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: FullyQualifiedTable.java    From mapper-generator-javafx with Apache License 2.0 3 votes vote down vote up
/**
 * This object is used to hold information related to the table itself, not the columns in the
 * table.
 *
 * @param introspectedCatalog
 *            the actual catalog of the table as returned from DatabaseMetaData. This value
 *            should only be set if the user configured a catalog. Otherwise the
 *            DatabaseMetaData is reporting some database default that we don't want in the
 *            generated code.
 * @param introspectedSchema
 *            the actual schema of the table as returned from DatabaseMetaData. This value
 *            should only be set if the user configured a schema. Otherwise the
 *            DatabaseMetaData is reporting some database default that we don't want in the
 *            generated code.
 * @param introspectedTableName
 *            the actual table name as returned from DatabaseMetaData
 * @param domainObjectName
 *            the configured domain object name for this table. If nothing is configured, we'll build the domain
 *            object named based on the tableName or runtimeTableName.
 * @param alias
 *            a configured alias for the table. This alias will be added to the table name in the SQL
 * @param ignoreQualifiersAtRuntime
 *            if true, then the catalog and schema qualifiers will be ignored when composing fully qualified names
 *            in the generated SQL. This is used, for example, when the user needs to specify a specific schema for
 *            generating code but does not want the schema in the generated SQL
 * @param runtimeCatalog
 *            this is used to "rename" the catalog in the generated SQL. This is useful, for example, when
 *            generating code against one catalog that should run with a different catalog.
 * @param runtimeSchema
 *            this is used to "rename" the schema in the generated SQL. This is useful, for example, when generating
 *            code against one schema that should run with a different schema.
 * @param runtimeTableName
 *            this is used to "rename" the table in the generated SQL. This is useful, for example, when generating
 *            code to run with an Oracle synonym. The user would have to specify the actual table name and schema
 *            for generation, but would want to use the synonym name in the generated SQL
 * @param delimitIdentifiers
 *            if true, then the table identifiers will be delimited at runtime. The delimiter characters are
 *            obtained from the Context.
 * @param domainObjectRenamingRule
 *            If domainObjectName is not configured, we'll build the domain object named based on the tableName
 *            or runtimeTableName.
 *            And then we use the domain object renaming rule to generate the final domain object name.
 * @param context
 *            the context
 */
public FullyQualifiedTable(String introspectedCatalog,
        String introspectedSchema, String introspectedTableName,
        String domainObjectName, String alias,
        boolean ignoreQualifiersAtRuntime, String runtimeCatalog,
        String runtimeSchema, String runtimeTableName,
        boolean delimitIdentifiers, DomainObjectRenamingRule domainObjectRenamingRule,
        Context context) {
    super();
    this.introspectedCatalog = introspectedCatalog;
    this.introspectedSchema = introspectedSchema;
    this.introspectedTableName = introspectedTableName;
    this.ignoreQualifiersAtRuntime = ignoreQualifiersAtRuntime;
    this.runtimeCatalog = runtimeCatalog;
    this.runtimeSchema = runtimeSchema;
    this.runtimeTableName = runtimeTableName;
    this.domainObjectRenamingRule = domainObjectRenamingRule;

    if (stringHasValue(domainObjectName)) {
        int index = domainObjectName.lastIndexOf('.');
        if (index == -1) {
            this.domainObjectName = domainObjectName;
        } else {
            this.domainObjectName = domainObjectName.substring(index + 1);
            this.domainObjectSubPackage = domainObjectName.substring(0, index);
        }
    }

    if (alias == null) {
        this.alias = null;
    } else {
        this.alias = alias.trim();
    }

    beginningDelimiter = delimitIdentifiers ? context
            .getBeginningDelimiter() : "";
    endingDelimiter = delimitIdentifiers ? context.getEndingDelimiter()
            : "";
}
 
Example 2
Source File: FullyQualifiedTable.java    From mybatis-generator-core-fix with Apache License 2.0 3 votes vote down vote up
/**
 * This object is used to hold information related to the table itself, not the columns in the table.
 *
 * @param introspectedCatalog
 *            the actual catalog of the table as returned from DatabaseMetaData. This value should only be set if
 *            the user configured a catalog. Otherwise the DatabaseMetaData is reporting some database default that
 *            we don't want in the generated code.
 * @param introspectedSchema
 *            the actual schema of the table as returned from DatabaseMetaData. This value should only be set if the
 *            user configured a schema. Otherwise the DatabaseMetaData is reporting some database default that we
 *            don't want in the generated code.
 * @param introspectedTableName
 *            the actual table name as returned from DatabaseMetaData
 * @param domainObjectName
 *            the configured domain object name for this table. If nothing is configured, we'll build the domain
 *            object named based on the tableName or runtimeTableName.
 * @param alias
 *            a configured alias for the table. This alias will be added to the table name in the SQL
 * @param ignoreQualifiersAtRuntime
 *            if true, then the catalog and schema qualifiers will be ignored when composing fully qualified names
 *            in the generated SQL. This is used, for example, when the user needs to specify a specific schema for
 *            generating code but does not want the schema in the generated SQL
 * @param runtimeCatalog
 *            this is used to "rename" the catalog in the generated SQL. This is useful, for example, when
 *            generating code against one catalog that should run with a different catalog.
 * @param runtimeSchema
 *            this is used to "rename" the schema in the generated SQL. This is useful, for example, when generating
 *            code against one schema that should run with a different schema.
 * @param runtimeTableName
 *            this is used to "rename" the table in the generated SQL. This is useful, for example, when generating
 *            code to run with an Oracle synonym. The user would have to specify the actual table name and schema
 *            for generation, but would want to use the synonym name in the generated SQL
 * @param delimitIdentifiers
 *            if true, then the table identifiers will be delimited at runtime. The delimiter characters are
 *            obtained from the Context.
 * @param context
 *            the context
 */
public FullyQualifiedTable(String introspectedCatalog,
        String introspectedSchema, String introspectedTableName,
        String domainObjectName, String alias,
        boolean ignoreQualifiersAtRuntime, String runtimeCatalog,
        String runtimeSchema, String runtimeTableName,
        boolean delimitIdentifiers, Context context) {
    super();
    this.introspectedCatalog = introspectedCatalog;
    this.introspectedSchema = introspectedSchema;
    this.introspectedTableName = introspectedTableName;
    this.ignoreQualifiersAtRuntime = ignoreQualifiersAtRuntime;
    this.runtimeCatalog = runtimeCatalog;
    this.runtimeSchema = runtimeSchema;
    this.runtimeTableName = runtimeTableName;

    if (stringHasValue(domainObjectName)) {
        int index = domainObjectName.lastIndexOf('.');
        if (index == -1) {
            this.domainObjectName = domainObjectName;
        } else {
            this.domainObjectName = domainObjectName.substring(index + 1);
            this.domainObjectSubPackage = domainObjectName.substring(0, index);
        }
    }

    if (alias == null) {
        this.alias = null;
    } else {
        this.alias = alias.trim();
    }

    beginningDelimiter = delimitIdentifiers ? context
            .getBeginningDelimiter() : ""; //$NON-NLS-1$
    endingDelimiter = delimitIdentifiers ? context.getEndingDelimiter()
            : ""; //$NON-NLS-1$
}
 
Example 3
Source File: FullyQualifiedTable.java    From mybatis-generator-plus with Apache License 2.0 3 votes vote down vote up
/**
 * This object is used to hold information related to the table itself, not
 * the columns in the table.
 * 
 * @param introspectedCatalog
 *            the actual catalog of the table as returned from
 *            DatabaseMetaData. This value should only be set if the user
 *            configured a catalog. Otherwise the DatabaseMetaData is
 *            reporting some database default that we don't want in the
 *            generated code.
 * 
 * @param introspectedSchema
 *            the actual schema of the table as returned from
 *            DatabaseMetaData. This value should only be set if the user
 *            configured a schema. Otherwise the DatabaseMetaData is
 *            reporting some database default that we don't want in the
 *            generated code.
 * 
 * @param introspectedTableName
 *            the actual table name as returned from DatabaseMetaData
 * 
 * @param domainObjectName
 *            the configured domain object name for this table. If nothing
 *            is configured, we'll build the domain object named based on
 *            the tableName or runtimeTableName.
 * 
 * @param alias
 *            a configured alias for the table. This alias will be added to
 *            the table name in the SQL
 * 
 * @param ignoreQualifiersAtRuntime
 *            if true, then the catalog and schema qualifiers will be
 *            ignored when composing fully qualified names in the generated
 *            SQL. This is used, for example, when the user needs to specify
 *            a specific schema for generating code but does not want the
 *            schema in the generated SQL
 * 
 * @param runtimeCatalog
 *            this is used to "rename" the catalog in the generated SQL.
 *            This is useful, for example, when generating code against one
 *            catalog that should run with a different catalog.
 * 
 * @param runtimeSchema
 *            this is used to "rename" the schema in the generated SQL. This
 *            is useful, for example, when generating code against one
 *            schema that should run with a different schema.
 * 
 * @param runtimeTableName
 *            this is used to "rename" the table in the generated SQL. This
 *            is useful, for example, when generating code to run with an
 *            Oracle synonym. The user would have to specify the actual
 *            table name and schema for generation, but would want to use
 *            the synonym name in the generated SQL
 * 
 * @param delimitIdentifiers
 *            if true, then the table identifiers will be delimited at
 *            runtime. The delimiter characters are obtained from the
 *            Context.
 */
public FullyQualifiedTable(String introspectedCatalog,
        String introspectedSchema, String introspectedTableName,
        String domainObjectName, String alias,
        boolean ignoreQualifiersAtRuntime, String runtimeCatalog,
        String runtimeSchema, String runtimeTableName,
        boolean delimitIdentifiers, Context context) {
    super();
    this.introspectedCatalog = introspectedCatalog;
    this.introspectedSchema = introspectedSchema;
    this.introspectedTableName = introspectedTableName;
    this.ignoreQualifiersAtRuntime = ignoreQualifiersAtRuntime;
    this.runtimeCatalog = runtimeCatalog;
    this.runtimeSchema = runtimeSchema;
    this.runtimeTableName = runtimeTableName;
    
    if (stringHasValue(domainObjectName)) {
        int index = domainObjectName.lastIndexOf('.');
        if (index == -1) {
            this.domainObjectName = domainObjectName;
        } else {
            this.domainObjectName = domainObjectName.substring(index + 1);
            this.domainObjectSubPackage = domainObjectName.substring(0, index);
        }
    }

    if (alias == null) {
        this.alias = null;
    } else {
        this.alias = alias.trim();
    }

    beginningDelimiter = delimitIdentifiers ? context
            .getBeginningDelimiter() : ""; //$NON-NLS-1$
    endingDelimiter = delimitIdentifiers ? context.getEndingDelimiter()
            : ""; //$NON-NLS-1$
}