All Downloads are FREE. Search and download functionalities are using the official Maven repository.

info.archinnov.achilles.generated.meta.udt.UDTWithNoKeyspace_AchillesMeta Maven / Gradle / Ivy

package info.archinnov.achilles.generated.meta.udt;

import com.datastax.driver.core.DataType;
import com.datastax.driver.core.UDTValue;
import com.google.common.reflect.TypeToken;
import info.archinnov.achilles.internals.codec.FallThroughCodec;
import info.archinnov.achilles.internals.entities.UDTWithNoKeyspace;
import info.archinnov.achilles.internals.metamodel.AbstractProperty;
import info.archinnov.achilles.internals.metamodel.AbstractUDTClassProperty;
import info.archinnov.achilles.internals.metamodel.SimpleProperty;
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.index.IndexInfo;
import info.archinnov.achilles.internals.strategy.naming.InternalNamingStrategy;
import java.lang.Class;
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.Optional;

public final class UDTWithNoKeyspace_AchillesMeta extends AbstractUDTClassProperty {
  /**
   * 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 UDTWithNoKeyspace 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<>((UDTWithNoKeyspace entity$) -> entity$.getId(), (UDTWithNoKeyspace entity$, Long value$) -> entity$.setId(value$), "id", "id", ColumnType.NORMAL, new ColumnInfo(false), IndexInfo.noIndex()), DataType.bigint(), gettableData$ -> gettableData$.get("id", java.lang.Long.class), (settableData$, value$) -> settableData$.set("id", value$, java.lang.Long.class), new TypeToken(){}, new TypeToken(){}, new FallThroughCodec<>(Long.class)); /** * Meta class for 'value' 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 UDTWithNoKeyspace 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 value = new SimpleProperty(new FieldInfo<>((UDTWithNoKeyspace entity$) -> entity$.getValue(), (UDTWithNoKeyspace entity$, String value$) -> entity$.setValue(value$), "value", "VALUE", ColumnType.NORMAL, new ColumnInfo(false), IndexInfo.noIndex()), DataType.text(), gettableData$ -> gettableData$.get("\"VALUE\"", java.lang.String.class), (settableData$, value$) -> settableData$.set("\"VALUE\"", value$, java.lang.String.class), new TypeToken(){}, new TypeToken(){}, new FallThroughCodec<>(String.class)); public static final UDTWithNoKeyspace_AchillesMeta INSTANCE = new UDTWithNoKeyspace_AchillesMeta(); @Override protected Optional getStaticKeyspace() { return Optional.empty(); } @Override protected Optional getStaticUdtName() { return Optional.of("no_ks"); } @Override protected Optional getStaticNamingStrategy() { return Optional.empty(); } @Override protected String getUdtName() { return "no_ks"; } @Override protected Class getUdtClass() { return UDTWithNoKeyspace.class; } @Override protected List> getComponentsProperty() { return Arrays.asList(id, value); } @Override protected UDTValue createUDTFromBean(UDTWithNoKeyspace instance) { final UDTValue udtValue = userType.newValue(); id.encodeFieldToUdt(instance, udtValue); value.encodeFieldToUdt(instance, udtValue); return udtValue; } @Override protected UDTWithNoKeyspace createBeanFromUDT(UDTValue udtValue) { final UDTWithNoKeyspace instance = udtFactory.newInstance(udtClass); id.decodeField(udtValue, instance); value.decodeField(udtValue, instance); return instance; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy