Examples of StoreContext


Examples of org.apache.openjpa.kernel.StoreContext

        throws SQLException {
        Boolean isNull = indicatesNull(res);
        if (isNull == null)
            return null;

        StoreContext ctx = store.getContext();
        // load primary key of owner entity
        Object owner = field.getDefiningMapping().getObjectId(store, res,
            null, true, joins);
        OpenJPAStateManager em = ctx.embed(null, null, null, field);
        // set owner id
        ((StateManagerImpl) em).setOwner(owner);
        boolean needsLoad = loadFields(em, store, fetch, res);

        // After loading everything from result, load the rest of the
View Full Code Here

Examples of org.apache.openjpa.kernel.StoreContext

            accessPathClassNames.add(meta.getDescribedType().getName());
        }

        // if any of the types are currently dirty, we can't cache this query
        StoreContext ctx = q.getStoreContext();
        if (intersects(accessPathClassNames, ctx.getPersistedTypes())
            || intersects(accessPathClassNames, ctx.getUpdatedTypes())
            || intersects(accessPathClassNames, ctx.getDeletedTypes()))
            return null;

        // calculate the timeout for the key
        MetaDataRepository repos = ctx.getConfiguration().
            getMetaDataRepositoryInstance();

        // won't find metadata for interfaces.
        if (candidateClass.isInterface())
            return null;
        meta = repos.getMetaData(candidateClass, ctx.getClassLoader(), true);
        int timeout = meta.getDataCacheTimeout();
        if (subclasses) {
            metas = meta.getPCSubclassMetaDatas();
            int subTimeout;
            for (int i = 0; i < metas.length; i++) {
View Full Code Here

Examples of org.apache.openjpa.kernel.StoreContext

     * Access JDBC configuration information. May return null if not a
     * JDBC back-end (possible to get a JDBCFetchConfiguration on non-JDBC
     * back end in remote client).
     */
    private JDBCConfiguration getJDBCConfiguration() {
        StoreContext ctx = getContext();
        if (ctx == null)
            return null;
        OpenJPAConfiguration conf = ctx.getConfiguration();
        if (!(conf instanceof JDBCConfiguration))
            return null;
        return (JDBCConfiguration) conf;
    }
View Full Code Here

Examples of org.apache.openjpa.kernel.StoreContext

            case JavaTypes.PC:
            case JavaTypes.PC_UNTYPED:
                // for relations to other persistent objects, we store the
                // related object's oid -- convert it back into a persistent
                // instance
                StoreContext ctx = sm.getContext();
                Object pc = ctx.find(val, fetch, null, null, 0);
                if (pc != null)
                    return pc;
                OrphanedKeyAction action = ctx.getConfiguration().
                    getOrphanedKeyActionInstance();
                return action.orphan(val, sm, vmd);
            default:
                return val;
        }
View Full Code Here

Examples of org.apache.openjpa.kernel.StoreContext

    private void assertQueryExtensions(String clause) {
        OpenJPAConfiguration conf = resolver.getConfiguration();
        switch(conf.getCompatibilityInstance().getJPQL()) {
            case Compatibility.JPQL_WARN:
                // check if we've already warned for this query-factory combo
                StoreContext ctx = resolver.getQueryContext().getStoreContext();
                String query = currentQuery();
                if (ctx.getBroker() != null && query != null) {
                    String key = getClass().getName() + ":" + query;
                    BrokerFactory factory = ctx.getBroker().getBrokerFactory();
                    Object hasWarned = factory.getUserObject(key);
                    if (hasWarned != null)
                        break;
                    else
                        factory.putUserObject(key, Boolean.TRUE);
View Full Code Here

Examples of org.apache.openjpa.kernel.StoreContext

            accessPathClassNames.add(meta.getDescribedType().getName());
        }

        // if any of the types are currently dirty, we can't cache this query
        StoreContext ctx = q.getStoreContext();
        if (intersects(accessPathClassNames, ctx.getPersistedTypes())
            || intersects(accessPathClassNames, ctx.getUpdatedTypes())
            || intersects(accessPathClassNames, ctx.getDeletedTypes()))
            return null;

        // calculate the timeout for the key
        MetaDataRepository repos = ctx.getConfiguration().
            getMetaDataRepositoryInstance();

        // won't find metadata for interfaces.
        if (candidateClass.isInterface())
            return null;
        meta = repos.getMetaData(candidateClass, ctx.getClassLoader(), true);
        int timeout = meta.getDataCacheTimeout();
        if (subclasses) {
            metas = meta.getPCSubclassMetaDatas();
            int subTimeout;
            for (int i = 0; i < metas.length; i++) {
View Full Code Here

Examples of org.apache.openjpa.kernel.StoreContext

        }

        // null inverse columns for deletes and update them with our oid for
        // inserts
        ClassMapping rel = field.getElementMapping().getTypeMapping();
        StoreContext ctx = store.getContext();
        if (field.getMappedBy() == null) {
            Collection rem = ct.getRemoved();
            for (Iterator itr = rem.iterator(); itr.hasNext();)
                updateInverse(ctx, itr.next(), rel, rm, null, 0);
        }
View Full Code Here

Examples of org.apache.openjpa.kernel.StoreContext

        if (!sm.getLoaded().get(field.getIndex()))
            return;

        // update fk on each field value row
        ClassMapping rel = field.getElementMapping().getTypeMapping();
        StoreContext ctx = store.getContext();
        Collection objs = toCollection(sm.fetchObject(field.getIndex()));
        if (objs != null && !objs.isEmpty())
            for (Iterator itr = objs.iterator(); itr.hasNext();)
                updateInverse (ctx, itr.next(), rel, rm, sm, 0);
    }
View Full Code Here

Examples of org.apache.openjpa.kernel.StoreContext

        //### note: without a null indicator column, the above indicatesNull()
        //### call will always return false, meaning we always have to assume
        //### we selected the embedded object fields and load the object
        //### immediately; this will be inefficient when the embedded object
        //### was not selected after all
        StoreContext ctx = store.getContext();
        OpenJPAStateManager em = ctx.embed(null, null, sm, field);
        sm.storeObject(field.getIndex(), em.getManagedInstance());

        FieldMapping[] fields = field.getEmbeddedMapping().getFieldMappings();
        Object eres, processed;
        boolean needsLoad = false;
View Full Code Here

Examples of org.apache.qpid.server.store.StoreContext

        final AMQMessageHandle amqMessageHandle = (new MessageHandleFactory()).createMessageHandle(messageId,
                                                                                                   null,
                                                                                                   false);
        try
        {
            amqMessageHandle.setPublishAndContentHeaderBody(new StoreContext(),
                                                              publishBody,
                                                              new ContentHeaderBody()
            {
                public int getSize()
                {
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.