Example usage for org.hibernate.boot.model.naming Identifier getText

List of usage examples for org.hibernate.boot.model.naming Identifier getText

Introduction

In this page you can find the example usage for org.hibernate.boot.model.naming Identifier getText.

Prototype

public String getText() 

Source Link

Document

Get the identifiers name (text)

Usage

From source file:cn.tata.t2s.ssm.util.AcmeCorpPhysicalNamingStrategy.java

License:LGPL

@Override
public Identifier toPhysicalTableName(Identifier name, JdbcEnvironment jdbcEnvironment) {
    final List<String> parts = splitAndReplace(name.getText());
    return jdbcEnvironment.getIdentifierHelper().toIdentifier(join(parts), name.isQuoted());
}

From source file:cn.tata.t2s.ssm.util.AcmeCorpPhysicalNamingStrategy.java

License:LGPL

@Override
public Identifier toPhysicalSequenceName(Identifier name, JdbcEnvironment jdbcEnvironment) {
    final LinkedList<String> parts = splitAndReplace(name.getText());
    // Acme Corp says all sequences should end with _seq
    if (!"seq".equalsIgnoreCase(parts.getLast())) {
        parts.add("seq");
    }//  w  w  w.  j a  va2 s .co  m
    return jdbcEnvironment.getIdentifierHelper().toIdentifier(join(parts), name.isQuoted());
}

From source file:cn.tata.t2s.ssm.util.AcmeCorpPhysicalNamingStrategy.java

License:LGPL

@Override
public Identifier toPhysicalColumnName(Identifier name, JdbcEnvironment jdbcEnvironment) {
    final List<String> parts = splitAndReplace(name.getText());
    return jdbcEnvironment.getIdentifierHelper().toIdentifier(join(parts), name.isQuoted());
}

From source file:com.bxf.hradmin.common.persistence.MyNamingStrategy.java

License:Open Source License

@Override
public Identifier toPhysicalTableName(Identifier name, JdbcEnvironment jdbcEnvironment) {
    return super.toPhysicalTableName(Identifier.toIdentifier(TABLE_PREFIX + name.getText(), name.isQuoted()),
            jdbcEnvironment);//from  w  w  w.j a  va 2  s .c  om
}

From source file:com.evolveum.midpoint.repo.sql.util.MidPointPhysicalNamingStrategy.java

License:Apache License

@Override
public Identifier toPhysicalTableName(Identifier identifier, JdbcEnvironment jdbcEnvironment) {
    String name = identifier.getText();
    if (name.startsWith("m_") || "hibernate_sequence".equals(name)) {
        return identifier;
    }/* www .j av a2s .  co m*/

    name = name.substring(1);
    name = "m_" + CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name);
    name = RUtil.fixDBSchemaObjectNameLength(name);

    Identifier i = new Identifier(name, identifier.isQuoted());

    LOGGER.trace("toPhysicalTableName {} -> {}", identifier, i);

    return i;
}

From source file:com.example.ejb3.auction.NamingStrategy.java

License:Apache License

@Override
public Identifier toPhysicalTableName(Identifier name, JdbcEnvironment jdbcEnvironment) {
    return jdbcEnvironment.getIdentifierHelper().toIdentifier(addUnderscores(name.getText()), name.isQuoted());
}

From source file:com.example.ejb3.auction.NamingStrategy.java

License:Apache License

@Override
public Identifier toPhysicalColumnName(Identifier name, JdbcEnvironment jdbcEnvironment) {
    return jdbcEnvironment.getIdentifierHelper().toIdentifier(addUnderscores(name.getText()), name.isQuoted());
}

From source file:com.hack23.cia.service.data.impl.LegacyNamingStrategy.java

License:Apache License

/**
* Convert./*from w  w w  .j ava 2s.c o m*/
*
* @param identifier
*            the identifier
* @return the identifier
*/
private static Identifier convert(final Identifier identifier) {
    if (identifier == null || StringUtils.isBlank(identifier.getText())) {
        return identifier;
    } else {
        return Identifier.toIdentifier(
                identifier.getText().replaceAll(REG_EXPR, REPLACEMENT_PATTERN).toLowerCase(Locale.ENGLISH));
    }
}

From source file:com.kpb.other.AcmeCorpPhysicalNamingStrategy.java

License:LGPL

public Identifier toPhysicalTableName(Identifier name, JdbcEnvironment jdbcEnvironment) {
    final List<String> parts = splitAndReplace(name.getText());
    return jdbcEnvironment.getIdentifierHelper().toIdentifier(join(parts), name.isQuoted());
}

From source file:com.kpb.other.AcmeCorpPhysicalNamingStrategy.java

License:LGPL

public Identifier toPhysicalSequenceName(Identifier name, JdbcEnvironment jdbcEnvironment) {
    final LinkedList<String> parts = splitAndReplace(name.getText());
    // Acme Corp says all sequences should end with _seq
    if (!"seq".equalsIgnoreCase(parts.getLast())) {
        parts.add("seq");
    }//from w w  w .  j  a v a2 s.c  o  m
    return jdbcEnvironment.getIdentifierHelper().toIdentifier(join(parts), name.isQuoted());
}