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

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

The newest version!
package info.archinnov.achilles.generated.meta.udt;

import com.datastax.driver.core.DataType;
import com.datastax.driver.core.UDTValue;
import com.datastax.driver.core.UserType;
import com.google.common.reflect.TypeToken;
import info.archinnov.achilles.internals.codec.FallThroughCodec;
import info.archinnov.achilles.internals.entities.EntityWithUDTs;
import info.archinnov.achilles.internals.entities.SimpleUDTWithNoKeyspace;
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.options.CassandraOptions;
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.lang.UnsupportedOperationException;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;

public final class SimpleUDTWithNoKeyspace_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 SimpleUDTWithNoKeyspace 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<>((SimpleUDTWithNoKeyspace entity$) -> entity$.getId(), (SimpleUDTWithNoKeyspace 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 SimpleUDTWithNoKeyspace 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<>((SimpleUDTWithNoKeyspace entity$) -> entity$.getValue(), (SimpleUDTWithNoKeyspace 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 SimpleUDTWithNoKeyspace_AchillesMeta INSTANCE = new SimpleUDTWithNoKeyspace_AchillesMeta(); @Override protected Optional getStaticKeyspace() { return Optional.empty(); } @Override protected Optional getStaticUdtName() { return Optional.of("udt_no_ks"); } @Override protected Optional getStaticNamingStrategy() { return Optional.empty(); } @Override protected String getUdtName() { return "udt_no_ks"; } @Override protected Class getUdtClass() { return SimpleUDTWithNoKeyspace.class; } @Override protected Class getParentEntityClass() { return EntityWithUDTs.class; } @Override protected List> getComponentsProperty() { return Arrays.asList(id, value); } @Override protected List> getConstructorInjectedProperty() { return Arrays.asList(); } @Override protected UDTValue createUDTFromBean(SimpleUDTWithNoKeyspace instance, boolean frozen, Optional cassandraOptions) { final UserType dynamicUserType = this.getUserType(frozen, cassandraOptions); final UDTValue udtValue = dynamicUserType.newValue(); id.encodeFieldToUdt(instance, udtValue, cassandraOptions); value.encodeFieldToUdt(instance, udtValue, cassandraOptions); return udtValue; } @Override protected SimpleUDTWithNoKeyspace newInstanceFromCustomConstructor(UDTValue udtValue) { throw new UnsupportedOperationException("Cannot instantiate entity 'info.archinnov.achilles.internals.entities.SimpleUDTWithNoKeyspace' using custom constructor because no custom constructor (@EntityCreator) is defined"); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy