Package reportgen.cores.ejb.annotations

Examples of reportgen.cores.ejb.annotations.DefineQueryProperty


        for(Method m : methods) {
            String title = m.getName();
            Annotation ann = m.getAnnotation(DefineQueryProperty.class);
            boolean returnEntity =  m.getReturnType().isAnnotationPresent(Entity.class);
            if(ann != null) {
                DefineQueryProperty qp = (DefineQueryProperty) ann;
                if(!qp.embedded() && returnEntity) {
                    throw new RuntimeException("Класс " + cls.getName() + " аннотирует метод " + m.getName()
                            + " возвращающий невстроенный " + m.getReturnType().getName());
                } else if(returnEntity
                        && !m.getReturnType().isAnnotationPresent(DefineQueryEntity.class)) {
                    throw new RuntimeException("Класс " + cls.getName() + " аннотирует метод " + m.getName()
View Full Code Here


                if(isEntity && !reportSet.contains(type)) {
                    throw new RuntimeException("Класс " + cls.getName() + " аннотирует поле " + f.getName()
                        + " не зарегистрированного типа " +type.getName());
                }

                DefineQueryProperty qp = (DefineQueryProperty) ann;
                if(qp.embedded()) {
                    if(!isEntity) {
                        throw new RuntimeException("Класс " + cls.getName()
                                + " аннотирует поле 'не сущность' типа " + type.getName() + " как встроенное");
                    }
                    if(embedded.contains(type)) {
View Full Code Here

            return null;
        }
        //children entities - LinkageMode.fwd
        Field[] f = cls.getDeclaredFields();
        for(int i=0; i<f.length; i++) {
            DefineQueryProperty gen = f[i].getAnnotation(DefineQueryProperty.class);
            Class c = f[i].getType();
            if(!c.isAnnotationPresent(Entity.class)
                    || gen == null) {
                    continue;
            }
            res.add(new QueryEntity(c, gen.title(), gen.desc(), f[i].getName(),
                    LinkageMode.forward, thisEntity, coreContextGroup));
        }

        //backlinked
        LinkedReportEntity[] linked = getEntitySet().getLinkedClasses(cls);
View Full Code Here

        Object[] fields = objClass.getDeclaredFields();

        ArrayList<Field> embedded = new ArrayList<Field>();
        for(int i=0; i<fields.length; i++) {
            Field field = (Field) fields[i];
            DefineQueryProperty gen = field.getAnnotation(DefineQueryProperty.class);
            if(gen == null) {
                continue;
            } else if(gen.embedded()) {
                embedded.add(field);
            }

            QEntityProperty qep = null;
            Class type = field.getType();
            String name = path + field.getName();
            if(type.isAnnotationPresent(Entity.class)) {
                qep = new QueryEntityObjectField(parent, type, gen.title(), gen.desc(), name);
            } else {
                qep = new QueryEntityField(parent, type, gen.title(), gen.desc(), name);
            }
            res.add(qep);
        }

        //embedded properties
View Full Code Here

        }

        ArrayList<Method> embedded = new ArrayList<Method>();
        for(int i=0; i<methods.length; i++) {
            Method method = (Method) methods[i];
            DefineQueryProperty gen = method.getAnnotation(DefineQueryProperty.class);
            if(gen == null) {
                continue;
            } else if(gen.embedded()) {
                embedded.add(method);
                continue;
            }

            Class type = method.getReturnType();
            if(type.isAnnotationPresent(Entity.class)) {
                throw new RuntimeException("Аннотирован метод класса " + method.getDeclaringClass()
                    + " представляющий не встроенную сущность " + method.getName());
            }
            QEntityProperty qep =new QueryEntityMethod(parent, type,
                gen.title(), gen.desc(), path + method.getName());
            res.add(qep);
        }

        //embedded properties
        for(int i=0; i<embedded.size(); i++) {
View Full Code Here

    /**
     * Читает название и описание объекта из типа
     */
    public void reReadClassInfo() {
        DefineQueryProperty gen = (DefineQueryProperty) cls.getAnnotation(DefineQueryProperty.class);
        if(gen != null) {
            title = gen.title();
            desc = gen.desc();
        } else {
            DefineQueryEntity gene = (DefineQueryEntity) cls.getAnnotation(DefineQueryEntity.class);
            if(gene != null) {
                title = gene.title();
                desc = gene.desc();               
View Full Code Here

TOP

Related Classes of reportgen.cores.ejb.annotations.DefineQueryProperty

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.