diff --git a/querydsl-core/src/main/java/com/mysema/query/support/Expressions.java b/querydsl-core/src/main/java/com/mysema/query/support/Expressions.java index 0b192f627..4062a67aa 100644 --- a/querydsl-core/src/main/java/com/mysema/query/support/Expressions.java +++ b/querydsl-core/src/main/java/com/mysema/query/support/Expressions.java @@ -9,12 +9,20 @@ import com.mysema.query.types.Operator; import com.mysema.query.types.Path; import com.mysema.query.types.PathMetadataFactory; import com.mysema.query.types.expr.BooleanExpression; +import com.mysema.query.types.expr.CaseBuilder; import com.mysema.query.types.expr.ComparableExpression; import com.mysema.query.types.expr.NumberExpression; import com.mysema.query.types.expr.SimpleExpression; import com.mysema.query.types.expr.SimpleOperation; import com.mysema.query.types.expr.StringExpression; +import com.mysema.query.types.path.BooleanPath; +import com.mysema.query.types.path.ComparablePath; +import com.mysema.query.types.path.DatePath; +import com.mysema.query.types.path.DateTimePath; +import com.mysema.query.types.path.NumberPath; import com.mysema.query.types.path.SimplePath; +import com.mysema.query.types.path.StringPath; +import com.mysema.query.types.path.TimePath; import com.mysema.query.types.query.SimpleSubQuery; import com.mysema.query.types.template.BooleanTemplate; import com.mysema.query.types.template.ComparableTemplate; @@ -79,6 +87,74 @@ public final class Expressions { public static SimplePath path(Class type, Path parent, String property) { return new SimplePath(type, PathMetadataFactory.forProperty(parent, property)); } + + @SuppressWarnings("unchecked") + public static ComparablePath comparablePath(Class type, String variable) { + return new ComparablePath(type, PathMetadataFactory.forVariable(variable)); + } + + @SuppressWarnings("unchecked") + public static ComparablePath comparablePath(Class type, Path parent, String property) { + return new ComparablePath(type, PathMetadataFactory.forProperty(parent, property)); + } + + @SuppressWarnings("unchecked") + public static DatePath datePath(Class type, String variable) { + return new DatePath(type, PathMetadataFactory.forVariable(variable)); + } + + @SuppressWarnings("unchecked") + public static DatePath datePath(Class type, Path parent, String property) { + return new DatePath(type, PathMetadataFactory.forProperty(parent, property)); + } + + @SuppressWarnings("unchecked") + public static DateTimePath dateTimePath(Class type, String variable) { + return new DateTimePath(type, PathMetadataFactory.forVariable(variable)); + } + + @SuppressWarnings("unchecked") + public static DateTimePath dateTimePath(Class type, Path parent, String property) { + return new DateTimePath(type, PathMetadataFactory.forProperty(parent, property)); + } + + @SuppressWarnings("unchecked") + public static TimePath timePath(Class type, String variable) { + return new TimePath(type, PathMetadataFactory.forVariable(variable)); + } + + @SuppressWarnings("unchecked") + public static TimePath timePath(Class type, Path parent, String property) { + return new TimePath(type, PathMetadataFactory.forProperty(parent, property)); + } + + public static > NumberPath numberPath(Class type, String variable) { + return new NumberPath(type, PathMetadataFactory.forVariable(variable)); + } + + public static > NumberPath numberPath(Class type, Path parent, String property) { + return new NumberPath(type, PathMetadataFactory.forProperty(parent, property)); + } + + public static StringPath stringPath(String variable) { + return new StringPath(PathMetadataFactory.forVariable(variable)); + } + + public static StringPath stringPath(Path parent, String property) { + return new StringPath(PathMetadataFactory.forProperty(parent, property)); + } + + public static BooleanPath booleanPath(String variable) { + return new BooleanPath(PathMetadataFactory.forVariable(variable)); + } + + public static BooleanPath booleanPath(Path parent, String property) { + return new BooleanPath(PathMetadataFactory.forProperty(parent, property)); + } + + public static CaseBuilder cases() { + return new CaseBuilder(); + } private Expressions(){}