Package org.apache.cayenne.jpa

Examples of org.apache.cayenne.jpa.JpaProviderException


        JpaIndirectQuery clone;
        try {
            clone = (JpaIndirectQuery) getClass().newInstance();
        }
        catch (Exception e) {
            throw new JpaProviderException("Error cloning a query", e);
        }

        clone.setJpaQuery(jpaQuery);
        clone.setParentEntity(parentEntity);
        clone.setParentMap(parentMap);
View Full Code Here


    }

    public JpaPropertyDescriptor(Method getter, String name) {

        if (JpaClassDescriptor.propertyNameForGetter(getter.getName()) == null) {
            throw new JpaProviderException("Invalid property getter name: "
                    + getter.getName());
        }

        this.member = getter;
        this.name = name;
View Full Code Here

        }
        catch (JpaProviderException e) {
            throw e;
        }
        catch (Exception e) {
            throw new JpaProviderException("Error loading ORM descriptors", e);
        }
    }
View Full Code Here

                Class managedClass;
                try {
                    managedClass = Class.forName(className, true, loader);
                }
                catch (ClassNotFoundException e) {
                    throw new JpaProviderException("Class not found: " + className, e);
                }

                managedClassMap.put(className, managedClass);
            }
        }

        // now detect potential managed classes from PU root and extra jars
        if (!persistenceUnit.excludeUnlistedClasses()) {
            Collection<String> implicitClasses = listImplicitClasses(persistenceUnit);
            for (String className : implicitClasses) {

                if (managedClassMap.containsKey(className)) {
                    continue;
                }

                Class managedClass;
                try {
                    managedClass = Class.forName(className, true, loader);
                }
                catch (ClassNotFoundException e) {
                    throw new JpaProviderException("Class not found: " + className, e);
                }

                if (managedClass.getAnnotation(Entity.class) != null
                        || managedClass.getAnnotation(MappedSuperclass.class) != null
                        || managedClass.getAnnotation(Embeddable.class) != null) {
View Full Code Here

        File root;
        try {
            root = new File(dirURL.toURI());
        }
        catch (URISyntaxException e) {
            throw new JpaProviderException("Error converting url to file: " + dirURL, e);
        }

        locateClassesInFolder(root, root.getAbsolutePath().length() + 1, classes);
    }
View Full Code Here

                            '.'));
                }
            }
        }
        catch (Exception e) {
            throw new JpaProviderException("Error reading jar contents: " + jarURL, e);
        }
    }
View Full Code Here

        if (stack.peek() instanceof JpaManagedClass) {
            JpaManagedClass entity = (JpaManagedClass) stack.peek();
            // sanity check
            if (fieldAccess && propertyAccess) {
                throw new JpaProviderException("Entity '"
                        + entity.getClassName()
                        + "' has both property and field annotations.");
            }

            // TODO: andrus - 11/29/2006 - clean this redundancy - access field should be
View Full Code Here

        JpaIndirectQuery clone;
        try {
            clone = (JpaIndirectQuery) getClass().newInstance();
        }
        catch (Exception e) {
            throw new JpaProviderException("Error cloning a query", e);
        }

        clone.setJpaQuery(jpaQuery);
        clone.setParentEntity(parentEntity);
        clone.setParentMap(parentMap);
View Full Code Here

                else {
                    return new PropertyDescriptor(name, objectClass).getPropertyType();
                }
            }
            catch (Exception e) {
                throw new JpaProviderException("Error resolving attribute '"
                        + name
                        + "', access type:"
                        + access
                        + ", class: "
                        + objectClass.getName(), e);
View Full Code Here

            if (jpaColumn.getPrecision() > 0) {
                dbAttribute.setAttributePrecision(jpaColumn.getPrecision());
            }

            if (jpaColumn.getTable() == null) {
                throw new JpaProviderException("No default table defined for JpaColumn "
                        + jpaColumn.getName());
            }

            DbEntity entity = ((DataMap) targetPath.firstInstanceOf(DataMap.class))
                    .getDbEntity(jpaColumn.getTable());

            if (entity == null) {
                throw new JpaProviderException("No DbEntity defined for table  "
                        + jpaColumn.getTable());
            }

            entity.addAttribute(dbAttribute);
View Full Code Here

TOP

Related Classes of org.apache.cayenne.jpa.JpaProviderException

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.