Package org.apache.openjpa.lib.log

Examples of org.apache.openjpa.lib.log.Log


        throws SAXException {
        if (!isQueryMode())
            return false;

        String name = attrs.getValue("name");
        Log log = getLog();
        if (log.isTraceEnabled())
            log.trace(_loc.get("parse-native-query", name));

        QueryMetaData meta = getRepository().getCachedQueryMetaData(null, name);
        if (meta != null && log.isWarnEnabled())
            log.warn(_loc.get("override-query", name, currentLocation()));

        meta = getRepository().addQueryMetaData(null, name);
        meta.setDefiningType(_cls);
        meta.setQueryString(attrs.getValue("query"));
        meta.setLanguage(QueryLanguages.LANG_SQL);
View Full Code Here


        // if this is a locking select and the lock timeout is greater than
        // the configured query timeout, use the lock timeout
        if (forUpdate && _dict.supportsQueryTimeout && fetch != null
            && fetch.getLockTimeout() > stmnt.getQueryTimeout() * 1000) {
            int timeout = fetch.getLockTimeout();
            Log log = _conf.getLog(JDBCConfiguration.LOG_JDBC);
            if (timeout < 1000) {
                timeout = 1000;
                if (log.isWarnEnabled())
                    log.warn(_loc.get("millis-query-timeout"));
            }
            try {
                stmnt.setQueryTimeout(fetch.getLockTimeout() / 1000);
            }
            catch(SQLException e) {
                if(_dict.ignoreSQLExceptionOnSetQueryTimeout) {
                    if (log.isTraceEnabled()) {
                        log.trace(_loc.get("error-setting-query-timeout",
                            new Integer(timeout), e.getMessage()), e);
                    }  
                }
                else {
                    throw e;
View Full Code Here

        for (Iterator itr = pj.joins().iterator(); itr.hasNext();) {
            join = (Join) itr.next();
            if (join.getType() == Join.TYPE_INNER) {
                if (join.getForeignKey() != null
                    && !_dict.canOuterJoin(_joinSyntax, join.getForeignKey())) {
                    Log log = _conf.getLog(JDBCConfiguration.LOG_JDBC);
                    if (log.isWarnEnabled())
                        log.warn(_loc.get("cant-outer-fk",
                            join.getForeignKey()));
                } else
                    join.setType(Join.TYPE_OUTER);
            }
            if (add)
View Full Code Here

            }

            BrokerFactory factory = getBrokerFactory(cp, poolValue,
                pui.getClassLoader());
            if (transformerException != null) {
                Log log = factory.getConfiguration().getLog(
                    OpenJPAConfiguration.LOG_RUNTIME);
                if (log.isTraceEnabled()) {
                    log.warn(
                        _loc.get("transformer-registration-error-ex", pui),
                        transformerException);
                } else {
                    log.warn(
                        _loc.get("transformer-registration-error", pui));
                }
            }
            preloadMetaDataRepository(factory);          
            return JPAFacadeHelper.toEntityManagerFactory(factory);
View Full Code Here

    /**
     * Resolve metadata.
     */
    protected void resolveMeta(boolean runtime) {
        boolean embed = _owner != null && _owner.getDeclaredType() == _type;
        Log log = _repos.getLog();
        if (log.isTraceEnabled())
            log.trace(_loc.get((embed) ? "resolve-embed-meta" : "resolve-meta",
                this + "@" + System.identityHashCode(this)));

        if (runtime && !_type.isInterface() &&
            !ImplHelper.isManagedType(getRepository().getConfiguration(),_type))
            throw new MetaDataException(_loc.get("not-enhanced", _type));
View Full Code Here

    /**
     * Resolve mapping data. Logs resolve message and resolves super by default.
     */
    protected void resolveMapping(boolean runtime) {
        Log log = _repos.getLog();
        if (log.isTraceEnabled())
            log.trace(_loc.get("resolve-mapping", this + "@"
                + System.identityHashCode(this)));

        // make sure superclass is resolved first
        ClassMetaData sup = getPCSuperclassMetaData();
        if (sup != null)
View Full Code Here

    /**
     * Initialize mapping. Logs init message by default.
     */
    protected void initializeMapping() {
        Log log = _repos.getLog();
        if (log.isTraceEnabled())
            log.trace(_loc.get("init-mapping", this + "@"
                + System.identityHashCode(this)));
    }
View Full Code Here

        }

        if (obj != null && obj != _nullCacheValue)
            sel = (Select) obj;

        Log log = _conf.getLog(JDBCConfiguration.LOG_JDBC);
        if (log.isTraceEnabled()) {
            if (!found)
                log.trace(_loc.get("cache-missed", mapping, this.getClass()));
            else
                log.trace(_loc.get("cache-hit", mapping, this.getClass()));
        }

        if (sel == null)
            return null;
       
View Full Code Here

                    (_conf.getMetaDataRepositoryInstance());
            }

            _conf.close();
            _closed = true;
            Log log = _conf.getLog(OpenJPAConfiguration.LOG_RUNTIME);
            if (log.isTraceEnabled())
                _closedException = new IllegalStateException();
        } finally {
            unlock();
        }
    }
View Full Code Here

            // check again
            if (_readOnly)
                return;
            _readOnly = true;

            Log log = _conf.getLog(OpenJPAConfiguration.LOG_RUNTIME);
            if (log.isInfoEnabled())
                log.info(getFactoryInitializationBanner());
            if (log.isTraceEnabled()) {
                Map props = _conf.toProperties(true);
                String lineSep = J2DoPrivHelper.getLineSeparator();
                StringBuffer buf = new StringBuffer();
                Map.Entry entry;
                for (Iterator itr = props.entrySet().iterator();
                    itr.hasNext();) {
                    entry = (Map.Entry) itr.next();
                    buf.append(entry.getKey()).append(": ").
                        append(entry.getValue());
                    if (itr.hasNext())
                        buf.append(lineSep);
                }
                log.trace(_loc.get("factory-properties", buf.toString()));
            }

            // setup transient state
            setup();
View Full Code Here

TOP

Related Classes of org.apache.openjpa.lib.log.Log

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.