org.hibernate.sql.Alias类的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(220)

本文整理了Java中org.hibernate.sql.Alias类的一些代码示例,展示了Alias类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Alias类的具体详情如下:
包路径:org.hibernate.sql.Alias
类名称:Alias

Alias介绍

[英]An alias generator for SQL identifiers
[中]SQL标识符的别名生成器

代码示例

代码示例来源:origin: hibernate/hibernate-orm

@Override
public String getIdentifierColumnAlias(String suffix) {
  if ( hasIdentifier ) {
    return new Alias( suffix ).toAliasString( identifierColumnAlias );
  }
  else {
    return null;
  }
}

代码示例来源:origin: hibernate/hibernate-orm

public String toUnquotedAliasString(String sqlIdentifier) {
  return getUnquotedAliasString(sqlIdentifier);
}

代码示例来源:origin: hibernate/hibernate-orm

@Override
public String[] getCollectionPropertyColumnAliases(String propertyName, String suffix) {
  String[] rawAliases = (String[]) collectionPropertyColumnAliases.get( propertyName );
  if ( rawAliases == null ) {
    return null;
  }
  String[] result = new String[rawAliases.length];
  for ( int i = 0; i < rawAliases.length; i++ ) {
    result[i] = new Alias( suffix ).toUnquotedAliasString( rawAliases[i] );
  }
  return result;
}

代码示例来源:origin: hibernate/hibernate-orm

@Override
public String[] getIndexColumnAliases(String suffix) {
  if ( hasIndex ) {
    return new Alias( suffix ).toAliasStrings( indexColumnAliases );
  }
  else {
    return null;
  }
}

代码示例来源:origin: hibernate/hibernate-orm

public String[] getPropertyAliases(String suffix, int i) {
  // NOTE: this assumes something about how propertySelectFragment is implemented by the subclass!
  return new Alias( suffix ).toUnquotedAliasStrings( propertyColumnAliases[i] );
}

代码示例来源:origin: hibernate/hibernate-orm

public String[] toAliasStrings(String[] sqlIdentifiers) {
  String[] aliases = new String[ sqlIdentifiers.length ];
  for ( int i=0; i<sqlIdentifiers.length; i++ ) {
    aliases[i] = toAliasString(sqlIdentifiers[i]);
  }
  return aliases;
}

代码示例来源:origin: hibernate/hibernate-orm

public String[] toUnquotedAliasStrings(String[] sqlIdentifiers) {
  String[] aliases = new String[ sqlIdentifiers.length ];
  for ( int i=0; i<sqlIdentifiers.length; i++ ) {
    aliases[i] = toUnquotedAliasString(sqlIdentifiers[i]);
  }
  return aliases;
}

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

public String[] getKeyColumnAliases(String suffix) {
  return new Alias( suffix ).toAliasStrings( keyColumnAliases );
}

代码示例来源:origin: hibernate/hibernate-orm

@Override
public String[] getKeyColumnAliases(String suffix) {
  return new Alias( suffix ).toAliasStrings( keyColumnAliases );
}

代码示例来源:origin: hibernate/hibernate-orm

public void createPrimaryKey() {
  //Primary key constraint
  PrimaryKey pk = new PrimaryKey( table );
  pk.setName( PK_ALIAS.toAliasString( table.getName() ) );
  table.setPrimaryKey(pk);
  pk.addColumns( getKey().getColumnIterator() );
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

public String[] getPropertyAliases(String suffix, int i) {
  // NOTE: this assumes something about how propertySelectFragment is implemented by the subclass!
  return new Alias( suffix ).toUnquotedAliasStrings( propertyColumnAliases[i] );
}

代码示例来源:origin: org.hibernate.orm/hibernate-core

public String[] toUnquotedAliasStrings(String[] sqlIdentifiers) {
  String[] aliases = new String[ sqlIdentifiers.length ];
  for ( int i=0; i<sqlIdentifiers.length; i++ ) {
    aliases[i] = toUnquotedAliasString(sqlIdentifiers[i]);
  }
  return aliases;
}

代码示例来源:origin: hibernate/hibernate-orm

public CaseFragment setReturnColumnName(String returnColumnName, String suffix) {
  return setReturnColumnName( new Alias(suffix).toAliasString(returnColumnName) );
}

代码示例来源:origin: hibernate/hibernate-orm

@Override
public String[] getElementColumnAliases(String suffix) {
  return new Alias( suffix ).toAliasStrings( elementColumnAliases );
}

代码示例来源:origin: hibernate/hibernate-orm

public void createPrimaryKey() {
  //Primary key constraint
  final Table table = getTable();
  PrimaryKey pk = new PrimaryKey( table );
  pk.setName( PK_ALIAS.toAliasString( table.getName() ) );
  table.setPrimaryKey( pk );
  pk.addColumns( getKey().getColumnIterator() );
}

代码示例来源:origin: hibernate/hibernate-orm

public String[] getSubclassPropertyColumnAliases(String propertyName, String suffix) {
  String[] rawAliases = (String[]) subclassPropertyAliases.get( propertyName );
  if ( rawAliases == null ) {
    return null;
  }
  String[] result = new String[rawAliases.length];
  for ( int i = 0; i < rawAliases.length; i++ ) {
    result[i] = new Alias( suffix ).toUnquotedAliasString( rawAliases[i] );
  }
  return result;
}

代码示例来源:origin: hibernate/hibernate

public String[] getPropertyAliases(String suffix, int i) {
  // NOTE: this assumes something about how propertySelectFragment is implemented by the subclass!
  return new Alias( suffix ).toUnquotedAliasStrings( propertyColumnAliases[i] );
}

代码示例来源:origin: hibernate/hibernate-orm

private String getUnquotedAliasString(String sqlIdentifier) {
  char begin = sqlIdentifier.charAt(0);
  int quoteType = Dialect.QUOTE.indexOf(begin);
  return getUnquotedAliasString(sqlIdentifier, quoteType);
}

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

public String[] toUnquotedAliasStrings(String[] sqlIdentifiers) {
  String[] aliases = new String[ sqlIdentifiers.length ];
  for ( int i=0; i<sqlIdentifiers.length; i++ ) {
    aliases[i] = toUnquotedAliasString(sqlIdentifiers[i]);
  }
  return aliases;
}

代码示例来源:origin: hibernate/hibernate-orm

public String getDiscriminatorAlias(String suffix) {
  // NOTE: this assumes something about how propertySelectFragment is implemented by the subclass!
  // was toUnqotedAliasStrings( getdiscriminatorColumnName() ) before - now tried
  // to remove that unqoting and missing aliases..
  return entityMetamodel.hasSubclasses() ?
      new Alias( suffix ).toAliasString( getDiscriminatorAlias() ) :
      null;
}

相关文章