Examples of structure()


Examples of info.archinnov.achilles.internal.metadata.holder.EntityMeta.structure()

        for (Class<?> entityClass : entities) {
            EntityParsingContext context = new EntityParsingContext(configContext, entityClass);
            EntityMeta entityMeta = entityParser.parseEntity(context);
            entityMetaMap.put(entityClass, entityMeta);

            hasSimpleCounter = hasSimpleCounter || (context.hasSimpleCounter() && !entityMeta.structure().isClusteredCounter());
            boolean shouldValidateBean = configContext.isClassConstrained(entityClass);
            if (shouldValidateBean) {
                configContext.addBeanValidationInterceptor(entityMeta);
            }
        }
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.EntityMeta.structure()

    public void validateNotClusteredCounter(Object entity, Map<Class<?>, EntityMeta> entityMetaMap) {
        log.trace("Validate that entity {} is not a clustered counter", entity);
        Class<?> baseClass = proxifier.deriveBaseClass(entity);
        EntityMeta entityMeta = entityMetaMap.get(baseClass);
        Validator.validateFalse(entityMeta.structure().isClusteredCounter(),
                "The entity '%s' is a clustered counter and does not support insert/update with TTL", entity);
    }

    public static enum Singleton {
        INSTANCE;
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.EntityMeta.structure()

    protected <T> SliceQueryBuilder<T> sliceQuery(Class<T> entityClass) {
        Validator.validateNotNull(entityClass,"The entityClass should be provided for slice query");
        EntityMeta meta = entityMetaMap.get(entityClass);
        Validator.validateNotNull(meta, "The entity '%s' is not managed by achilles", entityClass.getName());
        Validator.validateTrue(meta.structure().isClusteredEntity(),"Cannot perform slice query on entity type '%s' because it is " + "not a clustered entity",meta.getClassName());
        return new SliceQueryBuilder<>(sliceQueryExecutor, entityClass, meta);
    }

    protected NativeQuery nativeQuery(RegularStatement regularStatement, Options options, Object... boundValues) {
        Validator.validateNotNull(regularStatement, "The regularStatement for native query should not be null");
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.EntityMeta.structure()

    }

    protected <T> TypedQuery<T> indexedQuery(Class<T> entityClass, IndexCondition indexCondition) {
        EntityMeta entityMeta = entityMetaMap.get(entityClass);

        Validator.validateFalse(entityMeta.structure().isClusteredEntity(), "Index query is not supported for clustered entity. Please use typed query/native query");
        Validator.validateNotNull(indexCondition, "Index condition should not be null");

        entityMeta.forTranscoding().encodeIndexConditionValue(indexCondition);

        String indexColumnName = indexCondition.getColumnName();
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.EntityMeta.structure()

        Class<?> entityClass = context.getEntityClass();
        PreparedStatement ps = selectPSs.get(entityClass);

    final EntityMeta entityMeta = context.getEntityMeta();

        final ListenableFuture<ResultSet> resultSetFuture = executeReadWithConsistency(context, ps, entityMeta.structure().hasOnlyStaticColumns());
        return asyncUtils.transformFuture(resultSetFuture, RESULTSET_TO_ROW, executorService);
    }

    public BoundStatementWrapper bindForSliceQuerySelect(SliceQueryProperties<?> sliceQueryProperties, ConsistencyLevel defaultReadConsistencyLevel) {
        final PreparedStatement ps = cacheManager.getCacheForSliceSelectAndIterator(session, dynamicPSCache, sliceQueryProperties);
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.EntityMeta.structure()

        EntityMeta entityMeta = context.getEntityMeta();
        Object entity = context.getEntity();

        log.debug("Persisting transient entity {}", entity);

        if (entityMeta.structure().isClusteredCounter()) {
            counterPersister.persistClusteredCounters(context);
        } else {
            context.pushInsertStatement();
            counterPersister.persistCounters(context, entityMeta.getAllCounterMetas());
        }
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.EntityMeta.structure()

    }

    public void delete(EntityOperations context) {
        log.trace("Deleting entity using PersistenceContext {}", context);
        EntityMeta entityMeta = context.getEntityMeta();
        if (entityMeta.structure().isClusteredCounter()) {
            context.bindForClusteredCounterDeletion();
        } else {
            context.bindForDeletion(entityMeta.config().getQualifiedTableName());
            counterPersister.deleteRelatedCounters(context);
        }
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.EntityMeta.structure()

        Validator.validateNotNull(primaryKey, "Entity '%s' key should not be null", entityClass.getCanonicalName());
        Validator.validateNotNull(entityMeta, "Entity meta for '%s' should not be null", entityClass.getCanonicalName());

        AchillesFuture<T> achillesFuture;

        if (entityMeta.structure().isClusteredCounter()) {
            achillesFuture = counterLoader.loadClusteredCounters(context);
        } else {
            final ListenableFuture<Row> futureRow = context.loadEntity();
            Function<Row, T> rowToEntity = new Function<Row, T>() {
                @Override
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.EntityMeta.structure()

        PropertyMeta pm2 = mock(PropertyMeta.class, RETURNS_DEEP_STUBS);
        EntityMeta entityMeta = mock(EntityMeta.class, RETURNS_DEEP_STUBS);
        when(entityMeta.getPropertyMetas().values()).thenReturn(Arrays.asList(pm1,pm2));
        when(entityMeta.getAllMetasExceptId().size()).thenReturn(2);
        when(entityMeta.getClassName()).thenReturn("myEntity");
        when(entityMeta.structure().isClusteredCounter()).thenReturn(true);
        when(idMeta.structure().isClustered()).thenReturn(true);
        when(pm1.structure().isStaticColumn()).thenReturn(true);
        when(pm2.structure().isStaticColumn()).thenReturn(true);
        when(pm1.structure().isCounter()).thenReturn(true);
        when(pm2.structure().isCounter()).thenReturn(true);
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.EntityMeta.structure()

        EntityMeta entityMeta = mock(EntityMeta.class, RETURNS_DEEP_STUBS);


        PropertyMeta pm = PropertyMetaTestBuilder.valueClass(String.class).type(SIMPLE).build();

        when(entityMeta.structure().hasOnlyStaticColumns()).thenReturn(false);
        when(context.<CompleteBean>getEntityClass()).thenReturn(CompleteBean.class);
        when(context.getEntityMeta()).thenReturn(entityMeta);
        when(entityMeta.getAllMetasExceptId()).thenReturn(asList(pm));
        when(selectEagerPSs.get(CompleteBean.class)).thenReturn(ps);
        when(overrider.getReadLevel(context)).thenReturn(LOCAL_QUORUM);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.