info.archinnov.achilles.generated.dsl.EntityWithDSESearch_Update Maven / Gradle / Ivy
package info.archinnov.achilles.generated.dsl;
import com.datastax.driver.core.querybuilder.NonEscapingSetAssignment;
import com.datastax.driver.core.querybuilder.NotEq;
import com.datastax.driver.core.querybuilder.QueryBuilder;
import com.datastax.driver.core.querybuilder.Update;
import info.archinnov.achilles.generated.meta.entity.EntityWithDSESearch_AchillesMeta;
import info.archinnov.achilles.internals.dsl.query.update.AbstractUpdate;
import info.archinnov.achilles.internals.dsl.query.update.AbstractUpdateColumns;
import info.archinnov.achilles.internals.dsl.query.update.AbstractUpdateEnd;
import info.archinnov.achilles.internals.dsl.query.update.AbstractUpdateFrom;
import info.archinnov.achilles.internals.dsl.query.update.AbstractUpdateWhere;
import info.archinnov.achilles.internals.entities.EntityWithDSESearch;
import info.archinnov.achilles.internals.metamodel.AbstractEntityProperty;
import info.archinnov.achilles.internals.options.CassandraOptions;
import info.archinnov.achilles.internals.runtime.RuntimeEngine;
import info.archinnov.achilles.type.SchemaNameProvider;
import info.archinnov.achilles.validation.Validator;
import java.lang.Class;
import java.lang.Long;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import org.apache.commons.lang3.ArrayUtils;
public final class EntityWithDSESearch_Update extends AbstractUpdate {
protected final EntityWithDSESearch_AchillesMeta meta;
protected final Class entityClass = EntityWithDSESearch.class;
public EntityWithDSESearch_Update(RuntimeEngine rte, EntityWithDSESearch_AchillesMeta meta) {
super(rte);
this.meta = meta;
}
/**
* Generate an UPDATE FROM ... */
public final EntityWithDSESearch_Update.F fromBaseTable() {
final String currentKeyspace = meta.getKeyspace().orElse("unknown_keyspace_for_" + meta.entityClass.getCanonicalName());
final Update.Where where = QueryBuilder.update(currentKeyspace, meta.getTableOrViewName()).where();
return new EntityWithDSESearch_Update.F(where, new CassandraOptions());
}
/**
* Generate an UPDATE FROM ... using the given SchemaNameProvider */
public final EntityWithDSESearch_Update.F from(final SchemaNameProvider schemaNameProvider) {
final String currentKeyspace = lookupKeyspace(schemaNameProvider, meta.entityClass);
final String currentTable = lookupTable(schemaNameProvider, meta.entityClass);
final Update.Where where = QueryBuilder.update(currentKeyspace, currentTable).where();
return new EntityWithDSESearch_Update.F(where, CassandraOptions.withSchemaNameProvider(schemaNameProvider));
}
public class Cols extends AbstractUpdateColumns {
Cols(Update.Where where, CassandraOptions cassandraOptions) {
super(where, cassandraOptions);
}
public final Cols.String string() {
return new Cols.String();
}
public final Cols.Numeric numeric() {
return new Cols.Numeric();
}
public final Cols.Date date() {
return new Cols.Date();
}
public final EntityWithDSESearch_Update.W_Id where() {
return new EntityWithDSESearch_Update.W_Id(where, cassandraOptions);
}
public final class String {
/**
* Generate an UPDATE FROM ... SET string = ? */
@SuppressWarnings("static-access")
public final EntityWithDSESearch_Update.Cols Set(final java.lang.String string) {
where.with(NonEscapingSetAssignment.of("string", QueryBuilder.bindMarker("string")));
boundValues.add(string);
encodedValues.add(meta.string.encodeFromJava(string, Optional.of(cassandraOptions)));
return EntityWithDSESearch_Update.Cols.this;
}
}
public final class Numeric {
/**
* Generate an UPDATE FROM ... SET numeric = ? */
@SuppressWarnings("static-access")
public final EntityWithDSESearch_Update.Cols Set(final float numeric) {
where.with(NonEscapingSetAssignment.of("numeric", QueryBuilder.bindMarker("numeric")));
boundValues.add(numeric);
encodedValues.add(meta.numeric.encodeFromJava(numeric, Optional.of(cassandraOptions)));
return EntityWithDSESearch_Update.Cols.this;
}
}
public final class Date {
/**
* Generate an UPDATE FROM ... SET date = ? */
@SuppressWarnings("static-access")
public final EntityWithDSESearch_Update.Cols Set(final java.util.Date date) {
where.with(NonEscapingSetAssignment.of("date", QueryBuilder.bindMarker("date")));
boundValues.add(date);
encodedValues.add(meta.date.encodeFromJava(date, Optional.of(cassandraOptions)));
return EntityWithDSESearch_Update.Cols.this;
}
}
}
public class F extends AbstractUpdateFrom {
F(Update.Where where, CassandraOptions cassandraOptions) {
super(where, cassandraOptions);
}
public final F.String string() {
return new F.String();
}
public final F.Numeric numeric() {
return new F.Numeric();
}
public final F.Date date() {
return new F.Date();
}
public final class String {
/**
* Generate an UPDATE FROM ... SET string = ? */
@SuppressWarnings("static-access")
public final EntityWithDSESearch_Update.Cols Set(final java.lang.String string) {
where.with(NonEscapingSetAssignment.of("string", QueryBuilder.bindMarker("string")));
boundValues.add(string);
encodedValues.add(meta.string.encodeFromJava(string, Optional.of(cassandraOptions)));
return new EntityWithDSESearch_Update.Cols(where, cassandraOptions);
}
}
public final class Numeric {
/**
* Generate an UPDATE FROM ... SET numeric = ? */
@SuppressWarnings("static-access")
public final EntityWithDSESearch_Update.Cols Set(final float numeric) {
where.with(NonEscapingSetAssignment.of("numeric", QueryBuilder.bindMarker("numeric")));
boundValues.add(numeric);
encodedValues.add(meta.numeric.encodeFromJava(numeric, Optional.of(cassandraOptions)));
return new EntityWithDSESearch_Update.Cols(where, cassandraOptions);
}
}
public final class Date {
/**
* Generate an UPDATE FROM ... SET date = ? */
@SuppressWarnings("static-access")
public final EntityWithDSESearch_Update.Cols Set(final java.util.Date date) {
where.with(NonEscapingSetAssignment.of("date", QueryBuilder.bindMarker("date")));
boundValues.add(date);
encodedValues.add(meta.date.encodeFromJava(date, Optional.of(cassandraOptions)));
return new EntityWithDSESearch_Update.Cols(where, cassandraOptions);
}
}
}
public final class W_Id extends AbstractUpdateWhere {
public W_Id(Update.Where where, CassandraOptions cassandraOptions) {
super(where, cassandraOptions);
}
public final EntityWithDSESearch_Update.W_Id.Relation id() {
return new EntityWithDSESearch_Update.W_Id.Relation();
}
public final class Relation {
/**
* Generate a SELECT ... FROM ... WHERE ... id = ? */
@SuppressWarnings("static-access")
public final EntityWithDSESearch_Update.E Eq(Long id) {
where.and(QueryBuilder.eq("id", QueryBuilder.bindMarker("id")));
boundValues.add(id);
encodedValues.add(meta.id.encodeFromJava(id, Optional.of(cassandraOptions)));
return new EntityWithDSESearch_Update.E(where, cassandraOptions);
}
/**
* Generate a SELECT ... FROM ... WHERE ... id IN ? */
@SuppressWarnings("static-access")
public final EntityWithDSESearch_Update.E IN(Long... id) {
Validator.validateTrue(ArrayUtils.isNotEmpty(id), "Varargs for field '%s' should not be null/empty", "id");
where.and(QueryBuilder.in("id",QueryBuilder.bindMarker("id")));
final List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy