/** * @param path * @return */ public BooleanPath get(BooleanPath path) { BooleanPath newPath = getBoolean(toString(path)); return addMetadataOf(newPath, path); }
/** * @param path * @return */ public StringPath get(StringPath path) { StringPath newPath = getString(toString(path)); return addMetadataOf(newPath, path); }
/** * @param <A> * @param path */ @SuppressWarnings("unchecked") public <A extends Comparable<?>> TimePath<A> get(TimePath<A> path) { TimePath<A> newPath = getTime(toString(path), (Class<A>)path.getType()); return addMetadataOf(newPath, path); }
/** * @param <A> * @param path * @return */ @SuppressWarnings("unchecked") public <A extends Comparable<?>> DatePath<A> get(DatePath<A> path) { DatePath<A> newPath = getDate(toString(path), (Class<A>)path.getType()); return addMetadataOf(newPath, path); }
/** * @param <A> * @param path * @return */ @SuppressWarnings("unchecked") public <A extends Enum<A>> EnumPath<A> get(EnumPath<A> path) { EnumPath<A> newPath = getEnum(toString(path), (Class<A>)path.getType()); return addMetadataOf(newPath, path); }
/** * @param <A> * @param path * @return */ @SuppressWarnings("unchecked") public <A extends Comparable<?>> ComparablePath<A> get(ComparablePath<A> path) { ComparablePath<A> newPath = getComparable(toString(path), (Class<A>)path.getType()); return addMetadataOf(newPath, path); }
/** * @param <A> * @param path * @return */ @SuppressWarnings("unchecked") public <A extends Comparable<?>> DateTimePath<A> get(DateTimePath<A> path) { DateTimePath<A> newPath = getDateTime(toString(path), (Class<A>)path.getType()); return addMetadataOf(newPath, path); }
/** * @param <A> * @param path * @return */ @SuppressWarnings("unchecked") public <A extends Number & Comparable<?>> NumberPath<A> get(NumberPath<A> path) { NumberPath<A> newPath = getNumber(toString(path), (Class<A>)path.getType()); return addMetadataOf(newPath, path); }
/** * @param <A> * @param path * @return */ @SuppressWarnings("unchecked") public <A> SimplePath<A> get(Path<A> path) { SimplePath<A> newPath = getSimple(toString(path), (Class<A>)path.getType()); return addMetadataOf(newPath, path); }
/** * {@inheritDoc} */ @Override public <T> TypeDescriptor getTypeDescriptor(String fieldName, PathBuilder<T> entity) { Class<?> entityType = entity.getType(); if (entityType == Object.class) { // Remove from path the root "entity" alias String fromRootPath = entity.toString().replaceFirst("^[^.]+[.]", ""); TypeDescriptor fromRoot = getTypeDescriptor(fromRootPath, entity .getRoot().getType()); if (fromRoot == null) { return null; } entityType = fromRoot.getType(); } return getTypeDescriptor(fieldName, entityType); }
/** * Obtains the descriptor of the filtered field * * @param fieldName * @param entity * @return */ public static <T> TypeDescriptor getTypeDescriptor(String fieldName, PathBuilder<T> entity) { Class<?> entityType = entity.getType(); if (entityType == Object.class) { // Remove from path the root "entity" alias String fromRootPath = entity.toString().replaceFirst("^[^.]+[.]", ""); TypeDescriptor fromRoot = getTypeDescriptor(fromRootPath, entity .getRoot().getType()); if (fromRoot == null) { return null; } entityType = fromRoot.getType(); } return getTypeDescriptor(fieldName, entityType); }