本文整理汇总了Java中javax.persistence.criteria.Selection.alias方法的典型用法代码示例。如果您正苦于以下问题:Java Selection.alias方法的具体用法?Java Selection.alias怎么用?Java Selection.alias使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.persistence.criteria.Selection
的用法示例。
在下文中一共展示了Selection.alias方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAlias
import javax.persistence.criteria.Selection; //导入方法依赖的package包/类
private synchronized String getAlias(Selection<?> selection) {
if (selection != null) {
String alias = selection.getAlias();
if (alias == null) {
if (aliasCount >= 1000) {
aliasCount = 0;
}
alias = "shopGeneratedAlias" + aliasCount++;
selection.alias(alias);
}
return alias;
}
return null;
}
示例2: getSelectedPath
import javax.persistence.criteria.Selection; //导入方法依赖的package包/类
private Path getSelectedPath(int index, Selection<?> selection) {
if (selection instanceof Expression) {
return getSelectedPath(index, (Expression<?>)selection);
}
if (selection.getAlias() == null) {
selection.alias("alias" + index);
}
return new Path(selection.getAlias());
}
示例3: getOrCreateAlias
import javax.persistence.criteria.Selection; //导入方法依赖的package包/类
private <T> String getOrCreateAlias(Selection<T> selection, int counter) {
String alias = selection.getAlias();
if (alias == null) {
alias = config.getAliasPrefix() + counter;
selection.alias(alias);
}
return alias;
}
示例4: getOrCreateAlias
import javax.persistence.criteria.Selection; //导入方法依赖的package包/类
/**
* Gets The result alias, if none set a default one and return it
* @param selection
* @return root alias or generated one
*/
public static synchronized <T> String getOrCreateAlias(Selection<T> selection) {
// reset alias count
if (aliasCount > 1000)
aliasCount = 0;
String alias = selection.getAlias();
if (alias == null) {
alias = "JDAL_generatedAlias" + aliasCount++;
selection.alias(alias);
}
return alias;
}
示例5: fixAlias
import javax.persistence.criteria.Selection; //导入方法依赖的package包/类
private <T> PathImplementor<T> fixAlias(final Selection<T> join, final AtomicInteger integer) {
if (join.getAlias() == null) {
join.alias("_" + integer.incrementAndGet());
}
return (PathImplementor<T>) join;
}
示例6: copyAlias
import javax.persistence.criteria.Selection; //导入方法依赖的package包/类
private void copyAlias(Selection<?> from, Selection<?> to, int counter) {
to.alias(getOrCreateAlias(from, counter));
}