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

    /**
     * Validate that this field is supported by the runtime.
     */
    private void validateSupportedType() {
        // log warnings about things we don't handle
        OpenJPAConfiguration conf = getRepository().getConfiguration();
        Collection<String> opts = conf.supportedOptions();
        Log log = conf.getLog(OpenJPAConfiguration.LOG_METADATA);
        switch (getTypeCode()) {
            case JavaTypes.PC:
                if (isEmbedded() && !opts.contains(
                  OpenJPAConfiguration.OPTION_EMBEDDED_RELATION)) {
                    setEmbedded(false);
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

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());
       
        String[] fetchGroupList = conf.getFetchGroupsList();
        clearFetchGroups((fetchGroupList == null || fetchGroupList.length == 0));
       
        addFetchGroups(Arrays.asList(fetchGroupList));
        setMaxFetchDepth(conf.getMaxFetchDepth());
       
        _state.cacheNonDefaultFetchPlanQueries = conf.getCompatibilityInstance().getCacheNonDefaultFetchPlanQueries();
    }
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration

     */
    public static boolean run(final String[] args, Options opts) {
        return Configurations.runAgainstAllAnchors(opts,
            new Configurations.Runnable() {
            public boolean run(Options opts) throws IOException {
                OpenJPAConfiguration conf = new OpenJPAConfigurationImpl();
                try {
                    return PCEnhancer.run(conf, args, opts);
                } finally {
                    conf.close();
                }
            }
        });
    }
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration

    private void enhance() throws Exception {
        Properties props = getProperties(new String[]{
            "openjpa.DetachState", "DetachedStateField=true",
        });
        OpenJPAConfiguration conf = new OpenJPAConfigurationImpl(true, false);
        conf.fromProperties(props);

        Options opts = new Options();
        opts.put("jdo", "true");
        PCEnhancer.run(conf, new String[]{
            "org.apache.openjpa.persistence.kernel.noenhance.DetachSMPC" }, opts);
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration

    /**
     * Either throw a user exception or add the configuration to the given list,
     * based on <code>isLenient</code>.
     */
    private void handleBadConnection(boolean isLenient, Slice slice, Throwable ex) {
        OpenJPAConfiguration conf = slice.getConfiguration();
        String url = conf.getConnectionURL();
        Log log = conf.getConfigurationLog();
        if (isLenient) {
            if (ex != null) {
                log.warn(_loc.get("slice-connect-known-warn", slice, url, ex.getCause()));
            } else {
                log.warn(_loc.get("slice-connect-warn", slice, url));
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration

    public void setUp() {
       deleteAll(SeqE.class);
    }
   
    boolean supportsPessimisticLocking() {
        OpenJPAConfiguration conf = getConfiguration();
        return conf instanceof JDBCConfiguration
                && ((JDBCConfiguration) conf).getDBDictionaryInstance().
                supportsSelectForUpdate;
    }
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration

                + ", but contained: " + sql, 0, sql.size());
        }
    }

    private Seq seqForClass(Class cls) {
        OpenJPAConfiguration conf = getConfiguration();
        ClassMetaData meta = conf.getMetaDataRepositoryInstance().getMetaData
            (cls, null, true);
        SequenceMetaData smeta = meta.getIdentitySequenceMetaData();
        return (smeta == null) ? conf.getSequenceInstance()
            : smeta.getInstance(null);
    }
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration

        // We need to wait to preload until after we get back a fully configured/instantiated
        // BrokerFactory. This is because it is possible that someone has extended OpenJPA
        // functions and they need to be allowed time to configure themselves before we go off and
        // start instanting configurable objects (ie:openjpa.MetaDataRepository). Don't catch
        // any exceptions here because we want to fail-fast.
        OpenJPAConfiguration conf = factory.getConfiguration();
        Options o = Configurations.parseProperties(Configurations.getProperties(conf.getMetaDataRepository()));
        if (MetaDataRepository.needsPreload(o) == true) {
            MetaDataRepository mdr = conf.getMetaDataRepositoryInstance();
            mdr.setValidate(MetaDataRepository.VALIDATE_RUNTIME, true);
            mdr.setResolve(MetaDataRepository.MODE_MAPPING_INIT, true);
           
            // Load persistent classes and hook in subclasser
            ((AbstractBrokerFactory) factory).loadPersistentTypes((ClassLoader) AccessController
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.