congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
IdentifierConfiguration
Code IndexAdd Tabnine to your IDE (free)

How to use
IdentifierConfiguration
in
org.apache.openjpa.lib.identifier

Best Java code snippets using org.apache.openjpa.lib.identifier.IdentifierConfiguration (Showing top 20 results out of 315)

origin: org.apache.openejb.patch/openjpa-jdbc

private int getMaxLen(String rule, DBIdentifier name, int maxLen) {
  IdentifierConfiguration config = getIdentifierConfiguration();
  if (maxLen < 1) {
    IdentifierRule nrule = config.getIdentifierRule(rule);
    maxLen = nrule.getMaxLength();
  }
  // Subtract delimiter length if name is delimited or will be delimited
  if (config.delimitAll() || name.isDelimited()) {
    maxLen = maxLen - (config.getLeadingDelimiter().length() + config.getTrailingDelimiter().length());
  }
  
  return maxLen;
}

origin: org.apache.openejb.patch/openjpa

protected boolean needsConversion(IdentifierConfiguration config) {
  return (config != getIdentifierConfiguration()) 
    && !(config.getConversionKey().equals(getIdentifierConfiguration().getConversionKey()));
}
origin: org.apache.openjpa/openjpa-lib

public boolean isDelimited(IdentifierConfiguration config, IdentifierRule rule, String name) {
   if (name == null || name.length() < 3) {
    return false;
  }
  return name.startsWith(config.getLeadingDelimiter()) &&
    name.endsWith(config.getTrailingDelimiter());
}
origin: org.apache.openjpa/openjpa-all

  return DBIdentifier.NULL;
