org.hibernate.Criteria.getAlias()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(184)

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

Criteria.getAlias介绍

[英]Get the alias of the entity encapsulated by this criteria instance.
[中]获取此条件实例封装的实体的别名。

代码示例

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

/**
 * Obtain the alias associated with this DetachedCriteria
 *
 * @return The alias
 */
public String getAlias() {
  return criteria.getAlias();
}

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

private void createAliasCriteriaMap() {
  aliasCriteriaMap.put( rootCriteria.getAlias(), rootCriteria );
  Iterator<CriteriaImpl.Subcriteria> iter = rootCriteria.iterateSubcriteria();
  while ( iter.hasNext() ) {
    Criteria subcriteria = iter.next();
    if ( subcriteria.getAlias() != null ) {
      Object old = aliasCriteriaMap.put( subcriteria.getAlias(), subcriteria );
      if ( old != null ) {
        throw new QueryException( "duplicate alias: " + subcriteria.getAlias() );
      }
    }
  }
}

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

private void createCriteriaSQLAliasMap() {
  int i = 0;
  for(final Criteria crit : criteriaInfoMap.keySet()){
    final CriteriaInfoProvider value = criteriaInfoMap.get( crit );
    String alias = crit.getAlias();
    if ( alias == null ) {
      // the entity name
      alias = value.getName();
    }
    criteriaSQLAliasMap.put( crit, StringHelper.generateAlias( alias, i++ ) );
  }
  criteriaSQLAliasMap.put( rootCriteria, rootSQLAlias );
}

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

includeInResultRowList.add( subcriteria != null && subcriteria.getAlias() != null );
if ( sqlAlias != null ) {
  if ( subcriteria.getAlias() != null ) {
    userAliasList.add( subcriteria.getAlias() );
    resultTypeList.add( translator.getResultType( subcriteria ) );

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

public String getAlias() {
  return criteria.getAlias();
}

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

public String getAlias() {
  return criteria.getAlias();
}

代码示例来源:origin: ezbz/projectx

@Override
public String getAlias() {
 return criteria.getAlias();
}

代码示例来源:origin: theonedev/onedev

public String getAlias() {
  return criteria.getAlias();
}

代码示例来源:origin: TGAC/miso-lims

@Override
public String getAlias() {
 return backingCriteria.getAlias();
}

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

public String getAlias() {
  return criteria.getAlias();
}

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

private void createAliasCriteriaMap() {
  aliasCriteriaMap.put( rootCriteria.getAlias(), rootCriteria );
  Iterator iter = rootCriteria.iterateSubcriteria();
  while ( iter.hasNext() ) {
    Criteria subcriteria = ( Criteria ) iter.next();
    if ( subcriteria.getAlias() != null ) {
      Object old = aliasCriteriaMap.put( subcriteria.getAlias(), subcriteria );
      if ( old != null ) {
        throw new QueryException( "duplicate alias: " + subcriteria.getAlias() );
      }
    }
  }
}

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

private void createAliasCriteriaMap() {
  aliasCriteriaMap.put( rootCriteria.getAlias(), rootCriteria );
  Iterator iter = rootCriteria.iterateSubcriteria();
  while ( iter.hasNext() ) {
    Criteria subcriteria = (Criteria) iter.next();
    if ( subcriteria.getAlias()!=null ) {
      Object old = aliasCriteriaMap.put( subcriteria.getAlias(), subcriteria );
      if (old!=null) {
        throw new QueryException("duplicate alias: " + subcriteria.getAlias() );
      }
    }
  }
}

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

private void createCriteriaSQLAliasMap() {
  int i=0;
  Iterator criteriaIterator = criteriaEntityNames.entrySet().iterator();
  while ( criteriaIterator.hasNext() ) {
    Map.Entry me = (Map.Entry) criteriaIterator.next();
    Criteria crit = (Criteria) me.getKey();
    String alias = crit.getAlias();
    if (alias==null) alias = (String) me.getValue(); // the entity name
    criteriaSQLAliasMap.put( crit, StringHelper.generateAlias(alias, i++) );
  }
  criteriaSQLAliasMap.put( rootCriteria, rootSQLAlias );
}

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

private void createAliasCriteriaMap() {
  aliasCriteriaMap.put( rootCriteria.getAlias(), rootCriteria );
  Iterator iter = rootCriteria.iterateSubcriteria();
  while ( iter.hasNext() ) {
    Criteria subcriteria = ( Criteria ) iter.next();
    if ( subcriteria.getAlias() != null ) {
      Object old = aliasCriteriaMap.put( subcriteria.getAlias(), subcriteria );
      if ( old != null ) {
        throw new QueryException( "duplicate alias: " + subcriteria.getAlias() );
      }
    }
  }
}

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

private void createAliasCriteriaMap() {
  aliasCriteriaMap.put( rootCriteria.getAlias(), rootCriteria );
  Iterator iter = rootCriteria.iterateSubcriteria();
  while ( iter.hasNext() ) {
    Criteria subcriteria = ( Criteria ) iter.next();
    if ( subcriteria.getAlias() != null ) {
      Object old = aliasCriteriaMap.put( subcriteria.getAlias(), subcriteria );
      if ( old != null ) {
        throw new QueryException( "duplicate alias: " + subcriteria.getAlias() );
      }
    }
  }
}

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

private void createCriteriaSQLAliasMap() {
  int i = 0;
  Iterator criteriaIterator = criteriaEntityNames.entrySet().iterator();
  while ( criteriaIterator.hasNext() ) {
    Map.Entry me = ( Map.Entry ) criteriaIterator.next();
    Criteria crit = ( Criteria ) me.getKey();
    String alias = crit.getAlias();
    if ( alias == null ) {
      alias = ( String ) me.getValue(); // the entity name
    }
    criteriaSQLAliasMap.put( crit, StringHelper.generateAlias( alias, i++ ) );
  }
  criteriaSQLAliasMap.put( rootCriteria, rootSQLAlias );
}

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

private void createCriteriaSQLAliasMap() {
  int i = 0;
  Iterator criteriaIterator = criteriaInfoMap.entrySet().iterator();
  while ( criteriaIterator.hasNext() ) {
    Map.Entry me = ( Map.Entry ) criteriaIterator.next();
    Criteria crit = ( Criteria ) me.getKey();
    String alias = crit.getAlias();
    if ( alias == null ) {
      alias = (( CriteriaInfoProvider ) me.getValue()).getName(); // the entity name
    }
    criteriaSQLAliasMap.put( crit, StringHelper.generateAlias( alias, i++ ) );
  }
  criteriaSQLAliasMap.put( rootCriteria, rootSQLAlias );
}

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

private void createCriteriaSQLAliasMap() {
  int i = 0;
  Iterator criteriaIterator = criteriaInfoMap.entrySet().iterator();
  while ( criteriaIterator.hasNext() ) {
    Map.Entry me = ( Map.Entry ) criteriaIterator.next();
    Criteria crit = ( Criteria ) me.getKey();
    String alias = crit.getAlias();
    if ( alias == null ) {
      alias = (( CriteriaInfoProvider ) me.getValue()).getName(); // the entity name
    }
    criteriaSQLAliasMap.put( crit, StringHelper.generateAlias( alias, i++ ) );
  }
  criteriaSQLAliasMap.put( rootCriteria, rootSQLAlias );
}

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

protected String generateTableAlias(int n, String path, Joinable joinable) {
  if ( joinable.consumesEntityAlias() ) {
    final Criteria subcriteria = translator.getCriteria(path);
    String sqlAlias = subcriteria==null ? null : translator.getSQLAlias(subcriteria);
    if (sqlAlias!=null) {
      userAliasList.add( subcriteria.getAlias() ); //alias may be null
      return sqlAlias; //EARLY EXIT
    }
    else {
      userAliasList.add(null);
    }
  }
  return super.generateTableAlias( n + translator.getSQLAliasCount(), path, joinable );
}

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

protected String generateTableAlias(int n, String path, Joinable joinable) {
  if ( joinable.consumesEntityAlias() ) {
    final Criteria subcriteria = translator.getCriteria(path);
    String sqlAlias = subcriteria==null ? null : translator.getSQLAlias(subcriteria);
    if (sqlAlias!=null) {
      userAliasList.add( subcriteria.getAlias() ); //alias may be null
      return sqlAlias; //EARLY EXIT
    }
    else {
      userAliasList.add(null);
    }
  }
  return super.generateTableAlias( n + translator.getSQLAliasCount(), path, joinable );
}

相关文章