Package info.archinnov.achilles.annotations

Examples of info.archinnov.achilles.annotations.Consistency


        log.debug("Find consistency levels for entity class {}", entity.getCanonicalName());

        ConsistencyLevel readLevel = configContext.getDefaultReadConsistencyLevel();
        ConsistencyLevel writeLevel = configContext.getDefaultWriteConsistencyLevel();

        Consistency clevel = entity.getAnnotation(Consistency.class);

        if (clevel != null) {
            readLevel = clevel.read();
            writeLevel = clevel.write();
        }

        readLevel = fromNullable(configContext.getReadConsistencyLevelForTable(tableName)).or(readLevel);
        writeLevel = fromNullable(configContext.getWriteConsistencyLevelForTable(tableName)).or(writeLevel);
View Full Code Here


    public Pair<ConsistencyLevel, ConsistencyLevel> findConsistencyLevels(Field field, Pair<ConsistencyLevel, ConsistencyLevel> defaultConsistencyLevels) {
        log.debug("Find consistency configuration for field {} of class {}", field.getName(), field.getDeclaringClass()
                .getCanonicalName());

        Consistency clevel = field.getAnnotation(Consistency.class);

        ConsistencyLevel defaultGlobalRead = defaultConsistencyLevels.left;
        ConsistencyLevel defaultGlobalWrite = defaultConsistencyLevels.right;

        if (clevel != null) {
            defaultGlobalRead = clevel.read();
            defaultGlobalWrite = clevel.write();
        }

        log.trace("Found consistency levels : {} / {}", defaultGlobalRead, defaultGlobalWrite);
        return Pair.create(defaultGlobalRead, defaultGlobalWrite);
    }
View Full Code Here

TOP

Related Classes of info.archinnov.achilles.annotations.Consistency

Copyright © 2018 www.massapicom. 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.