info.archinnov.achilles.generated.dsl.EntityWithCompositePartitionKey_Update Maven / Gradle / Ivy
package info.archinnov.achilles.generated.dsl;
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.EntityWithCompositePartitionKey_AchillesMeta;
import info.archinnov.achilles.internals.entities.EntityWithCompositePartitionKey;
import info.archinnov.achilles.internals.metamodel.AbstractEntityProperty;
import info.archinnov.achilles.internals.options.Options;
import info.archinnov.achilles.internals.query.dsl.update.AbstractUpdate;
import info.archinnov.achilles.internals.query.dsl.update.AbstractUpdateColumns;
import info.archinnov.achilles.internals.query.dsl.update.AbstractUpdateEnd;
import info.archinnov.achilles.internals.query.dsl.update.AbstractUpdateFrom;
import info.archinnov.achilles.internals.query.dsl.update.AbstractUpdateWhere;
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.List;
import java.util.UUID;
import java.util.stream.Collectors;
import org.apache.commons.lang3.ArrayUtils;
public final class EntityWithCompositePartitionKey_Update extends AbstractUpdate {
protected final EntityWithCompositePartitionKey_AchillesMeta meta;
protected final Class entityClass = EntityWithCompositePartitionKey.class;
public EntityWithCompositePartitionKey_Update(RuntimeEngine rte, EntityWithCompositePartitionKey_AchillesMeta meta) {
super(rte);
this.meta = meta;
}
/**
* Generate an UPDATE FROM ... */
public final EntityWithCompositePartitionKey_Update.EntityWithCompositePartitionKey_UpdateFrom 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 EntityWithCompositePartitionKey_Update.EntityWithCompositePartitionKey_UpdateFrom(where);
}
/**
* Generate an UPDATE FROM ... using the given SchemaNameProvider */
public final EntityWithCompositePartitionKey_Update.EntityWithCompositePartitionKey_UpdateFrom 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 EntityWithCompositePartitionKey_Update.EntityWithCompositePartitionKey_UpdateFrom(where);
}
public class EntityWithCompositePartitionKey_UpdateColumns extends AbstractUpdateColumns {
EntityWithCompositePartitionKey_UpdateColumns(Update.Where where) {
super(where);
}
/**
* Generate an UPDATE FROM ... SET value = ? */
@SuppressWarnings("static-access")
public final EntityWithCompositePartitionKey_Update.EntityWithCompositePartitionKey_UpdateColumns value_Set(final String value) {
where.with(QueryBuilder.set("value", QueryBuilder.bindMarker("value")));
boundValues.add(value);
encodedValues.add(meta.value.encodeFromJava(value));
return this;
}
public final EntityWithCompositePartitionKey_Update.EntityWithCompositePartitionKey_UpdateWhere_Id where() {
return new EntityWithCompositePartitionKey_Update.EntityWithCompositePartitionKey_UpdateWhere_Id(where);
}
}
public class EntityWithCompositePartitionKey_UpdateFrom extends AbstractUpdateFrom {
EntityWithCompositePartitionKey_UpdateFrom(Update.Where where) {
super(where);
}
/**
* Generate an UPDATE FROM ... SET value = ? */
@SuppressWarnings("static-access")
public final EntityWithCompositePartitionKey_Update.EntityWithCompositePartitionKey_UpdateColumns value_Set(final String value) {
where.with(QueryBuilder.set("value", QueryBuilder.bindMarker("value")));
boundValues.add(value);
encodedValues.add(meta.value.encodeFromJava(value));
return new EntityWithCompositePartitionKey_Update.EntityWithCompositePartitionKey_UpdateColumns(where);
}
}
public final class EntityWithCompositePartitionKey_UpdateWhere_Id extends AbstractUpdateWhere {
public EntityWithCompositePartitionKey_UpdateWhere_Id(Update.Where where) {
super(where);
}
/**
* Generate a SELECT ... FROM ... WHERE ... id = ? */
@SuppressWarnings("static-access")
public final EntityWithCompositePartitionKey_Update.EntityWithCompositePartitionKey_UpdateWhere_Uuid id_Eq(Long id) {
where.and(QueryBuilder.eq("id", QueryBuilder.bindMarker("id_Eq")));
boundValues.add(id);
encodedValues.add(meta.id.encodeFromJava(id));
return new EntityWithCompositePartitionKey_Update.EntityWithCompositePartitionKey_UpdateWhere_Uuid(where);
}
/**
* Generate a SELECT ... FROM ... WHERE ... id IN ? */
@SuppressWarnings("static-access")
public final EntityWithCompositePartitionKey_Update.EntityWithCompositePartitionKey_UpdateWhere_Uuid id_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