Examples of JpaNamedQuery


Examples of org.apache.cayenne.jpa.map.JpaNamedQuery

                AnnotatedElement element,
                AnnotationProcessorStack context) {

            NamedQueries annotation = element.getAnnotation(NamedQueries.class);
            for (int i = 0; i < annotation.value().length; i++) {
                entity.getNamedQueries().add(new JpaNamedQuery(annotation.value()[i]));
            }
        }
View Full Code Here

Examples of org.apache.cayenne.jpa.map.JpaNamedQuery

                AnnotatedElement element,
                AnnotationProcessorStack context) {

            NamedQueries annotation = element.getAnnotation(NamedQueries.class);
            for (int i = 0; i < annotation.value().length; i++) {
                entityMap.getNamedQueries().add(new JpaNamedQuery(annotation.value()[i]));
            }
        }
View Full Code Here

Examples of org.apache.cayenne.jpa.map.JpaNamedQuery

                JpaEntity entity,
                AnnotatedElement element,
                AnnotationProcessorStack context) {

            NamedQuery annotation = element.getAnnotation(NamedQuery.class);
            entity.getNamedQueries().add(new JpaNamedQuery(annotation));
        }
View Full Code Here

Examples of org.apache.cayenne.jpa.map.JpaNamedQuery

                JpaEntityMap entityMap,
                AnnotatedElement element,
                AnnotationProcessorStack context) {

            NamedQuery annotation = element.getAnnotation(NamedQuery.class);
            entityMap.getNamedQueries().add(new JpaNamedQuery(annotation));
        }
View Full Code Here

Examples of org.apache.cayenne.jpa.map.JpaNamedQuery

    class JpaNamedQueryVisitor extends NestedVisitor {

        @Override
        Object createObject(ProjectPath path) {
            JpaNamedQuery jpaQuery = (JpaNamedQuery) path.getObject();
            JpaIndirectQuery cayenneQuery;

            JpaQueryHint hint = jpaQuery.getHint(QueryHints.QUERY_TYPE_HINT);
            if (hint != null && !Util.isEmptyString(hint.getValue())) {
                try {

                    // query class is not enhanced, so use normal class loader
                    Class<?> cayenneQueryClass = Class.forName(
                            hint.getValue(),
                            true,
                            Thread.currentThread().getContextClassLoader());

                    if (!JpaIndirectQuery.class.isAssignableFrom(cayenneQueryClass)) {
                        recordConflict(path, "Unknown type for Cayenne query '"
                                + jpaQuery.getName()
                                + "': "
                                + cayenneQueryClass.getName());
                        return null;
                    }

                    cayenneQuery = (JpaIndirectQuery) cayenneQueryClass.newInstance();
                }
                catch (Exception e) {
                    recordConflict(path, "Problem while creating Cayenne query '"
                            + jpaQuery.getName()
                            + "', exception"
                            + e.getMessage());
                    return null;
                }
            }
            else {
                // by default use EJBQL query...
                cayenneQuery = new JpaEjbQLQuery();
            }

            cayenneQuery.setName(jpaQuery.getName());
            cayenneQuery.setJpaQuery(jpaQuery);

            DataMap parentMap = (DataMap) targetPath.firstInstanceOf(DataMap.class);

            ObjEntity parentEntity = (ObjEntity) targetPath
View Full Code Here

Examples of org.apache.cayenne.jpa.map.JpaNamedQuery

                AnnotatedElement element,
                AnnotationProcessorStack context) {

            NamedQueries annotation = element.getAnnotation(NamedQueries.class);
            for (int i = 0; i < annotation.value().length; i++) {
                entity.getNamedQueries().add(new JpaNamedQuery(annotation.value()[i]));
            }
        }
View Full Code Here

Examples of org.apache.cayenne.jpa.map.JpaNamedQuery

                AnnotatedElement element,
                AnnotationProcessorStack context) {

            NamedQueries annotation = element.getAnnotation(NamedQueries.class);
            for (int i = 0; i < annotation.value().length; i++) {
                entityMap.getNamedQueries().add(new JpaNamedQuery(annotation.value()[i]));
            }
        }
View Full Code Here

Examples of org.apache.cayenne.jpa.map.JpaNamedQuery

                JpaEntity entity,
                AnnotatedElement element,
                AnnotationProcessorStack context) {

            NamedQuery annotation = element.getAnnotation(NamedQuery.class);
            entity.getNamedQueries().add(new JpaNamedQuery(annotation));
        }
View Full Code Here

Examples of org.apache.cayenne.jpa.map.JpaNamedQuery

                JpaEntityMap entityMap,
                AnnotatedElement element,
                AnnotationProcessorStack context) {

            NamedQuery annotation = element.getAnnotation(NamedQuery.class);
            entityMap.getNamedQueries().add(new JpaNamedQuery(annotation));
        }
View Full Code Here

Examples of org.apache.cayenne.jpa.map.JpaNamedQuery

    class JpaNamedQueryVisitor extends NestedVisitor {

        @Override
        Object createObject(ProjectPath path) {
            JpaNamedQuery jpaQuery = (JpaNamedQuery) path.getObject();
            JpaIndirectQuery cayenneQuery;

            JpaQueryHint hint = jpaQuery.getHint(QueryHints.QUERY_TYPE_HINT);
            if (hint != null && !Util.isEmptyString(hint.getValue())) {
                try {

                    // query class is not enhanced, so use normal class loader
                    Class<?> cayenneQueryClass = Class.forName(
                            hint.getValue(),
                            true,
                            Thread.currentThread().getContextClassLoader());

                    if (!JpaIndirectQuery.class.isAssignableFrom(cayenneQueryClass)) {
                        recordConflict(path, "Unknown type for Cayenne query '"
                                + jpaQuery.getName()
                                + "': "
                                + cayenneQueryClass.getName());
                        return null;
                    }

                    cayenneQuery = (JpaIndirectQuery) cayenneQueryClass.newInstance();
                }
                catch (Exception e) {
                    recordConflict(path, "Problem while creating Cayenne query '"
                            + jpaQuery.getName()
                            + "', exception"
                            + e.getMessage());
                    return null;
                }
            }
            else {
                // by default use EJBQL query...
                cayenneQuery = new JpaEjbQLQuery();
            }

            cayenneQuery.setName(jpaQuery.getName());
            cayenneQuery.setJpaQuery(jpaQuery);

            DataMap parentMap = (DataMap) targetPath.firstInstanceOf(DataMap.class);

            ObjEntity parentEntity = (ObjEntity) targetPath
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.