info.archinnov.achilles.generated.meta.entity.EntityWithCaseSensitivePK_AchillesMeta Maven / Gradle / Ivy
package info.archinnov.achilles.generated.meta.entity;
import com.datastax.driver.core.ClusteringOrder;
import com.datastax.driver.core.ConsistencyLevel;
import com.datastax.driver.core.DataType;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import com.google.common.reflect.TypeToken;
import info.archinnov.achilles.generated.function.List_String_Type;
import info.archinnov.achilles.generated.function.Long_Type;
import info.archinnov.achilles.generated.function.Map_Integer_String_Type;
import info.archinnov.achilles.generated.function.Set_String_Type;
import info.archinnov.achilles.generated.function.UDTWithNoKeyspace_Type;
import info.archinnov.achilles.internals.apt.annotations.AchillesMeta;
import info.archinnov.achilles.internals.codec.FallThroughCodec;
import info.archinnov.achilles.internals.entities.EntityWithCaseSensitivePK;
import info.archinnov.achilles.internals.entities.UDTWithNoKeyspace;
import info.archinnov.achilles.internals.metamodel.AbstractEntityProperty;
import info.archinnov.achilles.internals.metamodel.AbstractProperty;
import info.archinnov.achilles.internals.metamodel.ListProperty;
import info.archinnov.achilles.internals.metamodel.MapProperty;
import info.archinnov.achilles.internals.metamodel.SetProperty;
import info.archinnov.achilles.internals.metamodel.SimpleProperty;
import info.archinnov.achilles.internals.metamodel.UDTProperty;
import info.archinnov.achilles.internals.metamodel.columns.ClusteringColumnInfo;
import info.archinnov.achilles.internals.metamodel.columns.ColumnInfo;
import info.archinnov.achilles.internals.metamodel.columns.ColumnType;
import info.archinnov.achilles.internals.metamodel.columns.FieldInfo;
import info.archinnov.achilles.internals.metamodel.columns.PartitionKeyInfo;
import info.archinnov.achilles.internals.metamodel.index.IndexInfo;
import info.archinnov.achilles.internals.strategy.naming.InternalNamingStrategy;
import info.archinnov.achilles.type.strategy.InsertStrategy;
import java.lang.Class;
import java.lang.Integer;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
/**
* Meta class of all entities of type EntityWithCaseSensitivePK
* The meta class is responsible for
*
* - determining runtime consistency levels (read/write,serial)
* - determining runtime insert strategy
* - trigger event interceptors (if any)
* - map a com.datastax.driver.core.Row back to an instance of EntityWithCaseSensitivePK
* - determine runtime keyspace name using static annotations and runtime SchemaNameProvider (if any)
* - determine runtime table name using static annotations and runtime SchemaNameProvider (if any)
* - generate schema during bootstrap
* - validate schema during bootstrap
* - expose all property meta classes for encoding/decoding purpose on unitary columns
*
*/
@AchillesMeta
public final class EntityWithCaseSensitivePK_AchillesMeta extends AbstractEntityProperty {
/**
* Meta class for 'id' property
* The meta class exposes some useful methods:
* - encodeFromJava: encode a property from raw Java to CQL java compatible type
* - encodeField: extract the current property value from the given EntityWithCaseSensitivePK instance and encode to CQL java compatible type
* - decodeFromGettable: decode from a {@link com.datastax.driver.core.GettableData} instance (Row, UDTValue, TupleValue) the current property
*
*/
@SuppressWarnings({"serial", "unchecked"})
public static final SimpleProperty id = new SimpleProperty(new FieldInfo<>((EntityWithCaseSensitivePK entity$) -> entity$.getId(), (EntityWithCaseSensitivePK entity$, Long value$) -> entity$.setId(value$), "id", "partitionKey", ColumnType.PARTITION, new PartitionKeyInfo(1, false), IndexInfo.noIndex()), DataType.bigint(), gettableData$ -> gettableData$.get("\"partitionKey\"", java.lang.Long.class), (settableData$, value$) -> settableData$.set("\"partitionKey\"", value$, java.lang.Long.class), new TypeToken(){}, new TypeToken(){}, new FallThroughCodec<>(Long.class));
/**
* Meta class for 'clust' property
* The meta class exposes some useful methods:
* - encodeFromJava: encode a property from raw Java to CQL java compatible type
* - encodeField: extract the current property value from the given EntityWithCaseSensitivePK instance and encode to CQL java compatible type
* - decodeFromGettable: decode from a {@link com.datastax.driver.core.GettableData} instance (Row, UDTValue, TupleValue) the current property
*
*/
@SuppressWarnings({"serial", "unchecked"})
public static final SimpleProperty clust = new SimpleProperty(new FieldInfo<>((EntityWithCaseSensitivePK entity$) -> entity$.getClust(), (EntityWithCaseSensitivePK entity$, Long value$) -> entity$.setClust(value$), "clust", "clusteringColumn", ColumnType.CLUSTERING, new ClusteringColumnInfo(1, false, ClusteringOrder.ASC), IndexInfo.noIndex()), DataType.bigint(), gettableData$ -> gettableData$.get("\"clusteringColumn\"", java.lang.Long.class), (settableData$, value$) -> settableData$.set("\"clusteringColumn\"", value$, java.lang.Long.class), new TypeToken(){}, new TypeToken(){}, new FallThroughCodec<>(Long.class));
/**
* Meta class for 'list' property
* The meta class exposes some useful methods:
* - encodeFromJava: encode a property from raw Java to CQL java compatible type
* - encodeField: extract the current property value from the given EntityWithCaseSensitivePK instance and encode to CQL java compatible type
* - decodeFromGettable: decode from a {@link com.datastax.driver.core.GettableData} instance (Row, UDTValue, TupleValue) the current property
*
*/
@SuppressWarnings({"serial", "unchecked"})
public static final ListProperty list = new ListProperty<>(new FieldInfo<>((EntityWithCaseSensitivePK entity$) -> entity$.getList(), (EntityWithCaseSensitivePK entity$, List value$) -> entity$.setList(value$), "list", "listString", ColumnType.NORMAL, new ColumnInfo(false), IndexInfo.noIndex()), false, false, String.class, new SimpleProperty(FieldInfo. of("list", "listString"), DataType.text(), gettable$ -> null, (udt$, value$) -> {}, new TypeToken(){}, new TypeToken(){}, new FallThroughCodec<>(String.class)));
/**
* Meta class for 'set' property
* The meta class exposes some useful methods:
* - encodeFromJava: encode a property from raw Java to CQL java compatible type
* - encodeField: extract the current property value from the given EntityWithCaseSensitivePK instance and encode to CQL java compatible type
* - decodeFromGettable: decode from a {@link com.datastax.driver.core.GettableData} instance (Row, UDTValue, TupleValue) the current property
*
*/
@SuppressWarnings({"serial", "unchecked"})
public static final SetProperty set = new SetProperty<>(new FieldInfo<>((EntityWithCaseSensitivePK entity$) -> entity$.getSet(), (EntityWithCaseSensitivePK entity$, Set value$) -> entity$.setSet(value$), "set", "setString", ColumnType.NORMAL, new ColumnInfo(false), IndexInfo.noIndex()), false, false, String.class, new SimpleProperty(FieldInfo. of("set", "setString"), DataType.text(), gettable$ -> null, (udt$, value$) -> {}, new TypeToken(){}, new TypeToken(){}, new FallThroughCodec<>(String.class)));
/**
* Meta class for 'map' property
* The meta class exposes some useful methods:
* - encodeFromJava: encode a property from raw Java to CQL java compatible type
* - encodeField: extract the current property value from the given EntityWithCaseSensitivePK instance and encode to CQL java compatible type
* - decodeFromGettable: decode from a {@link com.datastax.driver.core.GettableData} instance (Row, UDTValue, TupleValue) the current property
*
*/
@SuppressWarnings({"serial", "unchecked"})
public static final MapProperty map = new MapProperty(new FieldInfo<>((EntityWithCaseSensitivePK entity$) -> entity$.getMap(), (EntityWithCaseSensitivePK entity$, Map value$) -> entity$.setMap(value$), "map", "mapIntString", ColumnType.NORMAL, new ColumnInfo(false), IndexInfo.noIndex()), false, false, new SimpleProperty(FieldInfo. of("map", "mapIntString"), DataType.cint(), gettable$ -> null, (udt$, value$) -> {}, new TypeToken(){}, new TypeToken(){}, new FallThroughCodec<>(Integer.class)), new SimpleProperty(FieldInfo. of("map", "mapIntString"), DataType.text(), gettable$ -> null, (udt$, value$) -> {}, new TypeToken(){}, new TypeToken(){}, new FallThroughCodec<>(String.class)));
/**
* Meta class for 'udt' property
* The meta class exposes some useful methods:
* - encodeFromJava: encode a property from raw Java to CQL java compatible type
* - encodeField: extract the current property value from the given EntityWithCaseSensitivePK instance and encode to CQL java compatible type
* - decodeFromGettable: decode from a {@link com.datastax.driver.core.GettableData} instance (Row, UDTValue, TupleValue) the current property
*
*/
public static final UDTProperty udt = new UDTProperty(new FieldInfo<>((EntityWithCaseSensitivePK entity$) -> entity$.getUdt(), (EntityWithCaseSensitivePK entity$, UDTWithNoKeyspace value$) -> entity$.setUdt(value$), "udt", "udtWithNoKeyspace", ColumnType.NORMAL, new ColumnInfo(true), IndexInfo.noIndex()), UDTWithNoKeyspace.class, info.archinnov.achilles.generated.meta.udt.UDTWithNoKeyspace_AchillesMeta.INSTANCE);
/**
* Static class to expose "EntityWithCaseSensitivePK_AchillesMeta" fields for type-safe function calls */
public static final EntityWithCaseSensitivePK_AchillesMeta.ColumnsForFunctions COLUMNS = new EntityWithCaseSensitivePK_AchillesMeta.ColumnsForFunctions();
;
@Override
protected Class getEntityClass() {
return EntityWithCaseSensitivePK.class;
}
@Override
protected String getDerivedTableOrViewName() {
return "entitywithcasesensitivepk";
}
@Override
protected BiMap fieldNameToCqlColumn() {
BiMap map = HashBiMap.create(6);
map.put("id", "\"partitionKey\"");
map.put("clust", "\"clusteringColumn\"");
map.put("list", "\"listString\"");
map.put("set", "\"setString\"");
map.put("map", "\"mapIntString\"");
map.put("udt", "\"udtWithNoKeyspace\"");
return map;
}
@Override
protected Optional getStaticReadConsistency() {
return Optional.empty();
}
@Override
protected Optional getStaticNamingStrategy() {
return Optional.empty();
}
@Override
protected List> getPartitionKeys() {
return Arrays.asList(id);
}
@Override
protected List> getClusteringColumns() {
return Arrays.asList(clust);
}
@Override
protected List> getNormalColumns() {
return Arrays.asList(list,map,set,udt);
}
@Override
protected List> getComputedColumns() {
return Arrays.asList();
}
@Override
protected boolean isCounterTable() {
return false;
}
@Override
protected Optional getStaticKeyspace() {
return Optional.empty();
}
@Override
protected Optional getStaticTableOrViewName() {
return Optional.of("entity_with_case_sensitive_pk");
}
@Override
protected Optional getStaticWriteConsistency() {
return Optional.empty();
}
@Override
protected Optional getStaticSerialConsistency() {
return Optional.empty();
}
@Override
protected Optional getStaticTTL() {
return Optional.empty();
}
@Override
protected Optional getStaticInsertStrategy() {
return Optional.empty();
}
@Override
protected List> getStaticColumns() {
return Arrays.asList();
}
@Override
protected List> getCounterColumns() {
return Arrays.asList();
}
/**
* Utility class to expose all fields with their CQL type for function call */
public static final class ColumnsForFunctions {
/**
*
* Field to be used for manager.dsl().select().function(...) call
*
* This is an alias for the field "id" */
public final Long_Type ID = new Long_Type(Optional.empty()){
@Override
protected String cqlColumn() {
return "\"partitionKey\"";
}
@Override
public boolean isFunctionCall() {
return false;
}
}
;
/**
*
* Field to be used for manager.dsl().select().function(...) call
*
* This is an alias for the field "clust" */
public final Long_Type CLUST = new Long_Type(Optional.empty()){
@Override
protected String cqlColumn() {
return "\"clusteringColumn\"";
}
@Override
public boolean isFunctionCall() {
return false;
}
}
;
/**
*
* Field to be used for manager.dsl().select().function(...) call
*
* This is an alias for the field "list" */
public final List_String_Type LIST = new List_String_Type(Optional.empty()){
@Override
protected String cqlColumn() {
return "\"listString\"";
}
@Override
public boolean isFunctionCall() {
return false;
}
}
;
/**
*
* Field to be used for manager.dsl().select().function(...) call
*
* This is an alias for the field "set" */
public final Set_String_Type SET = new Set_String_Type(Optional.empty()){
@Override
protected String cqlColumn() {
return "\"setString\"";
}
@Override
public boolean isFunctionCall() {
return false;
}
}
;
/**
*
* Field to be used for manager.dsl().select().function(...) call
*
* This is an alias for the field "map" */
public final Map_Integer_String_Type MAP = new Map_Integer_String_Type(Optional.empty()){
@Override
protected String cqlColumn() {
return "\"mapIntString\"";
}
@Override
public boolean isFunctionCall() {
return false;
}
}
;
/**
*
* Field to be used for manager.dsl().select().function(...) call
*
* This is an alias for the field "udt" */
public final UDTWithNoKeyspace_Type UDT = new UDTWithNoKeyspace_Type(Optional.empty()){
@Override
protected String cqlColumn() {
return "\"udtWithNoKeyspace\"";
}
@Override
public boolean isFunctionCall() {
return false;
}
}
;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy