name
stringlengths 12
178
| code_snippet
stringlengths 8
36.5k
| score
float64 3.26
3.68
|
---|---|---|
querydsl_Expressions_asSimple_rdh
|
/**
* Create a new SimpleExpression
*
* @param value
* constant
* @return new SimpleExpression
*/
public static <T> SimpleExpression<T> asSimple(T value) {
return asSimple(constant(value));
}
| 3.26 |
querydsl_Expressions_operation_rdh
|
/**
* Create a new Operation expression
*
* @param type
* type of expression
* @param operator
* operator
* @param args
* operation arguments
* @return operation expression
*/
public static <T> SimpleOperation<T> operation(Class<? extends T> type, Operator operator, Expression<?>... args) {
return simpleOperation(type, operator, args);
}
| 3.26 |
querydsl_Expressions_datePath_rdh
|
/**
* Create a new Path expression
*
* @param type
* type of expression
* @param parent
* parent path
* @param property
* property name
* @return path expression
*/
public static <T extends Comparable<?>> DatePath<T> datePath(Class<? extends T> type, Path<?>
parent, String property) {
return new DatePath<T>(type, PathMetadataFactory.forProperty(parent, property));
}
| 3.26 |
querydsl_Expressions_constant_rdh
|
/**
* Create a Constant expression for the given value
*
* @param value
* constant
* @return constant expression
*/
public static <T> Expression<T> constant(T value)
{
return ConstantImpl.create(value);
}
| 3.26 |
querydsl_Expressions_dslOperation_rdh
|
/**
* Create a new Operation expression
*
* @param type
* type of expression
* @param operator
* operator
* @param args
* operation arguments
* @return operation expression
*/
public static <T> DslOperation<T> dslOperation(Class<? extends T> type, Operator operator, Expression<?>... args) {
return new DslOperation<T>(type, operator, args);
}
| 3.26 |
querydsl_Expressions_asDate_rdh
|
/**
* Create a new DateExpression
*
* @param value
* the date
* @return new DateExpression
*/
public static <T extends Comparable<?>> DateExpression<T> asDate(T value) {
return asDate(constant(value));
}
| 3.26 |
querydsl_Expressions_template_rdh
|
/**
* Create a new Template expression
*
* @param cl
* type of expression
* @param template
* template
* @param args
* template parameters
* @return template expression
*/
public static <T> SimpleTemplate<T> template(Class<? extends T> cl, Template template, List<?> args) {
return simpleTemplate(cl, template, args);
}
| 3.26 |
querydsl_Expressions_nullExpression_rdh
|
/**
* Create a null expression for the specified path
*
* @param path
* path for type cast
* @param <T>
* type of expression
* @return null expression
*/
public static <T> NullExpression<T> nullExpression(Path<T> path) {
return nullExpression();
}
| 3.26 |
querydsl_Expressions_comparableOperation_rdh
|
/**
* Create a new Operation expression
*
* @param type
* type of expression
* @param operator
* operator
* @param args
* operation arguments
* @return operation expression
*/
public static <T extends Comparable<?>> ComparableOperation<T> comparableOperation(Class<? extends T> type, Operator operator, Expression<?>... args) {
return new ComparableOperation<T>(type, operator, args);
}
| 3.26 |
querydsl_Expressions_arrayPath_rdh
|
/**
* Create a new Path expression
*
* @param arrayType
* array type
* @param metadata
* path metadata
* @param <A>
* array type
* @param <E>
* element type
* @return path expression
*/
public static <A, E> ArrayPath<A, E> arrayPath(Class<A> arrayType, PathMetadata metadata) {
return new ArrayPath<A, E>(arrayType, metadata);}
| 3.26 |
querydsl_Expressions_currentDate_rdh
|
/**
* Create an expression representing the current date as a DateExpression instance
*
* @return current date
*/
public static DateExpression<Date> currentDate() {
return DateExpression.currentDate();
}
| 3.26 |
querydsl_Expressions_booleanPath_rdh
|
/**
* Create a new Path expression
*
* @param metadata
* path metadata
* @return path expression
*/
public static BooleanPath booleanPath(PathMetadata metadata) {
return new BooleanPath(metadata);
}
| 3.26 |
querydsl_Expressions_comparablePath_rdh
|
/**
* Create a new Path expression
*
* @param type
* type of expression
* @param parent
* parent path
* @param property
* property path
* @return path expression
*/
public static <T extends Comparable<?>>
ComparablePath<T> comparablePath(Class<? extends T> type, Path<?> parent, String property) {
return new ComparablePath<T>(type, PathMetadataFactory.forProperty(parent, property));
}
| 3.26 |
querydsl_Expressions_timeOperation_rdh
|
/**
* Create a new Operation expression
*
* @param type
* type of expression
* @param operator
* operator
* @param args
* operation arguments
* @return operation expression
*/
public static <T extends Comparable<?>> TimeOperation<T> timeOperation(Class<? extends T> type, Operator operator, Expression<?>... args) {
return new TimeOperation<T>(type, operator, args);
}
| 3.26 |
querydsl_Expressions_enumPath_rdh
|
/**
* Create a new Path expression
*
* @param type
* type of expression
* @param metadata
* path metadata
* @param <T>
* type of expression
* @return path expression
*/
public static <T extends Enum<T>> EnumPath<T>
enumPath(Class<? extends T> type, PathMetadata metadata) {
return new EnumPath<T>(type, metadata);
}
| 3.26 |
querydsl_Expressions_booleanTemplate_rdh
|
/**
* Create a new Template expression
*
* @param template
* template
* @param args
* template parameters
* @return template expression
*/
public static BooleanTemplate booleanTemplate(Template template, List<?> args) {
return new BooleanTemplate(template, args);}
| 3.26 |
querydsl_Expressions_stringTemplate_rdh
|
/**
* Create a new Template expression
*
* @param template
* template
* @param args
* template parameters
* @return template expression
*/
public static StringTemplate stringTemplate(Template template, List<?> args) {
return new StringTemplate(template, args);
}
| 3.26 |
querydsl_Expressions_simpleTemplate_rdh
|
/**
* Create a new Template expression
*
* @param cl
* type of expression
* @param template
* template
* @param args
* template parameters
* @return template expression
*/
public static <T> SimpleTemplate<T> simpleTemplate(Class<? extends T> cl, Template template, List<?> args) {
return new SimpleTemplate<T>(cl, template, args);
}
| 3.26 |
querydsl_Expressions_enumTemplate_rdh
|
/**
* Create a new Template expression
*
* @param cl
* type of expression
* @param template
* template
* @param args
* template parameters
* @return template expression
*/
public static <T extends Enum<T>> EnumTemplate<T> enumTemplate(Class<? extends T> cl, Template template, List<?> args) {
return new EnumTemplate<T>(cl, template, args);
}
| 3.26 |
querydsl_Expressions_numberTemplate_rdh
|
/**
* Create a new Template expression
*
* @param cl
* type of expression
* @param template
* template
* @param args
* template parameters
* @return template expression
*/
public static <T extends Number & Comparable<?>> NumberTemplate<T> numberTemplate(Class<? extends T> cl, Template template, List<?> args) {
return new NumberTemplate<T>(cl, template, args);
}
| 3.26 |
querydsl_Expressions_mapPath_rdh
|
/**
* Create a new Path expression
*
* @param keyType
* key type
* @param valueType
* value type
* @param queryType
* value expression type
* @param metadata
* path metadata
* @param <K>
* key type
* @param <V>
* value type
* @param <E>
* value expression type
* @return path expression
*/
public static <K, V, E extends SimpleExpression<? super V>> MapPath<K, V, E> mapPath(Class<? super K> keyType, Class<? super V> valueType, Class<E> queryType, PathMetadata metadata) {
return new MapPath<K, V, E>(keyType, valueType, queryType, metadata);
}
| 3.26 |
querydsl_Expressions_as_rdh
|
/**
* Create a {@code source as alias} expression
*
* @param source
* source
* @param alias
* alias
* @return source as alias
*/
public static <D> SimpleExpression<D>
as(Expression<D> source, String alias) {return
as(source, ExpressionUtils.path(source.getType(), alias));
}
| 3.26 |
querydsl_Expressions_asEnum_rdh
|
/**
* Create a new EnumExpression
*
* @param value
* enum
* @return new EnumExpression
*/
public static <T extends Enum<T>>
EnumExpression<T> asEnum(T
value) {
return asEnum(constant(value));
}
| 3.26 |
querydsl_Expressions_dateOperation_rdh
|
/**
* Create a new Operation expression
*
* @param type
* type of expression
* @param operator
* operator
* @param args
* operation arguments
* @return operation expression
*/
public static <T extends Comparable<?>> DateOperation<T> dateOperation(Class<? extends T> type, Operator operator, Expression<?>... args) {
return new DateOperation<T>(type, operator, args);
}
| 3.26 |
querydsl_Expressions_dateTimeOperation_rdh
|
/**
* Create a new Operation expression
*
* @param type
* type of expression
* @param operator
* operator
* @param args
* operation arguments
* @return operation expression
*/
public static <T extends Comparable<?>> DateTimeOperation<T> dateTimeOperation(Class<? extends T> type, Operator operator, Expression<?>...
args) {
return new DateTimeOperation<T>(type, operator, args);
}
| 3.26 |
querydsl_Expressions_set_rdh
|
/**
* Combine the given expressions into a set expression
*
* @param clazz
* type of list expression
* @param exprs
* list elements
* @return list expression
*/
@SuppressWarnings("unchecked")
public static <T>
Expression<T> set(Class<T> clazz, Expression<?>... exprs) {Expression<T> rv = ((Expression<T>) (exprs[0]));
for (int i = 1; i < exprs.length; i++) {
rv = new SimpleOperation<T>(clazz, Ops.SET, rv, exprs[i]);
}
return rv;
}
| 3.26 |
querydsl_Expressions_m1_rdh
|
/**
* Create a new Template expression
*
* @param template
* template
* @param args
* template parameters
* @return template expression
*/
public static BooleanTemplate m1(String template, Object... args) {
return m1(createTemplate(template), Arrays.asList(args));
}
| 3.26 |
querydsl_Expressions_numberPath_rdh
|
/**
* Create new Path expression
*
* @param type
* type of expression
* @param metadata
* path metadata
* @param <T>
* type of expression
* @return path expression
*/
public static <T extends Number & Comparable<?>> NumberPath<T> numberPath(Class<? extends T> type, PathMetadata metadata) {
return new NumberPath<T>(type, metadata);}
| 3.26 |
querydsl_AbstractSQLInsertClause_executeWithKey_rdh
|
/**
* Execute the clause and return the generated key cast to the given type.
* If no rows were created, null is returned, otherwise the key of the first
* row is returned.
*
* @param <T>
* @param type
* type of key
* @return generated key
*/
public <T> T executeWithKey(Class<T> type) {
return executeWithKey(type, null);
}
| 3.26 |
querydsl_AbstractSQLInsertClause_setBatchToBulk_rdh
|
/**
* Set whether batches should be optimized into a single bulk operation.
* Will revert to batches, if bulk is not supported
*/public void setBatchToBulk(boolean b) {
this.batchToBulk = b && configuration.getTemplates().isBatchToBulkSupported();}
| 3.26 |
querydsl_AbstractSQLInsertClause_executeWithKeys_rdh
|
/**
* Execute the clause and return the generated keys as a ResultSet
*
* @return result set with generated keys
*/
public ResultSet executeWithKeys() {
context = startContext(connection(), metadata, entity);
try {
PreparedStatement stmt = null;
if (batches.isEmpty()) {
stmt = createStatement(true);
listeners.notifyInsert(entity, metadata, columns, values, subQuery);
listeners.preExecute(context);
stmt.executeUpdate();
listeners.executed(context);
} else if (batchToBulk) {
stmt = createStatement(true);
listeners.notifyInserts(entity, metadata, batches);
listeners.preExecute(context);
stmt.executeUpdate();
listeners.executed(context);
} else {
Collection<PreparedStatement> stmts = m2(true);
if ((stmts != null) && (stmts.size() > 1)) {
throw new IllegalStateException("executeWithKeys called with batch statement and multiple SQL strings");
}
stmt = stmts.iterator().next();
listeners.notifyInserts(entity, metadata, batches);
listeners.preExecute(context);
stmt.executeBatch();listeners.executed(context);
}
final Statement stmt2 = stmt;
ResultSet rs
= stmt.getGeneratedKeys();
return new ResultSetAdapter(rs) {
@Override
public void close() throws SQLException {
try {
super.close();
} finally {
stmt2.close();
reset();
endContext(context);
}
}
};
} catch (SQLException e) {
onException(context, e);
reset();
endContext(context);
throw configuration.translate(queryString, constants, e);
}
}
| 3.26 |
querydsl_AbstractSQLInsertClause_addFlag_rdh
|
/**
* Add the given Expression at the given position as a query flag
*
* @param position
* position
* @param flag
* query flag
* @return the current object
*/
public C addFlag(Position position, Expression<?> flag) {
metadata.addFlag(new QueryFlag(position, flag));
return ((C) (this));
}
| 3.26 |
querydsl_AbstractSQLInsertClause_m0_rdh
|
/**
* Add the current state of bindings as a batch item
*
* @return the current object
*/
public C m0() {
if (subQueryBuilder != null) {
subQuery = subQueryBuilder.select(values.toArray(new Expression[0])).clone();
values.clear();
}
batches.add(new SQLInsertBatch(columns, values, subQuery));
columns.clear();values.clear();
subQuery = null;
return ((C) (this));
}
| 3.26 |
querydsl_AbstractSQLInsertClause_populate_rdh
|
/**
* Populate the INSERT clause with the properties of the given bean using
* the given Mapper.
*
* @param obj
* object to use for population
* @param mapper
* mapper to use
* @return the current object
*/
@SuppressWarnings("rawtypes")
public <T>
C populate(T
obj, Mapper<T> mapper) {
Map<Path<?>, Object> values = mapper.createMap(entity, obj);
for (Map.Entry<Path<?>, Object> entry : values.entrySet()) {
set(((Path) (entry.getKey())), entry.getValue());}return ((C) (this));
}
| 3.26 |
querydsl_GeometryExpressions_lineStringOperation_rdh
|
/**
* Create a new LineString operation expression
*
* @param op
* operator
* @param args
* arguments
* @return operation expression
*/
public static LineStringExpression<LineString> lineStringOperation(Operator op, Expression<?>... args) {
return new LineStringOperation<LineString>(LineString.class, op, args);
}
| 3.26 |
querydsl_GeometryExpressions_geometryOperation_rdh
|
/**
* Create a new Geometry operation expression
*
* @param op
* operator
* @param args
* arguments
* @return operation expression
*/
public static <T extends Geometry> GeometryExpression<T> geometryOperation(Class<? extends T> type, Operator op, Expression<?>... args) {
return new GeometryOperation<T>(type, op, args);
}
| 3.26 |
querydsl_GeometryExpressions_translate_rdh
|
/**
* Translates the geometry to a new location using the numeric parameters as offsets.
*
* @param expr
* geometry
* @param deltax
* x offset
* @param deltay
* y offset
* @param <T>
* @return geometry
*/
public static <T extends Geometry> GeometryExpression<T> translate(Expression<T> expr, float deltax, float deltay) {
return geometryOperation(expr.getType(), SpatialOps.TRANSLATE, expr, ConstantImpl.create(deltax), ConstantImpl.create(deltay));
}
| 3.26 |
querydsl_GeometryExpressions_pointOperation_rdh
|
/**
* Create a new Point operation expression
*
* @param op
* operator
* @param args
* arguments
* @return operation expression
*/
public static PointExpression<Point> pointOperation(Operator op, Expression<?>... args) {
return new PointOperation<Point>(Point.class, op, args);
}
| 3.26 |
querydsl_GeometryExpressions_asGeometry_rdh
|
/**
* Create a new GeometryExpression
*
* @param value
* Geometry
* @return new GeometryExpression
*/
public static <T extends Geometry> GeometryExpression<T> asGeometry(T value) {
return
asGeometry(Expressions.constant(value));
}
| 3.26 |
querydsl_GeometryExpressions_collect_rdh
|
/**
* Return a specified ST_Geometry value from a collection of other geometries.
*
* @param expr1
* geometry
* @param expr2
* other geometry
* @return geometry collection
*/
public static GeometryExpression<?> collect(Expression<? extends Geometry> expr1, Expression<? extends Geometry> expr2)
{
return geometryOperation(SpatialOps.COLLECT2, expr1, expr2);}
| 3.26 |
querydsl_GeometryExpressions_dwithin_rdh
|
/**
* Returns true if the geometries are within the specified distance of one another.
* For geometry units are in those of spatial reference and For geography units are in meters.
*
* @param expr1
* geometry
* @param expr2
* other geometry
* @param distance
* distance
* @return true, if within distance of each other
*/
public static BooleanExpression dwithin(Expression<? extends Geometry> expr1, Expression<?
extends Geometry> expr2, double distance) {
return Expressions.booleanOperation(SpatialOps.DWITHIN, expr1, expr2, ConstantImpl.create(distance));
}
| 3.26 |
querydsl_GeometryExpressions_polygonOperation_rdh
|
/**
* Create a new Polygon operation expression
*
* @param op
* operator
* @param args
* arguments
* @return operation expression
*/
public static PolygonExpression<Polygon> polygonOperation(Operator op, Expression<?>... args) {
return new PolygonOperation<Polygon>(Polygon.class, op, args);
}
| 3.26 |
querydsl_GeometryExpressions_extent_rdh
|
/**
* Returns the bounding box that bounds rows of geometries.
*
* @param collection
* geometry collection
* @return bounding box
*/
public static GeometryExpression<?> extent(Expression<? extends GeometryCollection> collection) {
return geometryOperation(SpatialOps.EXTENT, collection);
}
| 3.26 |
querydsl_GeometryExpressions_setSRID_rdh
|
/**
* Sets the SRID on a geometry to a particular integer value.
*
* @param expr
* geometry
* @param srid
* SRID
* @param <T>
* @return converted geometry
*/
public static <T extends Geometry> GeometryExpression<T>
setSRID(Expression<T> expr, int srid) {
return geometryOperation(expr.getType(), SpatialOps.SET_SRID, expr, ConstantImpl.create(srid));
}
| 3.26 |
querydsl_GeometryExpressions_ymax_rdh
|
/**
* Returns Y maxima of a bounding box 2d or 3d or a geometry.
*
* @param expr
* geometry
* @return y maxima
*/
public static NumberExpression<Double> ymax(GeometryExpression<?> expr) {
return Expressions.numberOperation(Double.class, SpatialOps.YMAX,
expr);
}
| 3.26 |
querydsl_GeometryExpressions_ymin_rdh
|
/**
* Returns Y minima of a bounding box 2d or 3d or a geometry.
*
* @param expr
* geometry
* @return y minima
*/
public static NumberExpression<Double> ymin(GeometryExpression<?> expr) {
return Expressions.numberOperation(Double.class, SpatialOps.YMIN, expr);
}
| 3.26 |
querydsl_GeometryExpressions_fromText_rdh
|
/**
* Return a specified ST_Geometry value from Well-Known Text representation (WKT).
*
* @param text
* WKT form
* @return geometry
*/
public static GeometryExpression<?> fromText(Expression<String> text) {
return geometryOperation(SpatialOps.GEOM_FROM_TEXT, text);
}
| 3.26 |
querydsl_GeometryExpressions_xmax_rdh
|
/**
* Returns X maxima of a bounding box 2d or 3d or a geometry.
*
* @param expr
* geometry
* @return x maxima
*/
public static NumberExpression<Double> xmax(GeometryExpression<?> expr) {
return Expressions.numberOperation(Double.class, SpatialOps.XMAX, expr);
}
| 3.26 |
querydsl_GeometryExpressions_xmin_rdh
|
/**
* Returns X minima of a bounding box 2d or 3d or a geometry.
*
* @param expr
* geometry
* @return x minima
*/
public static NumberExpression<Double> xmin(GeometryExpression<?> expr) {
return Expressions.numberOperation(Double.class, SpatialOps.XMIN, expr);
}
| 3.26 |
querydsl_GeometryExpressions_asEWKT_rdh
|
/**
* Return a specified ST_Geometry value from Extended Well-Known Text representation (EWKT).
*
* @param expr
* geometry
* @return serialized form
*/public static StringExpression asEWKT(GeometryExpression<?> expr) {
return Expressions.stringOperation(SpatialOps.AS_EWKT, expr);
}
| 3.26 |
querydsl_Point_near_rdh
|
/**
* Finds the closest points relative to the given location and orders the results with decreasing proximity
*
* @param latVal
* latitude
* @param longVal
* longitude
* @return predicate
*/
public BooleanExpression near(double latVal, double longVal) {
return MongodbExpressions.near(this, latVal, longVal);
}
| 3.26 |
querydsl_CaseForEqBuilder_then_rdh
|
// Time
public Cases<Time, TimeExpression<Time>> then(Time then) {
return
thenTime(ConstantImpl.create(then));
}
| 3.26 |
querydsl_PathBuilder_getCollection_rdh
|
/**
* Create a new Collection typed path
*
* @param <A>
* @param <E>
* @param property
* property name
* @param type
* property type
* @param queryType
* expression type
* @return property path
*/
public <A, E extends SimpleExpression<A>> CollectionPath<A, E> getCollection(String property, Class<A> type, Class<? super E> queryType) {
validate(property, Collection.class);
return super.createCollection(property, type, queryType, PathInits.DIRECT);
}
| 3.26 |
querydsl_PathBuilder_getMap_rdh
|
/**
* Create a new Map typed path
*
* @param <K>
* @param <V>
* @param <E>
* @param property
* property name
* @param key
* key type
* @param value
* value type
* @param queryType
* vaue expression type
* @return property path
*/
public <K, V, E extends SimpleExpression<V>> MapPath<K, V, E> getMap(String property, Class<K> key, Class<V> value, Class<? super E> queryType) {
validate(property, Map.class);
return super.createMap(property, key, value, queryType);
}
| 3.26 |
querydsl_PathBuilder_getNumber_rdh
|
/**
* Create a new Number typed path
*
* @param <A>
* @param property
* property name
* @param type
* property type
* @return property path
*/
@SuppressWarnings("unchecked")
public <A extends Number & Comparable<?>> NumberPath<A> getNumber(String property, Class<A> type) {
Class<? extends A> vtype = validate(property, type);
return super.createNumber(property, ((Class<? super A>) (vtype)));
}
| 3.26 |
querydsl_PathBuilder_getEnum_rdh
|
/**
* Create a new Enum path
*
* @param <A>
* @param property
* property name
* @param type
* property type
* @return property path
*/public <A extends Enum<A>> EnumPath<A> getEnum(String property, Class<A> type) {
validate(property, type);
return super.createEnum(property, type);
}
| 3.26 |
querydsl_PathBuilder_getList_rdh
|
/**
* Create a new List typed path
*
* @param <A>
* @param <E>
* @param property
* property name
* @param type
* property type
* @param queryType
* expression type
* @return property path
*/
public <A, E extends SimpleExpression<A>> ListPath<A, E> getList(String property, Class<A> type, Class<? super E> queryType) {
validate(property, List.class);
return super.createList(property, type, queryType, PathInits.DIRECT);
}
| 3.26 |
querydsl_PathBuilder_toString_rdh
|
/**
* Get the String representation of the last path element
*
* @param path
* path
* @return String representation
*/
private String toString(Path<?> path) {
return path.getMetadata().getElement().toString();
}
| 3.26 |
querydsl_PathBuilder_getDateTime_rdh
|
/**
* Create a new DateTime path
*
* @param <A>
* @param property
* property name
* @param type
* property type
* @return property path
*/
@SuppressWarnings("unchecked")
public <A extends Comparable<?>> DateTimePath<A> getDateTime(String property, Class<A> type) {
Class<? extends A> vtype =
validate(property, type);
return super.createDateTime(property, ((Class<? super A>) (vtype)));
}
| 3.26 |
querydsl_PathBuilder_m2_rdh
|
/**
* Create a new Simple path
*
* @param <A>
* @param property
* property name
* @param type
* property type
* @return property path
*/
@SuppressWarnings("unchecked")
public <A> SimplePath<A> m2(String property, Class<A> type) {
Class<? extends A> vtype = validate(property, type);
return
super.createSimple(property, ((Class<? super A>) (vtype)));
}
| 3.26 |
querydsl_PathBuilder_getDate_rdh
|
/**
* Create a new Date path
*
* @param <A>
* @param property
* property name
* @param type
* property type
* @return property path
*/
@SuppressWarnings("unchecked")public <A extends Comparable<?>> DatePath<A> getDate(String property, Class<A> type) {
Class<? extends A> vtype = validate(property, type);
return super.createDate(property, ((Class<? super A>) (vtype)));
}
| 3.26 |
querydsl_PathBuilder_get_rdh
|
/**
* Create a new Time typed path
*
* @param <A>
* @param path
* existing path
* @return property 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);
}
| 3.26 |
querydsl_PathBuilder_getArray_rdh
|
/**
* Create a ArrayPath instance for the given property and the given array type
*
* @param <A>
* @param <E>
* @param property
* property name
* @param type
* property type
* @return property path
*/
public <A, E> ArrayPath<A, E> getArray(String property, Class<A> type) {
validate(property, Array.newInstance(type, 0).getClass());
return super.createArray(property, type);
}
| 3.26 |
querydsl_PathBuilder_getString_rdh
|
/**
* Create a new String typed path
*
* @param property
* property name
* @return property path
*/
public StringPath getString(String property) {
validate(property, String.class);
return super.createString(property);
}
| 3.26 |
querydsl_PathBuilder_m0_rdh
|
/**
* Create a new Boolean typed path
*
* @param path
* existing path
* @return property path
*/
public BooleanPath m0(BooleanPath path) {
BooleanPath newPath = getBoolean(toString(path));
return addMetadataOf(newPath, path);
}
| 3.26 |
querydsl_PathBuilder_getBoolean_rdh
|
/**
* Create a new Boolean typed path
*
* @param propertyName
* property name
* @return property path
*/
public BooleanPath getBoolean(String propertyName) {
validate(propertyName, Boolean.class);
return super.createBoolean(propertyName);
}
| 3.26 |
querydsl_PathBuilder_m1_rdh
|
/**
* Create a new Collection typed path
*
* @param <A>
* @param property
* property name
* @param type
* property type
* @return property path
*/
public <A> CollectionPath<A, PathBuilder<A>> m1(String property,
Class<A> type) {
return this.<A, PathBuilder<A>>getCollection(property, type, PathBuilder.class);
}
| 3.26 |
querydsl_PathBuilder_getTime_rdh
|
/**
* Create a new Time typed path
*
* @param <A>
* @param property
* property name
* @param type
* property type
* @return property path
*/
@SuppressWarnings("unchecked")
public <A extends Comparable<?>> TimePath<A> getTime(String property, Class<A> type) {
Class<?
extends A> vtype = validate(property, type);
return super.createTime(property, ((Class<? super A>) (vtype)));
}
| 3.26 |
querydsl_PathBuilder_getComparable_rdh
|
/**
* Create a new Comparable typed path
*
* @param <A>
* @param property
* property name
* @param type
* property type
* @return property path
*/
@SuppressWarnings("unchecked")
public <A extends Comparable<?>> ComparablePath<A> getComparable(String property, Class<A> type)
{
Class<? extends
A> vtype = validate(property, type);
return super.createComparable(property, ((Class<? super A>) (vtype)));
}
| 3.26 |
querydsl_PathBuilder_getSet_rdh
|
/**
* Create a new Set typed path
*
* @param <A>
* @param <E>
* @param property
* property name
* @param type
* property type
* @param queryType
* expression type
* @return property path
*/
public <A, E
extends SimpleExpression<A>> SetPath<A, E> getSet(String property, Class<A> type, Class<? super E> queryType) {
validate(property, Set.class);
return super.createSet(property, type, queryType, PathInits.DIRECT);
}
| 3.26 |
querydsl_Projections_constructor_rdh
|
/**
* Create a constructor invocation projection for given type, parameter types and expressions
*
* @param type
* type of the projection
* @param paramTypes
* constructor parameter types
* @param exprs
* constructor parameters
* @param <T>
* type of projection
* @return factory expression
*/
public static <T> ConstructorExpression<T> constructor(Class<? extends T> type, Class<?>[] paramTypes, List<Expression<?>> exprs) {
return new ConstructorExpression<T>(type, paramTypes, exprs);
}
| 3.26 |
querydsl_Projections_map_rdh
|
/**
* Create a Map typed projection for the given expressions
*
* <p>Example</p>
* <pre>{@code Map<Expression<?>, ?> map = query.select(
* Projections.map(user.firstName, user.lastName));}</pre>
*
* @param exprs
* arguments for the projection
* @return factory expression
*/
public static QMap map(Expression<?>... exprs) {
return new QMap(exprs);
}
| 3.26 |
querydsl_Projections_appending_rdh
|
/**
* Create an appending factory expression which serializes all the arguments but the uses
* the base value as the return value
*
* @param base
* first argument
* @param rest
* additional arguments
* @param <T>
* type of projection
* @return factory expression
*/
public static <T> AppendingFactoryExpression<T> appending(Expression<T> base, Expression<?>... rest) {
return new AppendingFactoryExpression<T>(base, rest);
}
| 3.26 |
querydsl_Projections_fields_rdh
|
/**
* Create a field access based Bean populating projection for the given type and bindings
*
* @param <T>
* type of projection
* @param type
* type of the projection
* @param bindings
* field bindings
* @return factory expression
*/
public static <T> QBean<T> fields(Class<? extends T> type, Map<String, ? extends Expression<?>> bindings) {
return new QBean<T>(type, true, bindings);
}
| 3.26 |
querydsl_Projections_list_rdh
|
/**
* Create a new List typed projection for the given expressions
*
* @param args
* list elements
* @return factory expression
*/
public static QList list(Expression<?>[]... args) {
return new QList(args);
}
| 3.26 |
querydsl_Projections_bean_rdh
|
/**
* Create a Bean populating projection for the given type and bindings
*
* @param <T>
* type of projection
* @param type
* type of the projection
* @param bindings
* property bindings
* @return factory expression
*/
public static <T> QBean<T> bean(Class<? extends T> type, Map<String, ? extends Expression<?>> bindings) {
return new QBean<T>(type, bindings);
}
| 3.26 |
querydsl_Projections_array_rdh
|
/**
* Create a typed array projection for the given type and expressions
*
* @param <T>
* type of projection
* @param type
* type of the projection
* @param exprs
* arguments for the projection
* @return factory expression
*/
public static <T> ArrayConstructorExpression<T> array(Class<T[]> type, Expression<T>... exprs) {
return new ArrayConstructorExpression<T>(type, exprs);
}
| 3.26 |
querydsl_Projections_tuple_rdh
|
/**
* Create a Tuple typed projection for the given expressions
*
* @param exprs
* arguments for the projection
* @return factory expression
*/
public static QTuple tuple(Expression<?>[]... exprs) {
return new QTuple(exprs);
}
| 3.26 |
querydsl_CurveExpression_endPoint_rdh
|
/**
* The end Point of this Curve.
*
* @return end point
*/public PointExpression<Point> endPoint() {
if (endPoint == null) {
endPoint = GeometryExpressions.pointOperation(SpatialOps.END_POINT, mixin);
}
return endPoint;
}
| 3.26 |
querydsl_CurveExpression_length_rdh
|
/**
* The length of this Curve in its associated spatial reference.
*
* @return length
*/
public NumberExpression<Double> length() {
if (length == null) {
length = Expressions.numberOperation(Double.class, SpatialOps.LENGTH, mixin);
}
return length;
}
| 3.26 |
querydsl_CurveExpression_isRing_rdh
|
/**
* Returns 1 (TRUE) if this Curve is closed [StartPoint ( ) = EndPoint ( )] and this Curve is
* simple (does not pass through the same Point more than once).
*
* @return ring
*/
public BooleanExpression isRing() {
if (ring == null) {
ring = Expressions.booleanOperation(SpatialOps.IS_RING, mixin);
}
return ring;
}
| 3.26 |
querydsl_CurveExpression_m0_rdh
|
/**
* The start Point of this Curve.
*
* @return start point
*/
public PointExpression<Point> m0() {
if (startPoint == null) {
startPoint = GeometryExpressions.pointOperation(SpatialOps.START_POINT, mixin);
}
return startPoint;
}
| 3.26 |
querydsl_ExpressionUtils_m1_rdh
|
/**
* Create a new Template expression
*
* @param cl
* type of expression
* @param template
* template
* @param args
* template parameters
* @return template expression
*/
@SuppressWarnings("unchecked")
public static <T> TemplateExpression<T> m1(Class<? extends T> cl,
Template template, List<?> args) {
if
(cl.equals(Boolean.class)) {
return ((TemplateExpression<T>) (new PredicateTemplate(template, args)));
} else {
return new TemplateExpressionImpl<T>(cl, template, args);
}
}
| 3.26 |
querydsl_ExpressionUtils_as_rdh
|
/**
* Create an alias expression with the given source and alias
*
* @param <D>
* type of expression
* @param source
* source
* @param alias
* alias
* @return source as alias
*/
public static <D> Expression<D> as(Expression<D> source, String alias) {
return as(source, path(source.getType(), alias));
}
| 3.26 |
querydsl_ExpressionUtils_isNotNull_rdh
|
/**
* Create a {@code left is not null} expression
*
* @param left
* operation argument
* @return left is null
*/
public static Predicate isNotNull(Expression<?> left) {
return predicate(Ops.IS_NOT_NULL, left);
}
| 3.26 |
querydsl_ExpressionUtils_predicateTemplate_rdh
|
/**
* Create a new Template expression
*
* @param template
* template
* @param args
* template parameters
* @return template expression
*/
public static PredicateTemplate predicateTemplate(Template template, List<?> args) {
return new PredicateTemplate(template, args);
}
| 3.26 |
querydsl_ExpressionUtils_count_rdh
|
/**
* Create a {@code count(source)} expression
*
* @param source
* source
* @return count(source)
*/
public static Expression<Long> count(Expression<?> source) {
return operation(Long.class, AggOps.COUNT_AGG, source);
}
| 3.26 |
querydsl_ExpressionUtils_anyOf_rdh
|
/**
* Create the union of the given arguments
*
* @param exprs
* predicates
* @return union
*/
@Nullable
public static Predicate anyOf(Predicate... exprs) {
Predicate rv = null;
for (Predicate b : exprs) {
if (b != null) {
rv = (rv == null) ? b : ExpressionUtils.or(rv, b);
}}
return rv;
}
| 3.26 |
querydsl_ExpressionUtils_template_rdh
|
/**
* Create a new Template expression
*
* @param cl
* type of expression
* @param template
* template
* @param args
* template parameters
* @return template expression
*/
public static <T> TemplateExpression<T> template(Class<? extends T> cl, Template template, Object... args) {
return template(cl, template, Arrays.asList(args));
}
| 3.26 |
querydsl_ExpressionUtils_or_rdh
|
/**
* Create a {@code left or right} expression
*
* @param left
* lhs of expression
* @param right
* rhs of expression
* @return left or right
*/
public static Predicate or(Predicate left, Predicate right) {
left = ((Predicate) (extract(left)));
right = ((Predicate) (extract(right)));
if (left == null) {
return right;
} else if (right == null) {
return left;
} else {
return predicate(Ops.OR, left, right);
}
}
| 3.26 |
querydsl_ExpressionUtils_likeToRegex_rdh
|
/**
* Convert the given like pattern to a regex pattern
*
* @param expr
* expression to be converted
* @param matchStartAndEnd
* if start and end should be matched as well
* @return converted expression
*/
@SuppressWarnings("unchecked")
public static Expression<String> likeToRegex(Expression<String> expr, boolean matchStartAndEnd) {
// TODO : this should take the escape character into account
if (expr instanceof Constant<?>) {
final String like = expr.toString();
final StringBuilder rv = new StringBuilder(like.length() + 4);
if (matchStartAndEnd && (!like.startsWith("%"))) {
rv.append('^');
}
for (int i = 0; i < like.length(); i++) {
char ch = like.charAt(i);
if (((ch == '.') || (ch == '*')) || (ch == '?')) {
rv.append('\\');
} else if (ch == '%') {
rv.append(".*");
continue;
} else if (ch == '_') {
rv.append('.');
continue;
}
rv.append(ch);
}
if (matchStartAndEnd && (!like.endsWith("%"))) {
rv.append('$');
}
if (!like.equals(rv.toString())) {
return ConstantImpl.create(rv.toString());
}
} else if (expr instanceof Operation<?>) {
Operation<?>
o
= ((Operation<?>) (expr));
if (o.getOperator() == Ops.CONCAT) {
Expression<String> lhs = likeToRegex(((Expression<String>) (o.getArg(0))), false);
Expression<String> rhs = likeToRegex(((Expression<String>) (o.getArg(1))), false);
if ((lhs != o.getArg(0)) || (rhs != o.getArg(1))) {
return operation(String.class, Ops.CONCAT, lhs, rhs);
}
}
}
return
expr;
}
| 3.26 |
querydsl_ExpressionUtils_toLower_rdh
|
/**
* Converts the given expression to lower(expression)
*
* <p>Constants are lower()ed at creation time</p>
*
* @param stringExpression
* the string to lower()
* @return lower(stringExpression)
*/public static Expression<String> toLower(Expression<String> stringExpression) {
if (stringExpression instanceof Constant) {
Constant<String> constantExpression = ((Constant<String>) (stringExpression));
return ConstantImpl.create(constantExpression.getConstant().toLowerCase());
} else {
return operation(String.class, Ops.LOWER, stringExpression);
}
}
| 3.26 |
querydsl_ExpressionUtils_orderBy_rdh
|
/**
* Create an expression out of the given order specifiers
*
* @param args
* order
* @return expression for order
*/
public static Expression<?> orderBy(List<OrderSpecifier<?>> args) {
return
operation(Object.class, Ops.ORDER, ConstantImpl.create(args));
}
| 3.26 |
querydsl_ExpressionUtils_regexToLike_rdh
|
/**
* Convert the given expression from regex form to like
*
* @param expr
* expression to convert
* @return converted expression
*/@SuppressWarnings("unchecked")
public static Expression<String> regexToLike(Expression<String> expr)
{
if (expr instanceof Constant<?>) {
final String str = expr.toString();
final StringBuilder rv = new StringBuilder(str.length() +
2);
boolean escape = false;
for (int i = 0; i < str.length(); i++) {
final char ch = str.charAt(i);
if ((!escape) && (ch == '.')) {
if ((i < (str.length()
- 1)) && (str.charAt(i + 1) == '*')) {
rv.append('%');
i++;
} else {
rv.append('_');
}
continue;
} else if ((!escape) && (ch == '\\')) {
escape =
true;
continue;
} else if ((!escape) && (((((ch == '[') || (ch == ']')) || (ch
== '^')) || (ch == '.')) || (ch == '*'))) {
throw new QueryException(("'" + str) + "' can't be converted to like form");
} else if
(escape && ((((((ch == 'd') || (ch == 'D')) || (ch == 's')) || (ch == 'S')) || (ch == 'w')) || (ch == 'W'))) {
throw new QueryException(("'" + str) + "' can't be converted to like form");
}
rv.append(ch);
escape = false;
}
if (!rv.toString().equals(str)) {
return ConstantImpl.create(rv.toString());
}
} else if (expr instanceof Operation<?>) {
Operation<?> o = ((Operation<?>) (expr));
if (o.getOperator() == Ops.CONCAT) {
Expression<String> lhs = regexToLike(((Expression<String>) (o.getArg(0))));
Expression<String> rhs = regexToLike(((Expression<String>) (o.getArg(1))));
if ((lhs != o.getArg(0)) || (rhs != o.getArg(1))) {
return operation(String.class, Ops.CONCAT, lhs, rhs);
}
}
}
return expr;
}
| 3.26 |
querydsl_ExpressionUtils_eq_rdh
|
/**
* Create a {@code left == right} expression
*
* @param <D>
* type of expressions
* @param left
* lhs of expression
* @param right
* rhs of expression
* @return left == right
*/
public static <D> Predicate eq(Expression<D> left,
Expression<? extends D> right) {
return
predicate(Ops.EQ, left, right);
}
| 3.26 |
querydsl_ExpressionUtils_neConst_rdh
|
/**
* Create a {@code left != constant} expression
*
* @param <D>
* type of expression
* @param left
* lhs of expression
* @param constant
* rhs of expression
* @return left != constant
*/
public static <D> Predicate neConst(Expression<D> left, D constant) {
return ne(left, ConstantImpl.create(constant));
}
| 3.26 |
querydsl_ExpressionUtils_predicate_rdh
|
/**
* Create a new Operation expression
*
* @param operator
* operator
* @param args
* operation arguments
* @return operation expression
*/
public static PredicateOperation predicate(Operator operator, Expression<?>... args) {
return predicate(operator, Arrays.asList(args));
}
| 3.26 |
querydsl_ExpressionUtils_m0_rdh
|
/**
* Create a new Operation expression
*
* @param operator
* operator
* @param args
* operation arguments
* @return operation expression
*/
public static PredicateOperation m0(Operator operator, List<Expression<?>> args) {
return new PredicateOperation(operator, args);
}
| 3.26 |
querydsl_ExpressionUtils_distinctList_rdh
|
/**
* Create a distinct list of the concatenated array contents
*
* @param args
* elements
* @return list with distinct elements
*/
public static List<Expression<?>> distinctList(Expression<?>[]... args) {
final Set<Expression<?>> set = new LinkedHashSet<>();
for (Expression<?>[] arr : args) {
Collections.addAll(set, arr);}
return CollectionUtils.unmodifiableList(new ArrayList<>(set));
}
| 3.26 |
querydsl_ExpressionUtils_createRootVariable_rdh
|
/**
* Create a new root variable based on the given path
*
* @param path
* base path
* @return variable name
*/
public static String createRootVariable(Path<?> path) {
return path.accept(ToStringVisitor.DEFAULT, f0);
}
| 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.