Package com.ctp.cdi.query.meta

Examples of com.ctp.cdi.query.meta.DaoEntity


     * @return                  Meta data containing entity and primary key classes.
     */
    public static DaoEntity extractEntityMetaData(Class<?> daoClass) {
        log.debugv("extractEntityMetaData: class = {0}", daoClass);
        // TODO in AnnotationMetadataExtractor
        DaoEntity fromAnnotation = extractFromAnnotation(daoClass);
        if (fromAnnotation != null) {
            return fromAnnotation;
        }

        // TODO in TypeMetadataExtractor
        for (Type inf : daoClass.getGenericInterfaces()) {
            DaoEntity result = extractFrom(inf);
            if (result != null) {
                return result;
            }
        }
        DaoEntity result = extractFrom(daoClass.getGenericSuperclass());
        if (result != null) {
            return result;
        }
        for (Type intf : daoClass.getGenericInterfaces()) {
            result = extractFrom(intf);
View Full Code Here


        if (!(type  instanceof ParameterizedType)) {
            return null;
        }
        ParameterizedType parametrizedType = (ParameterizedType) type;
        Type[] genericTypes = parametrizedType.getActualTypeArguments();
        DaoEntity result = null;
        for (Type genericType : genericTypes) {
            if (genericType instanceof Class && EntityUtils.isEntityClass((Class<?>) genericType)) {
                result = new DaoEntity((Class<?>) genericType);
                continue;
            }
            if (result != null && genericType instanceof Class) {
                result.setPrimaryClass((Class<? extends Serializable>) genericType);
                return result;
            }
        }

        return result;
View Full Code Here

    }

    private static DaoEntity extractFromAnnotation(Class<?> daoClass) {
        Dao dao = daoClass.getAnnotation(Dao.class);
        if (dao != null && !NonEntity.class.equals(dao.value())) {
            return new DaoEntity(dao.value(), EntityUtils.primaryKeyClass(dao.value()));
        }
        return null;
    }
View Full Code Here

     * @return                  Meta data containing entity and primary key classes.
     */
    public static DaoEntity extractEntityMetaData(Class<?> daoClass) {
        log.debugv("extractEntityMetaData: class = {0}", daoClass);
        // TODO in AnnotationMetadataExtractor
        DaoEntity fromAnnotation = extractFromAnnotation(daoClass);
        if (fromAnnotation != null) {
            return fromAnnotation;
        }
       
        // TODO in TypeMetadataExtractor
        for (Type inf : daoClass.getGenericInterfaces()) {
            DaoEntity result = extractFrom(inf);
            if (result != null) {
                return result;
            }
        }
        DaoEntity result = extractFrom(daoClass.getGenericSuperclass());
        if (result != null) {
            return result;
        }
        for (Type intf : daoClass.getGenericInterfaces()) {
            result = extractFrom(intf);
View Full Code Here

        if (!(type  instanceof ParameterizedType)) {
            return null;
        }
        ParameterizedType parametrizedType = (ParameterizedType) type;
        Type[] genericTypes = parametrizedType.getActualTypeArguments();
        DaoEntity result = null;
        for (Type genericType : genericTypes) {
            if (genericType instanceof Class && EntityUtils.isEntityClass((Class<?>) genericType)) {
                result = new DaoEntity((Class<?>) genericType);
                continue;
            }
            if (result != null && genericType instanceof Class) {
                result.setPrimaryClass((Class<? extends Serializable>) genericType);
                return result;
            }
        }
       
        return result;
View Full Code Here

    }
   
    private static DaoEntity extractFromAnnotation(Class<?> daoClass) {
        Dao dao = daoClass.getAnnotation(Dao.class);
        if (dao != null && !NonEntity.class.equals(dao.value())) {
            return new DaoEntity(dao.value(), EntityUtils.primaryKeyClass(dao.value()));
        }
        return null;
    }
View Full Code Here

    }
   
    public DaoEntity lookupMetadata(Class<?> entityClass) {
        EntityDescriptor entity = find(entityClass);
        if (entity != null) {
            return new DaoEntity(entityClass, entity.getIdClass());
        }
        return null;
    }
View Full Code Here

    }
   
    public DaoEntity lookupMetadata(Class<?> entityClass) {
        EntityDescriptor entity = find(entityClass);
        if (entity != null) {
            return new DaoEntity(entityClass, entity.getIdClass());
        }
        return null;
    }
View Full Code Here

    public DaoEntity extract(Class<?> daoClass) {
        Dao dao = daoClass.getAnnotation(Dao.class);
        Class<?> daoEntity = dao.value();
        boolean isEntityClass = !NonEntity.class.equals(daoEntity) && verifier.verify(daoEntity);
        if (isEntityClass) {
            return new DaoEntity(daoEntity, EntityUtils.primaryKeyClass(daoEntity));
        }
        return null;
    }
View Full Code Here

    private final Logger log = Logger.getLogger(getClass());

    @Override
    public DaoEntity extract(Class<?> daoClass) {
        for (Type inf : daoClass.getGenericInterfaces()) {
            DaoEntity result = extractFrom(inf);
            if (result != null) {
                return result;
            }
        }
        DaoEntity result = extractFrom(daoClass.getGenericSuperclass());
        if (result != null) {
            return result;
        }
        for (Type intf : daoClass.getGenericInterfaces()) {
            result = extractFrom(intf);
View Full Code Here

TOP

Related Classes of com.ctp.cdi.query.meta.DaoEntity

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.