private <T> PathImplementor<T> fixAlias(final Selection<T> join, final AtomicInteger integer) { if (join.getAlias() == null) { join.alias("_" + integer.incrementAndGet()); } return (PathImplementor<T>) join; }
public static Selection<?> as(Entry<String, Expression<?>> mappingEntry) { Selection<?> selection = mappingEntry.getValue(); return selection.getAlias() != null ? selection : selection.alias(AS + mappingEntry.getKey().replace('.', '$')); }
/** * 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; }
selection.alias(criteria.getPropertyAlias());