You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by to...@apache.org on 2005/12/29 23:47:48 UTC
cvs commit: db-ojb/src/java/org/apache/ojb/broker/accesslayer BasePrefetcher.java
tomdz 2005/12/29 14:47:48
Modified: src/java/org/apache/ojb/broker Tag: OJB_1_0_RELEASE
PersistenceBrokerInternal.java
src/java/org/apache/ojb/broker/accesslayer Tag:
OJB_1_0_RELEASE BasePrefetcher.java
Log:
Updated Javadoc
Removed superfluous getPKEnumeration from the internal PB interface
Revision Changes Path
No revision
No revision
1.1.2.6 +50 -60 db-ojb/src/java/org/apache/ojb/broker/PersistenceBrokerInternal.java
Index: PersistenceBrokerInternal.java
===================================================================
RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/PersistenceBrokerInternal.java,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -r1.1.2.5 -r1.1.2.6
--- PersistenceBrokerInternal.java 21 Dec 2005 22:22:08 -0000 1.1.2.5
+++ PersistenceBrokerInternal.java 29 Dec 2005 22:47:48 -0000 1.1.2.6
@@ -15,111 +15,101 @@
* limitations under the License.
*/
-import java.util.Enumeration;
-
import org.apache.ojb.broker.accesslayer.RelationshipPrefetcherFactory;
import org.apache.ojb.broker.core.QueryReferenceBroker;
import org.apache.ojb.broker.core.proxy.ProxyFactory;
import org.apache.ojb.broker.metadata.ClassDescriptor;
-import org.apache.ojb.broker.query.Query;
/**
- * Internal used extended version of {@link PersistenceBroker}
+ * Extended version of the {@link PersistenceBroker} specifying additional functionality
+ * that is only relevant internally.
*
- * @author <a href="mailto:arminw@apache.org">Armin Waibel</a>
+ * @author Armin Waibel
* @version $Id$
*/
public interface PersistenceBrokerInternal extends PersistenceBroker
{
/**
- * If <em>true</em> this instance is handled by a managed
- * environment - registered within a JTA transaction.
+ * Determines whether this instance is handled by a managed
+ * environment, i.e. whether it is registered within a JTA transaction.
+ *
+ * @return <code>true</code> if this broker is managed
*/
public boolean isManaged();
/**
- * Set <em>true</em> if this instance is registered within a
- * JTA transaction. On {@link #close()} call this flag was reset
- * to <em>false</em> automatic.
+ * Specifies whether this instance is handled by a managed
+ * environment, i.e. whether it is registered within a JTA transaction.
+ * Note that on {@link #close()} this will automatically be reset
+ * to <em>false</em>.
+ *
+ * @param managed <code>true</code> if this broker is managed
*/
public void setManaged(boolean managed);
/**
- * Method which start the real store work (insert or update)
- * and is intended for use by top-level api or internal calls.
+ * Performs the real store work (insert or update) and is intended for use by
+ * top-level apis internally.
*
- * @param obj The object to store.
- * @param oid The {@link Identity} of the object to store.
- * @param cld The {@link org.apache.ojb.broker.metadata.ClassDescriptor} of the object.
- * @param insert If <em>true</em> an insert operation will be performed, else update operation.
- * @param ignoreReferences With this flag the automatic storing/linking
- * of references can be suppressed (independent of the used auto-update setting in metadata),
- * except {@link org.apache.ojb.broker.metadata.SuperReferenceDescriptor}
- * these kind of reference (descriptor) will always be performed. If <em>true</em>
- * all "normal" referenced objects will be ignored, only the specified object is handled.
- */
- public void store(Object obj, Identity oid, ClassDescriptor cld, boolean insert, boolean ignoreReferences);
-
- /**
- * Deletes the concrete representation of the specified object in the underlying
- * persistence system. This method is intended for use in top-level api or
- * by internal calls.
+ * @param obj The object to store
+ * @param oid The identity of the object to store
+ * @param cld The class descriptor of the object
+ * @param insert If <em>true</em> an insert operation will be performed, else update
+ * operation
+ * @param ignoreReferences Whether automatic storing of contained references/collections (except
+ * super-references) shall be suppressed (independent of the auto-update
+ * setting in the metadata)
+ */
+ public void store(Object obj, Identity oid, ClassDescriptor cld, boolean insert, boolean ignoreReferences);
+
+ /**
+ * Deletes the persistence representation of the given object in the underlying
+ * persistence system. This method is intended for use in top-level apis internally.
*
- * @param obj The object to delete.
- * @param ignoreReferences With this flag the automatic deletion/unlinking
- * of references can be suppressed (independent of the used auto-delete setting in metadata),
- * except {@link org.apache.ojb.broker.metadata.SuperReferenceDescriptor}
- * these kind of reference (descriptor) will always be performed. If <em>true</em>
- * all "normal" referenced objects will be ignored, only the specified object is handled.
- * @throws PersistenceBrokerException
+ * @param obj The object to delete
+ * @param ignoreReferences Whether automatic deletion of contained references/collections (except
+ * super-references) shall be suppressed (independent of the auto-delete
+ * setting in the metadata)
*/
public void delete(Object obj, boolean ignoreReferences) throws PersistenceBrokerException;
/**
- * Answer the ReferenceBroker.
- * @return QueryReferenceBroker
+ * Returns the broker specifically for retrieving references via query.
+ *
+ * @return The query reference broker
*/
public QueryReferenceBroker getReferenceBroker();
/**
- * Check if the references of the specified object have enabled
- * the <em>refresh</em> attribute and refresh the reference if set <em>true</em>.
+ * Refreshes the references of the given object whose <code>refresh</code>
+ * is set to <code>true</code>.
*
- * @throws PersistenceBrokerException if there is a error refreshing collections or references
- * @param obj The object to check.
- * @param oid The {@link Identity} of the object.
- * @param cld The {@link org.apache.ojb.broker.metadata.ClassDescriptor} of the object.
+ * @param obj The object to check
+ * @param oid The identity of the object
+ * @param cld The class descriptor for the object
*/
public void checkRefreshRelationships(Object obj, Identity oid, ClassDescriptor cld);
/**
- * Return the relationship prefetcher factory.
+ * Return the factory for creating relationship prefetcher objects.
+ *
+ * @return The factory
*/
public RelationshipPrefetcherFactory getRelationshipPrefetcherFactory();
-
+
/**
- * Returns an Enumeration of PrimaryKey Objects for objects of class DataClass.
- * The Elements returned come from a SELECT ... WHERE Statement
- * that is defined by the fields and their coresponding values of vecFields
- * and vecValues.
- * Useful for EJB Finder Methods...
- * NOT YET AWARE OF EXTENTS !
- * @param PrimaryKeyClass the pk class for the searched objects
- * @param query the query
+ * Return the factory for creating proxies.
+ *
+ * @return The factory
*/
- public Enumeration getPKEnumerationByQuery(Class PrimaryKeyClass, Query query)
- throws PersistenceBrokerException;
-
public ProxyFactory getProxyFactory();
/**
- * Creates a proxy of the given type.
+ * Shortcut method for creating a proxy of the given type.
*
* @param proxyClass The proxy type
* @param realSubjectsIdentity The identity of the real subject
* @return The proxy
*/
public Object createProxy(Class proxyClass, Identity realSubjectsIdentity);
-
-
}
No revision
No revision
1.10.2.3 +11 -5 db-ojb/src/java/org/apache/ojb/broker/accesslayer/BasePrefetcher.java
Index: BasePrefetcher.java
===================================================================
RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/BasePrefetcher.java,v
retrieving revision 1.10.2.2
retrieving revision 1.10.2.3
diff -u -r1.10.2.2 -r1.10.2.3
--- BasePrefetcher.java 21 Dec 2005 22:22:58 -0000 1.10.2.2
+++ BasePrefetcher.java 29 Dec 2005 22:47:48 -0000 1.10.2.3
@@ -41,21 +41,27 @@
*/
public abstract class BasePrefetcher implements RelationshipPrefetcher
{
+ /** The numer of columns to query for. */
+ protected static final int IN_LIMIT = getPrefetchInLimit();
+
private Logger logger;
private PersistenceBrokerImpl broker;
+ /** Class descriptor for the item type. */
protected ClassDescriptor itemClassDesc;
- protected final int pkLimit; // max number of pk's in one query
-
- protected static final int IN_LIMIT = getPrefetchInLimit();
+ /** Maximum number of pk's in one query. */
+ protected final int pkLimit;
/**
- * read the prefetchInLimit from Config based on OJB.properties
+ * Returns the number of column to query for, from the configuration.
+ *
+ * @return The prefetch limit
*/
private static int getPrefetchInLimit()
{
try
{
PersistenceBrokerConfiguration config = (PersistenceBrokerConfiguration) PersistenceBrokerFactory.getConfigurator().getConfigurationFor(null);
+
return config.getSqlInLimit();
}
catch (ConfigurationException e)
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org