if (!getIdentifierConfiguration().getSupportsDelimitedIdentifiers()) {
  return DBIdentifier.newIdentifier(name, id);
String delimCase = getIdentifierConfiguration().getDelimitedCase();
String nonDelimCase = getIdentifierConfiguration().getSchemaCase();
String caseName = name;
boolean delimit = !caseName.equals(name) || getIdentifierConfiguration().delimitAll();
return DBIdentifier.newIdentifier((delimit ? name : caseName), id, false, delimit, 
  !delimCase.equals(CASE_PRESERVE));
origin: org.apache.openjpa/openjpa-lib

public String convert(IdentifierConfiguration config, String rule, String name) {
  // Already using same delimiter, no need to convert
  if (!needsConversion(config)) {
    return name;
  }
  // Otherwise, remove delimiters and add appropriate delimiters
  IdentifierRule orule = getIdentifierConfiguration().getIdentifierRule(rule);
  IdentifierRule nrule = config.getIdentifierRule(rule);
  boolean delimit = isDelimited(config, orule, name);
  if (delimit) {
    name = removeDelimiters(config, orule, name, config.getLeadingDelimiter(), 
      config.getTrailingDelimiter());
    return delimit(getIdentifierConfiguration(), nrule, name, delimit);
  }
  return name;
}
origin: org.apache.openejb.patch/openjpa-jdbc

String delimCase = getIdentifierConfiguration().getDelimitedCase();
if (/* getNamingConfiguration().delimitAll() || */ name.isDelimited()) {
  if (CASE_UPPER.equals(delimCase)) {
if (!getIdentifierConfiguration().delimitAll()) {
  String schemaCase = getIdentifierConfiguration().getSchemaCase();
  if (CASE_LOWER.equals(schemaCase))
    return DBIdentifier.toLower(sName);
origin: org.apache.openjpa/openjpa-jdbc

/**
 * Converts the identifier to a format appropriate for the configuration using
 * the specified naming rule.
 * @param delimit If false, do not delimit.  Otherwise, delimit if necessary.
 */
private String toDBName(String rule, String name, boolean delimit) {
  if (name == null) {
    return null;
  }
  if (getIdentifierConfiguration().getSupportsDelimitedIdentifiers() && delimit && 
    getIdentifierConfiguration().delimitAll() && !Normalizer.isDelimited(name)) {
    return delimit(rule, name, true);
  }
  return convert(Normalizer.getNamingConfiguration(), rule, name);
}
origin: org.apache.openjpa/openjpa-all

public String combineFull(IdentifierConfiguration config, String rule, String fullName) {
  if (!needsConversion(config)) {
    return fullName;
  }
  // Split
  String[] names = splitName(config, rule, fullName);
  // Convert
  for (int i = 0; i < names.length; i++) {
    names[i] = convert(config, rule, names[i]);
  }
  // Join
  return joinNames(config, config.getIdentifierRule(rule), names, config.getIdentifierDelimiter());
}    
origin: org.apache.openejb.patch/openjpa

private IdentifierRule[] getNamingRules(String[] rules) {
  IdentifierRule[] nrules = new IdentifierRule[rules.length];
  for (int i = 0; i < rules.length; i++) {
    nrules[i] = _config.getIdentifierRule(rules[i]);
  }
  return nrules;
}
origin: org.apache.openejb.patch/openjpa

/**
 * Converts the identifier to a format appropriate for the configuration using
 * the default naming rule.
 * @param delimit If false, do not delimit.  Otherwise, delimit if necessary.
 */
public String toDBName(String name, boolean delimit) {
  return toDBName(getIdentifierConfiguration().getDefaultIdentifierRule().getName(), name, delimit);
}
origin: org.apache.openjpa/openjpa-all

public String combineNames(IdentifierConfiguration config, IdentifierRule rule, 
  IdentifierRule[] rules, String[] names) {
  boolean delimited = false;
  String combined = null;
  for (int i = 0; i < names.length; i++) {
    String name = names[i];
    if (isDelimited(rules[i], name)) {
      delimited = true;
      name = removeDelimiters(config, rules[i], name);
    }
    if (i == 0) {
      combined = name;
    }
    else {
      combined = combined + config.getIdentifierConcatenator() + name;
    }
  }
  
  if (delimited) {
    combined = delimit(config, rule, combined);
  }
  
  return combined;
}

origin: org.apache.openjpa/openjpa-jdbc

String delimCase = getIdentifierConfiguration().getDelimitedCase();
if (delimCase.equals(CASE_LOWER)) {
  return DBIdentifier.toLower(validName,true);
origin: org.apache.openjpa/openjpa-all

public boolean isDelimited(IdentifierConfiguration config, IdentifierRule rule, String name) {
   if (name == null || name.length() < 3) {
    return false;
  }
  return name.startsWith(config.getLeadingDelimiter()) &&
    name.endsWith(config.getTrailingDelimiter());
}
origin: org.apache.openjpa/openjpa-jdbc

  return DBIdentifier.NULL;
if (!getIdentifierConfiguration().getSupportsDelimitedIdentifiers()) {
  return DBIdentifier.newIdentifier(name, id);
String delimCase = getIdentifierConfiguration().getDelimitedCase();
String nonDelimCase = getIdentifierConfiguration().getSchemaCase();
String caseName = name;
boolean delimit = !caseName.equals(name) || getIdentifierConfiguration().delimitAll();
return DBIdentifier.newIdentifier((delimit ? name : caseName), id, false, delimit, 
  !delimCase.equals(CASE_PRESERVE));
origin: org.apache.openjpa/openjpa-all

public String convert(IdentifierConfiguration config, String rule, String name) {
  // Already using same delimiter, no need to convert
  if (!needsConversion(config)) {
    return name;
  }
  // Otherwise, remove delimiters and add appropriate delimiters
  IdentifierRule orule = getIdentifierConfiguration().getIdentifierRule(rule);
  IdentifierRule nrule = config.getIdentifierRule(rule);
  boolean delimit = isDelimited(config, orule, name);
  if (delimit) {
    name = removeDelimiters(config, orule, name, config.getLeadingDelimiter(), 
      config.getTrailingDelimiter());
    return delimit(getIdentifierConfiguration(), nrule, name, delimit);
  }
  return name;
}
origin: org.apache.openejb.patch/openjpa

String delimCase = getIdentifierConfiguration().getDelimitedCase();
if (/* getNamingConfiguration().delimitAll() || */ name.isDelimited()) {
  if (CASE_UPPER.equals(delimCase)) {
if (!getIdentifierConfiguration().delimitAll()) {
  String schemaCase = getIdentifierConfiguration().getSchemaCase();
  if (CASE_LOWER.equals(schemaCase))
    return DBIdentifier.toLower(sName);
origin: org.apache.openjpa/openjpa-all

/**
 * Converts the identifier to a format appropriate for the configuration using
 * the specified naming rule.
 * @param delimit If false, do not delimit.  Otherwise, delimit if necessary.
 */
private String toDBName(String rule, String name, boolean delimit) {
  if (name == null) {
    return null;
  }
  if (getIdentifierConfiguration().getSupportsDelimitedIdentifiers() && delimit && 
    getIdentifierConfiguration().delimitAll() && !Normalizer.isDelimited(name)) {
    return delimit(rule, name, true);
  }
  return convert(Normalizer.getNamingConfiguration(), rule, name);
}
origin: org.apache.openjpa/openjpa-lib

public String combineFull(IdentifierConfiguration config, String rule, String fullName) {
  if (!needsConversion(config)) {
    return fullName;
  }
  // Split
  String[] names = splitName(config, rule, fullName);
  // Convert
  for (int i = 0; i < names.length; i++) {
    names[i] = convert(config, rule, names[i]);
  }
  // Join
  return joinNames(config, config.getIdentifierRule(rule), names, config.getIdentifierDelimiter());
}    
origin: org.apache.openjpa/openjpa-all

private IdentifierRule[] getNamingRules(String[] rules) {
  IdentifierRule[] nrules = new IdentifierRule[rules.length];
  for (int i = 0; i < rules.length; i++) {
    nrules[i] = _config.getIdentifierRule(rules[i]);
  }
  return nrules;
}
origin: org.apache.openejb.patch/openjpa-jdbc

/**
 * Converts the identifier to a format appropriate for the configuration using
 * the default naming rule.
 * @param delimit If false, do not delimit.  Otherwise, delimit if necessary.
 */
public String toDBName(String name, boolean delimit) {
  return toDBName(getIdentifierConfiguration().getDefaultIdentifierRule().getName(), name, delimit);
}
org.apache.openjpa.lib.identifierIdentifierConfiguration

Javadoc

The IdentifierConfiguration interface. Implementers of this interface supply naming configuration information to consumers of names/identifiers.

Most used methods

  • getIdentifierRule
    Returns a naming rule or null if the rule is not found.
  • getLeadingDelimiter
    Returns the leading delimiter value to use when delimiting a name.
  • getTrailingDelimiter
    Returns the trailing delimiter value to use when delimiting a name.
  • delimitAll
    Returns true if global name delimiting is enabled.
  • getDefaultIdentifierRule
    Gets the default naming rule
  • getDelimitedCase
    Returns the case that is used when delimiting.
  • getSchemaCase
    Returns the case that is used when delimiters are not used.
  • getSupportsDelimitedIdentifiers
    Returns true if delimiting is supported
  • getConversionKey
    Returns a key that can be used to determine whether conversion should take place. Id configurations
  • getIdentifierConcatenator
    Returns the value used to concatenate multiple names together. For example: "_" used in TABLE1_TABLE
  • getIdentifierDelimiter
    Returns the value used to delimit between individual names. For example: "." used in MYSCHEMA.MYTABL
  • getIdentifierDelimiter

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSystemService (Context)
  • scheduleAtFixedRate (Timer)
  • setContentView (Activity)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • ImageIO (javax.imageio)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now