info.archinnov.achilles.generated.meta.udt.UDTWithCollectionsPrimitive_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.EntityWithUDTCollectionsPrimitive;
import info.archinnov.achilles.internals.entities.UDTWithCollectionsPrimitive;
import info.archinnov.achilles.internals.metamodel.AbstractProperty;
import info.archinnov.achilles.internals.metamodel.AbstractUDTClassProperty;
import info.archinnov.achilles.internals.metamodel.ListProperty;
import info.archinnov.achilles.internals.metamodel.SetProperty;
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.Double;
import java.lang.Integer;
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;
import java.util.Set;
public final class UDTWithCollectionsPrimitive_AchillesMeta extends AbstractUDTClassProperty {
/**
* Meta class for 'listInt' 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 UDTWithCollectionsPrimitive 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 listInt = new ListProperty<>(new FieldInfo<>((UDTWithCollectionsPrimitive entity$) -> entity$.getListInt(), (UDTWithCollectionsPrimitive entity$, List value$) -> entity$.setListInt(value$), "listInt", "listint", ColumnType.NORMAL, new ColumnInfo(false), IndexInfo.noIndex()), false, false, Integer.class, new SimpleProperty(FieldInfo. of("listInt", "listint", true), DataType.cint(), gettable$ -> null, (udt$, value$) -> {}, new TypeToken(){}, new TypeToken(){}, new FallThroughCodec<>(Integer.class)));
/**
* Meta class for 'setDouble' 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 UDTWithCollectionsPrimitive 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 setDouble = new SetProperty<>(new FieldInfo<>((UDTWithCollectionsPrimitive entity$) -> entity$.getSetDouble(), (UDTWithCollectionsPrimitive entity$, Set value$) -> entity$.setSetDouble(value$), "setDouble", "setdouble", ColumnType.NORMAL, new ColumnInfo(false), IndexInfo.noIndex()), false, false, Double.class, new SimpleProperty(FieldInfo. of("setDouble", "setdouble", true), DataType.cdouble(), gettable$ -> null, (udt$, value$) -> {}, new TypeToken(){}, new TypeToken(){}, new FallThroughCodec<>(Double.class)));
public static final UDTWithCollectionsPrimitive_AchillesMeta INSTANCE = new UDTWithCollectionsPrimitive_AchillesMeta();
@Override
protected Optional getStaticKeyspace() {
return Optional.empty();
}
@Override
protected Optional getStaticUdtName() {
return Optional.of("udt_collections_primitive");
}
@Override
protected Optional getStaticNamingStrategy() {
return Optional.empty();
}
@Override
protected String getUdtName() {
return "udt_collections_primitive";
}
@Override
protected Class getUdtClass() {
return UDTWithCollectionsPrimitive.class;
}
@Override
protected Class> getParentEntityClass() {
return EntityWithUDTCollectionsPrimitive.class;
}
@Override
protected List> getComponentsProperty() {
return Arrays.asList(listInt, setDouble);
}
@Override
protected List> getConstructorInjectedProperty() {
return Arrays.asList();
}
@Override
protected UDTValue createUDTFromBean(UDTWithCollectionsPrimitive instance, boolean frozen, Optional cassandraOptions) {
final UserType dynamicUserType = this.getUserType(frozen, cassandraOptions);
final UDTValue udtValue = dynamicUserType.newValue();
listInt.encodeFieldToUdt(instance, udtValue, cassandraOptions);
setDouble.encodeFieldToUdt(instance, udtValue, cassandraOptions);
return udtValue;
}
@Override
protected UDTWithCollectionsPrimitive newInstanceFromCustomConstructor(UDTValue udtValue) {
throw new UnsupportedOperationException("Cannot instantiate entity 'info.archinnov.achilles.internals.entities.UDTWithCollectionsPrimitive' using custom constructor because no custom constructor (@EntityCreator) is defined");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy