本文整理汇总了Java中org.hibernate.Criteria.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Criteria.equals方法的具体用法?Java Criteria.equals怎么用?Java Criteria.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hibernate.Criteria
的用法示例。
在下文中一共展示了Criteria.equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getWholeAssociationPath
import org.hibernate.Criteria; //导入方法依赖的package包/类
private String getWholeAssociationPath(CriteriaImpl.Subcriteria subcriteria) {
String path = subcriteria.getPath();
// some messy, complex stuff here, since createCriteria() can take an
// aliased path, or a path rooted at the creating criteria instance
Criteria parent = null;
if ( path.indexOf( '.' ) > 0 ) {
// if it is a compound path
String testAlias = StringHelper.root( path );
if ( !testAlias.equals( subcriteria.getAlias() ) ) {
// and the qualifier is not the alias of this criteria
// -> check to see if we belong to some criteria other
// than the one that created us
parent = aliasCriteriaMap.get( testAlias );
}
}
if ( parent == null ) {
// otherwise assume the parent is the the criteria that created us
parent = subcriteria.getParent();
}
else {
path = StringHelper.unroot( path );
}
if ( parent.equals( rootCriteria ) ) {
// if its the root criteria, we are done
return path;
}
else {
// otherwise, recurse
return getWholeAssociationPath( ( CriteriaImpl.Subcriteria ) parent ) + '.' + path;
}
}
示例2: getWholeAssociationPath
import org.hibernate.Criteria; //导入方法依赖的package包/类
private String getWholeAssociationPath(CustomCriteriaImpl.Subcriteria subcriteria) {
String path = subcriteria.getPath();
// some messy, complex stuff here, since createCriteria() can take an
// aliased path, or a path rooted at the creating criteria instance
Criteria parent = null;
if ( path.indexOf( '.' ) > 0 ) {
// if it is a compound path
String testAlias = StringHelper.root( path );
if ( !testAlias.equals( subcriteria.getAlias() ) ) {
// and the qualifier is not the alias of this criteria
// -> check to see if we belong to some criteria other
// than the one that created us
parent = aliasCriteriaMap.get( testAlias );
}
}
if ( parent == null ) {
// otherwise assume the parent is the the criteria that created us
parent = subcriteria.getParent();
}
else {
path = StringHelper.unroot( path );
}
if ( parent.equals( rootCriteria ) ) {
// if its the root criteria, we are done
return path;
}
else {
// otherwise, recurse
return getWholeAssociationPath( (CustomCriteriaImpl.Subcriteria) parent ) + '.' + path;
}
}