/** * Creates a new PathBuilder instance * * @param type type of the expression * @param variable variable name * @param validator validator for property creation */ public PathBuilder(Class<? extends T> type, String variable, PathBuilderValidator validator) { this(type, PathMetadataFactory.forVariable(variable), validator); }
/** * Creates a new PathBuilder instance * * @param type type of the expression * @param variable variable name */ public PathBuilder(Class<? extends T> type, String variable) { this(type, PathMetadataFactory.forVariable(variable), PathBuilderValidator.DEFAULT); }
@SuppressWarnings("unchecked") public GeometryCollectionPath(String var) { this((Class<? extends T>) GeometryCollection.class, PathMetadataFactory.forVariable(var)); }
@SuppressWarnings("unchecked") public JTSLinearRingPath(String var) { this((Class<? extends T>) LinearRing.class, PathMetadataFactory.forVariable(var)); }
/** * Create a new Path expression * * @param variable variable name * @return path expression */ public static BooleanPath booleanPath(String variable) { return new BooleanPath(PathMetadataFactory.forVariable(variable)); }
/** * Create a new Path expression * * @param type type of expression * @param variable variable name * @return path expression */ public static <T> DslPath<T> dslPath(Class<? extends T> type, String variable) { return new DslPath<T>(type, PathMetadataFactory.forVariable(variable)); }
/** * Create a new Path expression * * @param type type of expression * @param variable variable name * @return path expression */ public static <T extends Comparable<?>> DateTimePath<T> dateTimePath(Class<? extends T> type, String variable) { return new DateTimePath<T>(type, PathMetadataFactory.forVariable(variable)); }
/** * Create a new Path expression * * @param type type of expression * @param variable variable name * @return path expression */ public static <T extends Comparable<?>> ComparablePath<T> comparablePath(Class<? extends T> type, String variable) { return new ComparablePath<T>(type, PathMetadataFactory.forVariable(variable)); }
/** * Create a new Path expression * * @param type type of expression * @param variable variable name * @return path expression */ public static <T extends Comparable<?>> DatePath<T> datePath(Class<? extends T> type, String variable) { return new DatePath<T>(type, PathMetadataFactory.forVariable(variable)); }
/** * Create a new Path expression * * @param type type of expression * @param variable variable name * @return path expression */ public static <T extends Comparable<?>> ComparableEntityPath<T> comparableEntityPath(Class<? extends T> type, String variable) { return new ComparableEntityPath<T>(type, PathMetadataFactory.forVariable(variable)); }
/** * Create a new Path expression * * @param type type of expression * @param variable variable name * @return path expression */ public static <T extends Comparable<?>> TimePath<T> timePath(Class<? extends T> type, String variable) { return new TimePath<T>(type, PathMetadataFactory.forVariable(variable)); }
/** * Create a new Path expression * * @param type type of expression * @param variable variable name * @return path expression */ public static <T extends Number & Comparable<?>> NumberPath<T> numberPath(Class<? extends T> type, String variable) { return new NumberPath<T>(type, PathMetadataFactory.forVariable(variable)); }
/** * Create a new Path expression * * @param variable variable name * @return path expression */ public static StringPath stringPath(String variable) { return new StringPath(PathMetadataFactory.forVariable(variable)); }
/** * Create a new Path expression * * @param type type of expression * @param variable variable name * @return path expression */ public static <T> SimplePath<T> simplePath(Class<? extends T> type, String variable) { return new SimplePath<T>(type, PathMetadataFactory.forVariable(variable)); }
/** * Create a new Path expression * * @param type type of expression * @param variable variable name * @return path expression */ public static <T extends Enum<T>> EnumPath<T> enumPath(Class<? extends T> type, String variable) { return new EnumPath<T>(type, PathMetadataFactory.forVariable(variable)); }
@SuppressWarnings("unchecked") public QCommonIdentifiable(String variable) { super((Class) CommonIdentifiable.class, forVariable(variable)); }
@SuppressWarnings("unchecked") public QCommonIdentifiable(String variable) { super((Class) CommonIdentifiable.class, forVariable(variable)); }
@Override public EntityPath<?> load(Pair<Class<?>, String> input) { return (EntityPath<?>) pathFactory.createEntityPath( input.getFirst(), PathMetadataFactory.forVariable(input.getSecond())); } });
@Test public void as_class_with_inits_cached() { beanPath = new BeanPath<BeanPathTest>(BeanPathTest.class, PathMetadataFactory.forVariable("p"), PathInits.DEFAULT); MyBeanPath otherPath = beanPath.as(MyBeanPath.class); // assertEquals(beanPath, otherPath); assertTrue(otherPath == beanPath.as(MyBeanPath.class)); }
@Test @Ignore public void as_class_with_inits() { beanPath = new BeanPath<BeanPathTest>(BeanPathTest.class, PathMetadataFactory.forVariable("p"), PathInits.DEFAULT); MyBeanPath otherPath = beanPath.as(MyBeanPath.class); assertEquals(beanPath, otherPath); }