Package info.archinnov.achilles.annotations

Examples of info.archinnov.achilles.annotations.Entity


    public String inferKeyspaceName(Class<?> entityClass, Optional<String> currentKeyspaceNameO, NamingStrategy namingStrategy) {
        String keyspaceName = currentKeyspaceNameO.or("");
        if(isNoneBlank(keyspaceName)) return keyspaceName;

        Entity annotation = entityClass.getAnnotation(Entity.class);

        keyspaceName = applyNamingStrategy(annotation.keyspace(), namingStrategy);

        Validator.validateBeanMappingTrue(isNotBlank(keyspaceName),"No keyspace name found for entity '"+entityClass.getCanonicalName()+"'. Keyspace name is looked up using either the @Entity annotation or in configuration parameter");

        keyspaceName = validateSchemaName(keyspaceName);
        return keyspaceName;
View Full Code Here


        keyspaceName = validateSchemaName(keyspaceName);
        return keyspaceName;
    }

    public String inferTableName(Class<?> entityClass, String canonicalName, NamingStrategy namingStrategy) {
        Entity annotation = entityClass.getAnnotation(Entity.class);
        String tableName;
        if (isNotBlank(annotation.table())) {
            tableName = validateSchemaName(applyNamingStrategy(annotation.table(), namingStrategy));
        } else {
            tableName = validateSchemaName(applyNamingStrategy(extractTableNameFromCanonical(canonicalName), namingStrategy));
        }
        log.debug("Inferred tableName for entity {} : {}", canonicalName, tableName);
        return tableName;
View Full Code Here

        return tableName;
    }

    public String inferTableComment(Class<?> entity, String defaultComment) {
        String comment = defaultComment;
        Entity annotation = entity.getAnnotation(Entity.class);
        if (isNotBlank(annotation.comment())) {
            comment = annotation.comment().trim().replaceAll("'","''");
        }
        return comment;
    }
View Full Code Here

TOP

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

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.