public abstract class CQLBuilder extends Object
CQLBuilder
and more efficient, comparing to write Cassandra CQL in plain text.
cql()
or pair()
method must be called to release resources.
String cql = NE.insert("gui", "firstName", "lastName").into("account").cql();
// CQL: INSERT INTO account (gui, first_name, last_name) VALUES (:gui, :firstName, :lastName)
tableName
will NOT be formalized.
select(...).from(String tableName).where(...)
insert(...).into(String tableName).values(...)
update(String tableName).set(...).where(...)
deleteFrom(String tableName).where(...)
Modifier and Type | Class and Description |
---|---|
static class |
CQLBuilder.ACCB
Deprecated.
PAC or NAC is preferred. |
static class |
CQLBuilder.CP
The Class CP.
|
static class |
CQLBuilder.LCCB
Deprecated.
PLC or NLC is preferred. |
static class |
CQLBuilder.NAC
Named CQL builder with all capitals case (upper case with underscore) field/column naming strategy.
|
static class |
CQLBuilder.NLC
Named SQL builder with lower camel case field/column naming strategy.
|
static class |
CQLBuilder.NSC
Named CQL builder with snake case (lower case with underscore) field/column naming strategy.
|
static class |
CQLBuilder.PAC
Parameterized('?') CQL builder with all capitals case (upper case with underscore) field/column naming strategy.
|
static class |
CQLBuilder.PLC
Parameterized('?') CQL builder with lower camel case field/column naming strategy.
|
static class |
CQLBuilder.PSC
Parameterized('?') CQL builder with snake case (lower case with underscore) field/column naming strategy.
|
static class |
CQLBuilder.SCCB
Deprecated.
PSC or NSC is preferred. |
Modifier and Type | Field and Description |
---|---|
static String |
COUNT_ALL
The Constant COUNT_ALL.
|
static String |
DISTINCT
The Constant DISTINCT.
|
Modifier and Type | Method and Description |
---|---|
<EX extends Exception> |
accept(com.landawn.abacus.util.Try.Consumer<? super CQLBuilder.CP,EX> consumer)
Accept.
|
CQLBuilder |
allowFiltering()
Allow filtering.
|
<T,EX extends Exception> |
apply(com.landawn.abacus.util.Try.Function<? super CQLBuilder.CP,T,EX> func)
Apply.
|
String |
cql()
This CQLBuilder will be closed after
cql() is called. |
CQLBuilder |
from(Class<?> entityClass)
From.
|
CQLBuilder |
from(Collection<String> tableNames)
From.
|
CQLBuilder |
from(Map<String,String> tableAliases)
From.
|
CQLBuilder |
from(String... tableNames)
From.
|
CQLBuilder |
from(String expr)
From.
|
CQLBuilder |
iF(com.landawn.abacus.condition.Condition cond)
I F.
|
CQLBuilder |
iF(String expr)
I F.
|
CQLBuilder |
ifExists()
If exists.
|
CQLBuilder |
ifNotExists()
If not exists.
|
CQLBuilder |
into(Class<?> entityClass)
Into.
|
CQLBuilder |
into(String tableName)
Into.
|
CQLBuilder |
limit(int count)
Limit.
|
CQLBuilder |
orderBy(Collection<String> columnNames)
Order by.
|
CQLBuilder |
orderBy(Collection<String> columnNames,
com.landawn.abacus.util.SortDirection direction)
Order by.
|
CQLBuilder |
orderBy(Map<String,com.landawn.abacus.util.SortDirection> orders)
Order by.
|
CQLBuilder |
orderBy(String... columnNames)
Order by.
|
CQLBuilder |
orderBy(String expr)
Order by.
|
CQLBuilder |
orderBy(String columnName,
com.landawn.abacus.util.SortDirection direction)
Order by.
|
CQLBuilder.CP |
pair()
This CQLBuilder will be closed after
pair() is called. |
List<Object> |
parameters()
Parameters.
|
static String |
repeatQM(int n)
Repeat QM.
|
CQLBuilder |
set(Class<?> entityClass)
Sets the.
|
CQLBuilder |
set(Class<?> entityClass,
Set<String> excludedPropNames)
Sets the.
|
CQLBuilder |
set(Collection<String> columnNames)
Sets the.
|
CQLBuilder |
set(Map<String,Object> props)
Sets the.
|
CQLBuilder |
set(Object entity)
Only the dirty properties will be set into the result CQL if the specified entity is a dirty marker entity.
|
CQLBuilder |
set(Object entity,
Set<String> excludedPropNames)
Only the dirty properties will be set into the result SQL if the specified entity is a dirty marker entity.
|
CQLBuilder |
set(String... columnNames)
Sets the.
|
CQLBuilder |
set(String expr)
Sets the.
|
String |
toString()
To string.
|
CQLBuilder |
usingTimestamp(Date timestamp)
Using timestamp.
|
CQLBuilder |
usingTimestamp(long timestamp)
Using timestamp.
|
CQLBuilder |
usingTimestamp(String timestamp)
Using timestamp.
|
CQLBuilder |
usingTTL(long timestamp)
Using TTL.
|
CQLBuilder |
usingTTL(String timestamp)
Using TTL.
|
CQLBuilder |
where(com.landawn.abacus.condition.Condition cond)
Where.
|
CQLBuilder |
where(String expr)
Where.
|
public static final String DISTINCT
public static final String COUNT_ALL
public static String repeatQM(int n)
n
- the npublic CQLBuilder into(String tableName)
tableName
- the table namepublic CQLBuilder into(Class<?> entityClass)
entityClass
- the entity classpublic CQLBuilder from(String expr)
expr
- the expr@SafeVarargs public final CQLBuilder from(String... tableNames)
tableNames
- the table namespublic CQLBuilder from(Collection<String> tableNames)
tableNames
- the table namespublic CQLBuilder from(Map<String,String> tableAliases)
tableAliases
- the table aliasespublic CQLBuilder from(Class<?> entityClass)
entityClass
- the entity classpublic CQLBuilder where(String expr)
expr
- the exprpublic CQLBuilder where(com.landawn.abacus.condition.Condition cond)
cond
- any literal written in Expression
condition won't be formalizedpublic CQLBuilder orderBy(String expr)
expr
- the expr@SafeVarargs public final CQLBuilder orderBy(String... columnNames)
columnNames
- the column namespublic CQLBuilder orderBy(String columnName, com.landawn.abacus.util.SortDirection direction)
columnName
- the column namedirection
- the directionpublic CQLBuilder orderBy(Collection<String> columnNames)
columnNames
- the column namespublic CQLBuilder orderBy(Collection<String> columnNames, com.landawn.abacus.util.SortDirection direction)
columnNames
- the column namesdirection
- the directionpublic CQLBuilder orderBy(Map<String,com.landawn.abacus.util.SortDirection> orders)
orders
- the orderspublic CQLBuilder limit(int count)
count
- the countpublic CQLBuilder set(String expr)
expr
- the expr@SafeVarargs public final CQLBuilder set(String... columnNames)
columnNames
- the column namespublic CQLBuilder set(Collection<String> columnNames)
columnNames
- the column namespublic CQLBuilder set(Map<String,Object> props)
props
- the propspublic CQLBuilder set(Object entity)
entity
- the entitypublic CQLBuilder set(Object entity, Set<String> excludedPropNames)
entity
- the entityexcludedPropNames
- the excluded prop namespublic CQLBuilder set(Class<?> entityClass)
entityClass
- the entity classpublic CQLBuilder set(Class<?> entityClass, Set<String> excludedPropNames)
entityClass
- the entity classexcludedPropNames
- the excluded prop namespublic CQLBuilder usingTTL(long timestamp)
timestamp
- the timestamppublic CQLBuilder usingTTL(String timestamp)
timestamp
- the timestamppublic CQLBuilder usingTimestamp(Date timestamp)
timestamp
- the timestamppublic CQLBuilder usingTimestamp(long timestamp)
timestamp
- the timestamppublic CQLBuilder usingTimestamp(String timestamp)
timestamp
- the timestamppublic CQLBuilder iF(String expr)
expr
- the exprpublic CQLBuilder iF(com.landawn.abacus.condition.Condition cond)
cond
- any literal written in Expression
condition won't be formalizedpublic CQLBuilder ifExists()
public CQLBuilder ifNotExists()
public CQLBuilder allowFiltering()
public String cql()
cql()
is called.public CQLBuilder.CP pair()
pair()
is called.public <T,EX extends Exception> T apply(com.landawn.abacus.util.Try.Function<? super CQLBuilder.CP,T,EX> func) throws EX extends Exception
T
- the generic typeEX
- the generic typefunc
- the funcEX
- the exEX extends Exception
public <EX extends Exception> void accept(com.landawn.abacus.util.Try.Consumer<? super CQLBuilder.CP,EX> consumer) throws EX extends Exception
EX
- the generic typeconsumer
- the consumerEX
- the exEX extends Exception
Copyright © 2019. All rights reserved.