Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.openjpa.kernel;
import java.util.BitSet;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import org.apache.openjpa.conf.OpenJPAConfiguration;
import org.apache.openjpa.meta.ValueMetaData;
import org.apache.openjpa.util.UserException;
/**
* Represents a set of managed objects and their environment.
*
* @since 0.4.0
* @author Abe White
*/
public interface StoreContext {
/**
* Marker bitset to indicate that all field loads should be excluded in
* the find methods of this interface.
*/
public static final BitSet EXCLUDE_ALL = new BitSet(0);
public static final int OID_NOVALIDATE = 2 << 0;
public static final int OID_NODELETED = 2 << 1;
public static final int OID_COPY = 2 << 2;
public static final int OID_ALLOW_NEW = 2 << 3;
/**
* Return the broker for this context, if possible. Note that a broker
* will be unavailable in remote contexts, and this method may return null.
*/
public Broker getBroker();
/**
* Return the configuration associated with this context.
*/
public OpenJPAConfiguration getConfiguration();
/**
* Return the (mutable) fetch configuration for loading objects from this
* context.
*/
public FetchConfiguration getFetchConfiguration();
/**
* Pushes a new fetch configuration that inherits from the current
* fetch configuration onto a stack, and makes the new configuration
* the active one.
*
* @since 1.1.0
* @return the new fetch configuration
*/
public FetchConfiguration pushFetchConfiguration();
/**
* Pops the fetch configuration from the top of the stack, making the
* next one down the active one. This returns void to avoid confusion,
* since fetch configurations tend to be used in method-chaining
* patterns often.
*
* @since 1.1.0
* @throws UserException if the fetch configuration stack is empty
*/
public void popFetchConfiguration();
/**
* Return the current thread's class loader at the time this context
* was obtained.
*/
public ClassLoader getClassLoader();
/**
* Return the lock manager in use.
*/
public LockManager getLockManager();
/**
* Return the store manager in use. This will be a wrapper around the
* native store manager, which you can retrieve via
* {@link DelegatingStoreManager#getInnermostDelegate}.
*/
public DelegatingStoreManager getStoreManager();
/**
* Return the connection user name.
*/
public String getConnectionUserName();
/**
* Return the connection password.
*/
public String getConnectionPassword();
/**
* Return the instance for the given oid/object , or null if not
* found in the L1 cache.
*
* @param oid the object's id
* @return the cached object, or null if not cached
*/
public Object findCached(Object oid, FindCallbacks call);
/**
* Find the persistence object with the given oid. If
* validate is true, the broker will check the store
* for the object, and return null if it does not exist. If
* validate is false, this method never returns null. The
* broker will either return its cached instance, attempt to create a
* hollow instance, or throw an ObjectNotFoundException if
* unable to return a hollow instance.
*
* @param validate if true, validate that the instance exists in the
* store and load fetch group fields, otherwise return
* any cached or hollow instance
*/
public Object find(Object oid, boolean validate, FindCallbacks call);
/**
* Return the objects with the given oids.
*
* @param oids the oids of the objects to return
* @return the objects that were looked up, in the same order as the oids
* parameter
* @see #find(Object,boolean,FindCallbacks)
*/
public Object[] findAll(Collection