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

info.archinnov.achilles.generated.meta.udt.Layer2_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.EntityLayer1;
import info.archinnov.achilles.internals.entities.Layer2;
import info.archinnov.achilles.internals.entities.Layer3;
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.UDTProperty;
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.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 Layer2_AchillesMeta extends AbstractUDTClassProperty {
  /**
   * Meta class for 'layer' 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 Layer2 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 layer = new SimpleProperty(new FieldInfo<>((Layer2 entity$) -> entity$.getLayer(), (Layer2 entity$, String value$) -> entity$.setLayer(value$), "layer", "layer", ColumnType.NORMAL, new ColumnInfo(false), IndexInfo.noIndex()), DataType.text(), gettableData$ -> gettableData$.get("layer", java.lang.String.class), (settableData$, value$) -> settableData$.set("layer", value$, java.lang.String.class), new TypeToken(){}, new TypeToken(){}, new FallThroughCodec<>(String.class)); /** * Meta class for 'layer3' 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 Layer2 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 layer3 = new UDTProperty(new FieldInfo<>((Layer2 entity$) -> entity$.getLayer3(), (Layer2 entity$, Layer3 value$) -> entity$.setLayer3(value$), "layer3", "layer3", ColumnType.NORMAL, new ColumnInfo(true), IndexInfo.noIndex()), Layer3.class, Layer3_AchillesMeta.INSTANCE); public static final Layer2_AchillesMeta INSTANCE = new Layer2_AchillesMeta(); @Override protected Optional getStaticKeyspace() { return Optional.empty(); } @Override protected Optional getStaticUdtName() { return Optional.empty(); } @Override protected Optional getStaticNamingStrategy() { return Optional.empty(); } @Override protected String getUdtName() { return "layer2"; } @Override protected Class getUdtClass() { return Layer2.class; } @Override protected Class getParentEntityClass() { return EntityLayer1.class; } @Override protected List> getComponentsProperty() { return Arrays.asList(layer, layer3); } @Override protected List> getConstructorInjectedProperty() { return Arrays.asList(); } @Override protected UDTValue createUDTFromBean(Layer2 instance, boolean frozen, Optional cassandraOptions) { final UserType dynamicUserType = this.getUserType(frozen, cassandraOptions); final UDTValue udtValue = dynamicUserType.newValue(); layer.encodeFieldToUdt(instance, udtValue, cassandraOptions); layer3.encodeFieldToUdt(instance, udtValue, cassandraOptions); return udtValue; } @Override protected Layer2 newInstanceFromCustomConstructor(UDTValue udtValue) { throw new UnsupportedOperationException("Cannot instantiate entity 'info.archinnov.achilles.internals.entities.Layer2' using custom constructor because no custom constructor (@EntityCreator) is defined"); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy