/** * Selects the ttl of provided column. * <p> * This is a shortcut for {@code fcall("ttl", QueryBuilder.column(name))}. * * @param name the name of the column to select the ttl of. * @return this in-build SELECT statement */ public SelectionOrAlias ttl(String name) { return queueName(new Utils.FCall("ttl", new Utils.CName(name))); }
/** * Creates a function call. * * @param name the name of the function to call. * @param parameters the parameters for the function. * @return the function call. */ public static Object fcall(String name, Object... parameters) { return new Utils.FCall(name, parameters); }
/** * Creates a function call. * * @param name the name of the function to call. * @param parameters the parameters for the function. * @return the function call. */ public static Object fcall(String name, Object... parameters) { return new Utils.FCall(name, parameters); }
/** * Creates a function call. * * @param name the name of the function to call. * @param parameters the parameters for the function. * @return the function call. */ public static Object fcall(String name, Object... parameters) { return new Utils.FCall(name, parameters); }
/** * Creates a {@code now()} function call. * * @return the function call. */ public static Object now() { return new Utils.FCall("now"); }
/** * Creates a {@code uuid()} function call. * * @return the function call. */ public static Object uuid() { return new Utils.FCall("uuid"); }
/** * Creates a function call. * * @param name the name of the function to call. * @param parameters the parameters for the function. * @return the function call. */ public static Object fcall(String name, Object... parameters) { return new Utils.FCall(name, parameters); }
/** * Creates a {@code toJson()} function call. This is a shortcut for {@code fcall("toJson", * QueryBuilder.column(name))}. * * <p>Support for JSON functions has been added in Cassandra 2.2. The {@code toJson()} function is * similar to {@code SELECT JSON} statements, but applies to a single column value instead of the * entire row, and produces a JSON-encoded string representing the normal Cassandra column value. * * <p>It may only be used in the selection clause of a {@code SELECT} statement. * * @param column the column to retrieve JSON from. * @return the function call. * @see <a href="http://cassandra.apache.org/doc/cql3/CQL-2.2.html#json">JSON Support for CQL</a> * @see <a href="http://www.datastax.com/dev/blog/whats-new-in-cassandra-2-2-json-support">JSON * Support in Cassandra 2.2</a> */ public static Object toJson(Object column) { // consider a String literal as a column name for user convenience, // as CQL literals are not allowed here. if (column instanceof String) column = column(((String) column)); return new Utils.FCall("toJson", column); }
@Override public SelectionOrAlias fcall(String name, Object... parameters) { return queueName(new Utils.FCall(name, parameters)); }
@Override public SelectionOrAlias writeTime(String name) { return queueName(new Utils.FCall("writetime", new Utils.CName(name))); }
@Override public SelectionOrAlias ttl(String name) { return queueName(new Utils.FCall("ttl", new Utils.CName(name))); }
/** * Creates a function call. * * @param name the name of the function to call. * @param parameters the parameters for the function. * @return the function call. */ public static Object fcall(String name, Object... parameters) { return new Utils.FCall(name, parameters); }
/** * Creates an {@code avg(x)} built-in function call. * * @return the function call. */ public static Object avg(Object column) { // consider a String literal as a column name for user convenience, // as CQL literals are not allowed here. if (column instanceof String) column = column(((String) column)); return new Utils.FCall("avg", column); } }
/** * Creates a {@code sum(x)} built-in function call. * * @return the function call. */ public static Object sum(Object column) { // consider a String literal as a column name for user convenience, // as CQL literals are not allowed here. if (column instanceof String) column = column(((String) column)); return new Utils.FCall("sum", column); }
/** * Creates a {@code now()} function call. * * @return the function call. */ public static Object now() { return new Utils.FCall("now"); }
/** * Creates a {@code min(x)} built-in function call. * * @return the function call. */ public static Object min(Object column) { // consider a String literal as a column name for user convenience, // as CQL literals are not allowed here. if (column instanceof String) column = column(((String) column)); return new Utils.FCall("min", column); }
/** * Returns a generic {@code token} function call. * * @param values the arguments of the {@code token} function. * @return {@code token} function call. */ public static Object token(Object... values) { return new Utils.FCall("token", values); }
/** * Creates a {@code max(x)} built-in function call. * * @return the function call. */ public static Object max(Object column) { // consider a String literal as a column name for user convenience, // as CQL literals are not allowed here. if (column instanceof String) column = column(((String) column)); return new Utils.FCall("max", column); }
/** * Creates a {@code count(x)} built-in function call. * * @return the function call. */ public static Object count(Object column) { // consider a String literal as a column name for user convenience, // as CQL literals are not allowed here. if (column instanceof String) column = column(((String) column)); return new Utils.FCall("count", column); }
/** * Creates a {@code uuid()} function call. * * @return the function call. */ public static Object uuid() { return new Utils.FCall("uuid"); }