Examples of OpenJPAConfiguration


Examples of org.apache.openjpa.conf.OpenJPAConfiguration

                }
            }
            sup = sup.getSuperclass();
        } while (sups && !Object.class.equals(sup));

        OpenJPAConfiguration conf = repos.getConfiguration();
        for (Method m : methods) {
            for (Annotation anno : (Annotation[]) AccessController
                .doPrivileged(J2DoPrivHelper
                    .getDeclaredAnnotationsAction(m))) {
                MetaDataTag tag = _tags.get(anno.annotationType());
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration

        if (getOptions() != null) {
            opts = Configurations.parseProperties(getOptions());
        }
       
        String cacheName = opts.getProperty("name",null);
        OpenJPAConfiguration conf = (OpenJPAConfiguration)getProvider().getConfiguration();
        DataCacheManager dcm = conf.getDataCacheManagerInstance();
        DataCache dc = null;
        if (cacheName == null || cacheName.trim().length() == 0) {
            dc = dcm.getSystemDataCache();
        } else {
            dc = dcm.getDataCache(cacheName);
        }
        if (dc == null) {
            throw new UserException(_loc.get("data-cache-not-found"));
        }
       
        setDataCache(dc);
        setDataCacheManager(dcm);
        setConfigId(conf.getId());
        setContextRef(Integer.toString(System.identityHashCode(getContext())));
    }
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration

   
    @Override
    public void initialize() {
       
        OpenJPAConfiguration conf = (OpenJPAConfiguration)getProvider().getConfiguration();
        PreparedQueryCache pqc = conf.getQuerySQLCacheInstance();
       
        if (pqc == null) {
            throw new UserException(_loc.get("prep-query-cache-not-found"));
        }
       
        setPreparedQueryCache(pqc);
        setConfigId(conf.getId());
        setContextRef(Integer.toString(System.identityHashCode(getContext())));
    }
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration

   
    @Override
    public void initialize() {
       
        OpenJPAConfiguration conf = (OpenJPAConfiguration)getProvider().getConfiguration();
        DataCacheManager dcm = conf.getDataCacheManagerInstance();
        QueryCache qc = dcm.getSystemQueryCache();
       
        if (qc == null) {
            throw new UserException(_loc.get("query-cache-not-found"));
        }
       
        setQueryCache(qc);
        setConfigId(conf.getId());
        setContextRef(Integer.toString(System.identityHashCode(getContext())));
    }
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration

        final String[] arguments = opts.setFromCmdLine(args);
        boolean ret = Configurations.runAgainstAllAnchors(opts,
            new Configurations.Runnable() {
            public boolean run(Options opts)
                throws ClassNotFoundException, IOException {
                OpenJPAConfiguration conf = new OpenJPAConfigurationImpl();
                try {
                    return ApplicationIdTool.run(conf, arguments, opts);
                } finally {
                    conf.close();
                }
            }
        });
        if (!ret)
            System.err.println(_loc.get("appid-usage"));
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration

        _state.ctx = ctx;
        if (ctx == null)
            return;

        // initialize to conf info
        OpenJPAConfiguration conf = ctx.getConfiguration();
        setFetchBatchSize(conf.getFetchBatchSize());
        setFlushBeforeQueries(conf.getFlushBeforeQueriesConstant());
        setLockTimeout(conf.getLockTimeout());
        setQueryTimeout(conf.getQueryTimeout());
        clearFetchGroups();
        addFetchGroups(Arrays.asList(conf.getFetchGroupsList()));
        setMaxFetchDepth(conf.getMaxFetchDepth());
    }
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration

public class TestEnhancementWithMultiplePUs
    extends AbstractCachedEMFTestCase {

    public void testExplicitEnhancementWithClassNotInFirstPU()
        throws ClassNotFoundException {
        OpenJPAConfiguration conf = new OpenJPAConfigurationImpl();
        Configurations.populateConfiguration(conf, new Options());
        MetaDataRepository repos = conf.getMetaDataRepositoryInstance();
        ClassLoader loader = AccessController
            .doPrivileged(J2DoPrivHelper.newTemporaryClassLoaderAction(
                getClass().getClassLoader()));
        Project project = new Project();
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration

        return bc;
    }

    public void testEnhancementOfSecondPUWithClassNotInFirstPU()
        throws IOException {
        OpenJPAConfiguration conf = new OpenJPAConfigurationImpl();
        Options opts = new Options();
        opts.setProperty("p",
            "META-INF/persistence.xml#second-persistence-unit");
        Configurations.populateConfiguration(conf, opts);
        MetaDataRepository repos = conf.getMetaDataRepositoryInstance();
        ClassLoader loader = AccessController
            .doPrivileged(J2DoPrivHelper.newTemporaryClassLoaderAction(
                getClass().getClassLoader()));
        Project project = new Project();
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration

        assertTrue(written.contains(className));
    }

    public void testEnhancementOfAllPUsWithinAResource()
        throws IOException {
        OpenJPAConfiguration conf = new OpenJPAConfigurationImpl();
        Options opts = new Options();
        opts.setProperty("p", "META-INF/persistence.xml");
        Configurations.populateConfiguration(conf, opts);
        MetaDataRepository repos = conf.getMetaDataRepositoryInstance();
        ClassLoader loader = AccessController
            .doPrivileged(J2DoPrivHelper.newTemporaryClassLoaderAction(
                getClass().getClassLoader()));
        Project project = new Project();
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration

                throw new MetaDataException(_loc.get("no-mapped-by", this,
                    _mappedBy));
            if (field.getMappedBy() != null)
                throw new MetaDataException(_loc.get("circ-mapped-by", this,
                    _mappedBy));
            OpenJPAConfiguration conf = getRepository().getConfiguration();
            boolean isAbstractMappingUniDirectional = getRepository().getMetaDataFactory().
                    getDefaults().isAbstractMappingUniDirectional(conf);
            if (isAbstractMappingUniDirectional) {
                if (field.getDeclaringMetaData().isAbstract())
                    throw new MetaDataException(_loc.get("no-mapped-by-in-mapped-super", field,
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.