/** * Create a new variable path * * @param arg alias * @param <D> * @return expression */ @SuppressWarnings("unchecked") public static <D extends Number & Comparable<D>> NumberPath<D> var(D arg) { return Expressions.numberPath( (Class<D>) arg.getClass(), "var" + arg.getClass().getSimpleName() + arg); }
/** * Create a new variable path * * @param arg alias * @param <D> * @return expression */ @SuppressWarnings("unchecked") public static <D> EntityPathBase<D> var(D arg) { String var = "var" + arg.getClass().getSimpleName() + "_" + arg.toString().replace(' ', '_'); return new PathBuilder<D>((Class) arg.getClass(), var); }
/** * Create a new variable path * * @param arg alias * @param <D> * @return expression */ @SuppressWarnings("unchecked") public static <D extends Comparable<?>> ComparablePath<D> var(D arg) { return Expressions.comparablePath((Class<D>) arg.getClass(), "var" + arg); }