Package org.eclipse.persistence.jpa

Examples of org.eclipse.persistence.jpa.Archive


       
        for (URL rootURL : rootUrls) {
            logMessage("Searching for default mapping file in " + rootURL);
            URL ormURL = null;

            Archive par = null;
            try {
                par = PersistenceUnitProcessor.getArchiveFactory(m_loader).createArchive(rootURL, null);
               
                if (par != null) {
                    ormURL = par.getEntryAsURL(ormXMLFile);

                    if (ormURL != null) {
                        logMessage("Found a default mapping file at " + ormURL + " for root URL " + rootURL);

                        // Read the document through OX and add it to the project., pass persistence unit properties for any orm properties set there
                        XMLEntityMappings entityMappings = XMLEntityMappingsReader.read(ormURL, m_loader, m_project.getPersistenceUnitInfo().getProperties());
                        entityMappings.setIsEclipseLinkORMFile(ormXMLFile.equals(MetadataHelper.ECLIPSELINK_ORM_FILE));
                        m_project.addEntityMappings(entityMappings);
                    }
                }
            } catch (IOException e) {
                throw new RuntimeException(e);
            } catch (URISyntaxException e) {
                throw new RuntimeException(e);
            } finally {
                if (par != null) {
                    par.close();
                }
            }
        }
    }
View Full Code Here


       
        for (URL rootURL : rootUrls) {
            logMessage("Searching for default mapping file in " + rootURL);
            URL ormURL = null;

            Archive par = null;
            try {
                par = PersistenceUnitProcessor.getArchiveFactory(m_loader).createArchive(rootURL, null);
               
                if (par != null) {
                    ormURL = par.getEntryAsURL(ormXMLFile);

                    if (ormURL != null) {
                        logMessage("Found a default mapping file at " + ormURL + " for root URL " + rootURL);

                        // Read the document through OX and add it to the project., pass persistence unit properties for any orm properties set there
                        XMLEntityMappings entityMappings = XMLEntityMappingsReader.read(ormURL, m_loader, m_project.getPersistenceUnitInfo().getProperties());
                        entityMappings.setIsEclipseLinkORMFile(ormXMLFile.equals(MetadataHelper.ECLIPSELINK_ORM_FILE));
                        m_project.addEntityMappings(entityMappings);
                    }
                }
            } catch (IOException e) {
                throw new RuntimeException(e);
            } catch (URISyntaxException e) {
                throw new RuntimeException(e);
            } finally {
                if (par != null) {
                    par.close();
                }
            }
        }
    }
View Full Code Here

     * It is the caller's responsibility to close all the archives.
     *
     * @param loader the class loader to get the class path from
     */
    public static Set<Archive> findPersistenceArchives(ClassLoader loader, String descriptorPath){
        Archive archive = null;

        Set<Archive> archives = new HashSet<Archive>();

        // See if we are talking about an embedded descriptor
        int splitPosition = descriptorPath.indexOf("!/");
View Full Code Here

     * It is the caller's responsibility to close all the archives.
     *
     * @param loader the class loader to get the class path from
     */
    public static Set<Archive> findPersistenceArchives(ClassLoader loader, String descriptorPath, List<URL> jarFileUrls) {
        Archive archive = null;

        Set<Archive> archives = new HashSet<Archive>();

        // See if we are talking about an embedded descriptor
        // If not embedded descriptor then just use the regular descriptor path
View Full Code Here

        return factory;
    }
   
    public static Set<String> getClassNamesFromURL(URL url, ClassLoader loader, Map properties) {
        Set<String> classNames = new HashSet<String>();
        Archive archive = null;
        try {
            archive = PersistenceUnitProcessor.getArchiveFactory(loader).createArchive(url, properties);

            if (archive != null) {
                for (Iterator<String> entries = archive.getEntries(); entries.hasNext();) {
                    String entry = entries.next();
                    if (entry.endsWith(".class")){ // NOI18N
                        classNames.add(buildClassNameFromEntryString(entry));
                    }
                }
            }
        } catch (URISyntaxException e) {
            throw new RuntimeException("url = [" + url + "]", e)// NOI18N
        } catch (IOException e) {
            throw new RuntimeException("url = [" + url + "]", e)// NOI18N
        } finally {
            if (archive != null) {
                archive.close();
            }
        }
        return classNames;
    }
View Full Code Here

     * It is the caller's responsibility to close all the archives.
     *
     * @param loader the class loader to get the class path from
     */
    public static Set<Archive> findPersistenceArchives(ClassLoader loader, String descriptorPath){
        Archive archive = null;

        Set<Archive> archives = new HashSet<Archive>();

        // See if we are talking about an embedded descriptor
        int splitPosition = descriptorPath.indexOf("!/");
View Full Code Here

     * It is the caller's responsibility to close all the archives.
     *
     * @param loader the class loader to get the class path from
     */
    public static Set<Archive> findPersistenceArchives(ClassLoader loader, String descriptorPath, List<URL> jarFileUrls) {
        Archive archive = null;

        Set<Archive> archives = new HashSet<Archive>();

        // See if we are talking about an embedded descriptor
        // If not embedded descriptor then just use the regular descriptor path
View Full Code Here

        return factory;
    }
   
    public static Set<String> getClassNamesFromURL(URL url, ClassLoader loader, Map properties) {
        Set<String> classNames = new HashSet<String>();
        Archive archive = null;
        try {
            archive = PersistenceUnitProcessor.getArchiveFactory(loader).createArchive(url, properties);

            if (archive != null) {
                for (Iterator<String> entries = archive.getEntries(); entries.hasNext();) {
                    String entry = entries.next();
                    if (entry.endsWith(".class")){ // NOI18N
                        classNames.add(buildClassNameFromEntryString(entry));
                    }
                }
            }
        } catch (URISyntaxException e) {
            throw new RuntimeException("url = [" + url + "]", e)// NOI18N
        } catch (IOException e) {
            throw new RuntimeException("url = [" + url + "]", e)// NOI18N
        } finally {
            if (archive != null) {
                archive.close();
            }
        }
        return classNames;
    }
View Full Code Here

       
        if (rootUrl == null) {
            return null;
        }
       
        Archive result = null;
        String protocol = rootUrl.getProtocol();
        logger.logp(Level.FINER, "ArchiveFactoryImpl", "createArchive", "protocol = {0}", protocol);
       
        if ("file".equals(protocol)) {
            URI uri = Helper.toURI(rootUrl);
View Full Code Here

       
        for (URL rootURL : rootUrls) {
            logMessage("Searching for default mapping file in " + rootURL);
            URL ormURL = null;

            Archive par = null;
            try {
                par = PersistenceUnitProcessor.getArchiveFactory(m_loader).createArchive(rootURL, null);
               
                if (par != null) {
                    ormURL = par.getEntryAsURL(ormXMLFile);

                    if (ormURL != null) {
                        logMessage("Found a default mapping file at " + ormURL + " for root URL " + rootURL);

                        // Read the document through OX and add it to the project., pass persistence unit properties for any orm properties set there
                        XMLEntityMappings entityMappings = XMLEntityMappingsReader.read(ormURL, m_loader, m_project.getPersistenceUnitInfo().getProperties());
                        entityMappings.setIsEclipseLinkORMFile(ormXMLFile.equals(MetadataHelper.ECLIPSELINK_ORM_FILE));
                        m_project.addEntityMappings(entityMappings);
                    }
                }
            } catch (IOException e) {
                throw new RuntimeException(e);
            } catch (URISyntaxException e) {
                throw new RuntimeException(e);
            } finally {
                if (par != null) {
                    par.close();
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.jpa.Archive

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.