You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2009/10/03 20:52:30 UTC
svn commit: r821391 - in /ofbiz/trunk/framework:
base/src/org/ofbiz/base/util/ entity/src/org/ofbiz/entity/
Author: adrianc
Date: Sat Oct 3 18:52:29 2009
New Revision: 821391
URL: http://svn.apache.org/viewvc?rev=821391&view=rev
Log:
Improvements to the GenericDelegator refactoring - based on suggestions from Adam Heath.
I removed the deprecated methods from the Delegator interface. So, any replacements of GenericDelegator.getGenericDelegator(...) with the new factory method will have to include code to replace the deprecated method calls.
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/Factory.java
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilObject.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/Delegator.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/DelegatorFactory.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/DelegatorFactoryImpl.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/Factory.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/Factory.java?rev=821391&r1=821390&r2=821391&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/Factory.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/Factory.java Sat Oct 3 18:52:29 2009
@@ -19,14 +19,17 @@
package org.ofbiz.base.util;
/** Factory interface. */
-public interface Factory<T> {
+public interface Factory<R, A> {
- /** Returns an instance of <code>T</code>.
+ /** Returns an instance of <code>R</code>. This is a basic factory interface
+ * that is meant to be extended. Sub-interfaces declare types for
+ * <code>A</code> (the <code>getInstance</code> argument), and
+ * <code>R</code> (the type returned by <code>getInstance</code>).
*
- * @param obj Optional object to be used in <code>T</code>'s construction,
+ * @param obj Optional object to be used in <code>R</code>'s construction,
* or to be used as a selector key
- * @return An instance of <code>T</code>
+ * @return An instance of <code>R</code>
*/
- public T getInstance(Object obj);
+ public R getInstance(A obj);
}
Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilObject.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilObject.java?rev=821391&r1=821390&r2=821391&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilObject.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilObject.java Sat Oct 3 18:52:29 2009
@@ -174,12 +174,11 @@
return o1.hashCode();
}
- @SuppressWarnings("unchecked")
- public static <T> T getObjectFromFactory(Class<T> factoryInterface, Object obj) throws ClassNotFoundException {
- Iterator<Factory<T>> it = (Iterator<Factory<T>>) ServiceRegistry.lookupProviders(factoryInterface);
+ public static <A, R> R getObjectFromFactory(Class<? extends Factory<R, A>> factoryInterface, A obj) throws ClassNotFoundException {
+ Iterator<? extends Factory<R, A>> it = ServiceRegistry.lookupProviders(factoryInterface);
while (it.hasNext()) {
- Factory<T> factory = it.next();
- T instance = factory.getInstance(obj);
+ Factory<R, A> factory = it.next();
+ R instance = factory.getInstance(obj);
if (instance != null) {
return instance;
}
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/Delegator.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/Delegator.java?rev=821391&r1=821390&r2=821391&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/Delegator.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/Delegator.java Sat Oct 3 18:52:29 2009
@@ -287,159 +287,6 @@
public EntityListIterator find(String entityName, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, Set<String> fieldsToSelect, List<String> orderBy, EntityFindOptions findOptions) throws GenericEntityException;
/**
- * Finds all Generic entities NOTE 20080502: 14 references; all changed to
- * findList
- *
- * @param entityName
- * The Name of the Entity as defined in the entity XML file
- * @return List containing all Generic entities
- * @deprecated Use findList() instead
- */
- @Deprecated
- public List<GenericValue> findAll(String entityName) throws GenericEntityException;
-
- /**
- * Finds all Generic entities NOTE 20080502: 10 references; all changed to
- * findList
- *
- * @param entityName
- * The Name of the Entity as defined in the entity XML file
- * @param orderBy
- * The fields of the named entity to order the query by;
- * optionally add a " ASC" for ascending or " DESC" for
- * descending
- * @return List containing all Generic entities
- * @deprecated Use findList() instead
- */
- @Deprecated
- public List<GenericValue> findAll(String entityName, List<String> orderBy) throws GenericEntityException;
-
- /**
- * Finds all Generic entities NOTE 20080502: 0 references
- *
- * @param entityName
- * The Name of the Entity as defined in the entity XML file
- * @param orderBy
- * The fields of the named entity to order the query by;
- * optionally add a " ASC" for ascending or " DESC" for
- * descending
- * @return List containing all Generic entities
- * @deprecated Use findList() instead
- */
- @Deprecated
- public List<GenericValue> findAll(String entityName, String... orderBy) throws GenericEntityException;
-
- /**
- * Find a number of Generic Value objects by their Primary Keys, all at once
- * NOTE 20080502: 0 references
- *
- * @param primaryKeys
- * A Collection of primary keys to find by.
- * @return List of GenericValue objects corresponding to the passed
- * primaryKey objects
- * @deprecated
- */
- @Deprecated
- public List<GenericValue> findAllByPrimaryKeys(Collection<GenericPK> primaryKeys) throws GenericEntityException;
-
- /**
- * Find a number of Generic Value objects by their Primary Keys, all at
- * once; this first looks in the local cache for each PK and if there then
- * it puts it in the return list rather than putting it in the batch to send
- * to a given helper. NOTE 20080502: 0 references
- *
- * @param primaryKeys
- * A Collection of primary keys to find by.
- * @return List of GenericValue objects corresponding to the passed
- * primaryKey objects
- * @deprecated
- */
- @Deprecated
- public List<GenericValue> findAllByPrimaryKeysCache(Collection<GenericPK> primaryKeys) throws GenericEntityException;
-
- /**
- * Finds all Generic entities, looking first in the cache NOTE 20080502: 4
- * references; all changed to findList
- *
- * @param entityName
- * The Name of the Entity as defined in the entity XML file
- * @return List containing all Generic entities
- * @deprecated Use findList() instead
- */
- @Deprecated
- public List<GenericValue> findAllCache(String entityName) throws GenericEntityException;
-
- /**
- * Finds all Generic entities, looking first in the cache; uses orderBy for
- * lookup, but only keys results on the entityName and fields NOTE 20080502:
- * 2 references; all changed to findList
- *
- * @param entityName
- * The Name of the Entity as defined in the entity XML file
- * @param orderBy
- * The fields of the named entity to order the query by;
- * optionally add a " ASC" for ascending or " DESC" for
- * descending
- * @return List containing all Generic entities
- * @deprecated Use findList() instead
- */
- @Deprecated
- public List<GenericValue> findAllCache(String entityName, List<String> orderBy) throws GenericEntityException;
-
- /**
- * Finds all Generic entities, looking first in the cache; uses orderBy for
- * lookup, but only keys results on the entityName and fields NOTE 20080502:
- * 0 references
- *
- * @param entityName
- * The Name of the Entity as defined in the entity XML file
- * @param orderBy
- * The fields of the named entity to order the query by;
- * optionally add a " ASC" for ascending or " DESC" for
- * descending
- * @return List containing all Generic entities
- * @deprecated Use findList() instead
- */
- @Deprecated
- public List<GenericValue> findAllCache(String entityName, String... orderBy) throws GenericEntityException;
-
- /**
- * Finds Generic Entity records by all of the specified expressions (ie:
- * combined using AND) NOTE 20080502: 11 references; all changed to findList
- *
- * @param entityName
- * The Name of the Entity as defined in the entity XML file
- * @param expressions
- * The expressions to use for the lookup, each consisting of at
- * least a field name, an EntityOperator, and a value to compare
- * to
- * @return List of GenericValue instances that match the query
- * @deprecated Use findList() instead
- */
- @Deprecated
- public <T extends EntityCondition> List<GenericValue> findByAnd(String entityName, List<T> expressions) throws GenericEntityException;
-
- /**
- * Finds Generic Entity records by all of the specified expressions (ie:
- * combined using AND) NOTE 20080502: 24 references; all changed to findList
- *
- * @param entityName
- * The Name of the Entity as defined in the entity XML file
- * @param expressions
- * The expressions to use for the lookup, each consisting of at
- * least a field name, an EntityOperator, and a value to compare
- * to
- * @param orderBy
- * The fields of the named entity to order the query by;
- * optionally add a " ASC" for ascending or " DESC" for
- * descending
- * @return List of GenericValue instances that match the query
- * @deprecated Use findList() instead
- */
- @Deprecated
- public <T extends EntityCondition> List<GenericValue> findByAnd(String entityName, List<T> expressions, List<String> orderBy) throws GenericEntityException;
-
- /**
* Finds Generic Entity records by all of the specified fields (ie: combined
* using AND) NOTE 20080502: 264 references
*
@@ -483,22 +330,6 @@
public List<GenericValue> findByAnd(String entityName, Object... fields) throws GenericEntityException;
/**
- * Finds Generic Entity records by all of the specified expressions (ie:
- * combined using AND) NOTE 20080502: 0 references
- *
- * @param entityName
- * The Name of the Entity as defined in the entity XML file
- * @param expressions
- * The expressions to use for the lookup, each consisting of at
- * least a field name, an EntityOperator, and a value to compare
- * to
- * @return List of GenericValue instances that match the query
- * @deprecated Use findList() instead
- */
- @Deprecated
- public <T extends EntityCondition> List<GenericValue> findByAnd(String entityName, T... expressions) throws GenericEntityException;
-
- /**
* Finds Generic Entity records by all of the specified fields (ie: combined
* using AND), looking first in the cache; uses orderBy for lookup, but only
* keys results on the entityName and fields NOTE 20080502: 91 references
@@ -531,236 +362,6 @@
public List<GenericValue> findByAndCache(String entityName, Map<String, ? extends Object> fields, List<String> orderBy) throws GenericEntityException;
/**
- * Finds Generic Entity records by all of the specified fields (ie: combined
- * using AND), looking first in the cache; uses orderBy for lookup, but only
- * keys results on the entityName and fields NOTE 20080502: 0 references
- *
- * @param entityName
- * The Name of the Entity as defined in the entity XML file
- * @param fields
- * The fields of the named entity to query by with their
- * corresponding values
- * @return List of GenericValue instances that match the query
- * @deprecated Use findList() instead
- */
- @Deprecated
- public List<GenericValue> findByAndCache(String entityName, Object... fields) throws GenericEntityException;
-
- /**
- * Finds GenericValues by the conditions specified in the EntityCondition
- * object, the the EntityCondition javadoc for more details. NOTE 20080502:
- * 64 references; all changed to findList
- *
- * @param entityName
- * The Name of the Entity as defined in the entity model XML file
- * @param entityCondition
- * The EntityCondition object that specifies how to constrain
- * this query
- * @param fieldsToSelect
- * The fields of the named entity to get from the database; if
- * empty or null all fields will be retreived
- * @param orderBy
- * The fields of the named entity to order the query by;
- * optionally add a " ASC" for ascending or " DESC" for
- * descending
- * @return List of GenericValue objects representing the result
- * @deprecated Use findList() instead
- */
- @Deprecated
- public List<GenericValue> findByCondition(String entityName, EntityCondition entityCondition, Collection<String> fieldsToSelect, List<String> orderBy) throws GenericEntityException;
-
- /**
- * Finds GenericValues by the conditions specified in the EntityCondition
- * object, the the EntityCondition javadoc for more details. NOTE 20080502:
- * 6 references; all changed to findList
- *
- * @param entityName
- * The name of the Entity as defined in the entity XML file
- * @param whereEntityCondition
- * The EntityCondition object that specifies how to constrain
- * this query before any groupings are done (if this is a view
- * entity with group-by aliases)
- * @param havingEntityCondition
- * The EntityCondition object that specifies how to constrain
- * this query after any groupings are done (if this is a view
- * entity with group-by aliases)
- * @param fieldsToSelect
- * The fields of the named entity to get from the database; if
- * empty or null all fields will be retreived
- * @param orderBy
- * The fields of the named entity to order the query by;
- * optionally add a " ASC" for ascending or " DESC" for
- * descending
- * @param findOptions
- * An instance of EntityFindOptions that specifies advanced query
- * options. See the EntityFindOptions JavaDoc for more details.
- * @return List of GenericValue objects representing the result
- * @deprecated Use findList() instead
- */
- @Deprecated
- public List<GenericValue> findByCondition(String entityName, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, Collection<String> fieldsToSelect, List<String> orderBy, EntityFindOptions findOptions) throws GenericEntityException;
-
- /**
- * Finds GenericValues by the conditions specified in the EntityCondition
- * object, looking first in the cache, see the EntityCondition javadoc for
- * more details. NOTE 20080502: 17 references; all changed to findList
- *
- * @param entityName
- * The Name of the Entity as defined in the entity model XML file
- * @param entityCondition
- * The EntityCondition object that specifies how to constrain
- * this query
- * @param fieldsToSelect
- * The fields of the named entity to get from the database; if
- * empty or null all fields will be retreived
- * @param orderBy
- * The fields of the named entity to order the query by;
- * optionally add a " ASC" for ascending or " DESC" for
- * descending
- * @return List of GenericValue objects representing the result
- * @deprecated Use findList() instead
- */
- @Deprecated
- public List<GenericValue> findByConditionCache(String entityName, EntityCondition entityCondition, Collection<String> fieldsToSelect, List<String> orderBy) throws GenericEntityException;
-
- /**
- * NOTE 20080502: 1 references; all changed to findList
- *
- * @deprecated Use findList() instead
- */
- @Deprecated
- public List<GenericValue> findByLike(String entityName, Map<String, ? extends Object> fields) throws GenericEntityException;
-
- /**
- * NOTE 20080502: 1 references; all changed to findList
- *
- * @deprecated Use findList() instead
- */
- @Deprecated
- public List<GenericValue> findByLike(String entityName, Map<String, ? extends Object> fields, List<String> orderBy) throws GenericEntityException;
-
- /**
- * NOTE 20080502: 0 references
- *
- * @deprecated Use findList() instead
- */
- @Deprecated
- public List<GenericValue> findByLike(String entityName, Object... fields) throws GenericEntityException;
-
- /**
- * Finds Generic Entity records by all of the specified expressions (ie:
- * combined using OR) NOTE 20080502: 2 references; all changed to findList
- *
- * @param entityName
- * The Name of the Entity as defined in the entity XML file
- * @param expressions
- * The expressions to use for the lookup, each consisting of at
- * least a field name, an EntityOperator, and a value to compare
- * to
- * @return List of GenericValue instances that match the query
- * @deprecated Use findList() instead
- */
- @Deprecated
- public <T extends EntityCondition> List<GenericValue> findByOr(String entityName, List<T> expressions) throws GenericEntityException;
-
- /**
- * Finds Generic Entity records by all of the specified expressions (ie:
- * combined using OR) NOTE 20080502: 0 references
- *
- * @param entityName
- * The Name of the Entity as defined in the entity XML file
- * @param expressions
- * The expressions to use for the lookup, each consisting of at
- * least a field name, an EntityOperator, and a value to compare
- * to
- * @param orderBy
- * The fields of the named entity to order the query by;
- * optionally add a " ASC" for ascending or " DESC" for
- * descending
- * @return List of GenericValue instances that match the query
- * @deprecated Use findList() instead
- */
- @Deprecated
- public <T extends EntityCondition> List<GenericValue> findByOr(String entityName, List<T> expressions, List<String> orderBy) throws GenericEntityException;
-
- /**
- * Finds Generic Entity records by all of the specified fields (ie: combined
- * using OR) NOTE 20080502: 1 references; all changed to findList
- *
- * @param entityName
- * The Name of the Entity as defined in the entity XML file
- * @param fields
- * The fields of the named entity to query by with their
- * corresponding values
- * @return List of GenericValue instances that match the query
- * @deprecated Use findList() instead
- */
- @Deprecated
- public List<GenericValue> findByOr(String entityName, Map<String, ? extends Object> fields) throws GenericEntityException;
-
- /**
- * Finds Generic Entity records by all of the specified fields (ie: combined
- * using OR) NOTE 20080502: 1 references; all changed to findList
- *
- * @param entityName
- * The Name of the Entity as defined in the entity XML file
- * @param fields
- * The fields of the named entity to query by with their
- * corresponding values
- * @param orderBy
- * The fields of the named entity to order the query by;
- * optionally add a " ASC" for ascending or " DESC" for
- * descending
- * @return List of GenericValue instances that match the query
- * @deprecated Use findList() instead
- */
- @Deprecated
- public List<GenericValue> findByOr(String entityName, Map<String, ? extends Object> fields, List<String> orderBy) throws GenericEntityException;
-
- /**
- * Finds Generic Entity records by all of the specified fields (ie: combined
- * using OR) NOTE 20080502: 0 references
- *
- * @param entityName
- * The Name of the Entity as defined in the entity XML file
- * @param fields
- * The fields of the named entity to query by with their
- * corresponding values
- * @return List of GenericValue instances that match the query
- * @deprecated Use findList() instead
- */
- @Deprecated
- public List<GenericValue> findByOr(String entityName, Object... fields) throws GenericEntityException;
-
- /**
- * Finds Generic Entity records by all of the specified expressions (ie:
- * combined using OR) NOTE 20080502: 0 references
- *
- * @param entityName
- * The Name of the Entity as defined in the entity XML file
- * @param expressions
- * The expressions to use for the lookup, each consisting of at
- * least a field name, an EntityOperator, and a value to compare
- * to
- * @return List of GenericValue instances that match the query
- * @deprecated Use findList() instead
- */
- @Deprecated
- public <T extends EntityCondition> List<GenericValue> findByOr(String entityName, T... expressions) throws GenericEntityException;
-
- /**
- * Find a Generic Entity by its Primary Key NOTE 20080502: 15 references;
- * all changed to findOne
- *
- * @param primaryKey
- * The primary key to find by.
- * @return The GenericValue corresponding to the primaryKey
- * @deprecated Use findOne() instead
- */
- @Deprecated
- public GenericValue findByPrimaryKey(GenericPK primaryKey) throws GenericEntityException;
-
- /**
* Find a Generic Entity by its Primary Key NOTE 20080502: 550 references
* (20080503 521 left); needs to be deprecated, should use findOne instead,
* but lots of stuff to replace!
@@ -775,33 +376,6 @@
public GenericValue findByPrimaryKey(String entityName, Map<String, ? extends Object> fields) throws GenericEntityException;
/**
- * Find a Generic Entity by its Primary Key NOTE 20080502: 21 references;
- * all changed to findOne
- *
- * @param entityName
- * The Name of the Entity as defined in the entity XML file
- * @param fields
- * The fields of the named entity to query by with their
- * corresponding values
- * @return The GenericValue corresponding to the primaryKey
- * @deprecated Use findOne() instead
- */
- @Deprecated
- public GenericValue findByPrimaryKey(String entityName, Object... fields) throws GenericEntityException;
-
- /**
- * Find a CACHED Generic Entity by its Primary Key NOTE 20080502: 2
- * references; all changed to findOne
- *
- * @param primaryKey
- * The primary key to find by.
- * @return The GenericValue corresponding to the primaryKey
- * @deprecated Use findOne() instead
- */
- @Deprecated
- public GenericValue findByPrimaryKeyCache(GenericPK primaryKey) throws GenericEntityException;
-
- /**
* Find a CACHED Generic Entity by its Primary Key NOTE 20080502: 218
* references
*
@@ -828,19 +402,6 @@
public GenericValue findByPrimaryKeyCache(String entityName, Object... fields) throws GenericEntityException;
/**
- * Find a CACHED Generic Entity by its Primary Key NOTE 20080502: 0
- * references
- *
- * @param entityName
- * The Name of the Entity as defined in the entity XML file
- * @param singlePkValue
- * @return The GenericValue corresponding to the primaryKey
- * @deprecated Use findOne() instead
- */
- @Deprecated
- public GenericValue findByPrimaryKeyCacheSingle(String entityName, Object singlePkValue) throws GenericEntityException;
-
- /**
* Find a Generic Entity by its Primary Key and only returns the values
* requested by the passed keys (names) NOTE 20080502: 3 references
*
@@ -854,66 +415,6 @@
public GenericValue findByPrimaryKeyPartial(GenericPK primaryKey, Set<String> keys) throws GenericEntityException;
/**
- * Find a Generic Entity by its Primary Key and only returns the values
- * requested by the passed keys (names) NOTE 20080502: 0 references
- *
- * @param primaryKey
- * The primary key to find by.
- * @param keys
- * The keys, or names, of the values to retrieve; only these
- * values will be retrieved
- * @return The GenericValue corresponding to the primaryKey
- * @deprecated Use findByPrimaryKeyPartial(GenericPK, Set<String>) instead
- */
- @Deprecated
- public GenericValue findByPrimaryKeyPartial(GenericPK primaryKey, String... keys) throws GenericEntityException;
-
- /**
- * Find a Generic Entity by its Primary Key NOTE 20080502: 0 references
- *
- * @param entityName
- * The Name of the Entity as defined in the entity XML file
- * @param singlePkValue
- * @return The GenericValue corresponding to the primaryKey
- * @deprecated Use findOne() instead
- */
- @Deprecated
- public GenericValue findByPrimaryKeySingle(String entityName, Object singlePkValue) throws GenericEntityException;
-
- /**
- * NOTE 20080502: 3 references; all changed to findCoundByCondition
- *
- * @deprecated Use findCountByCondition() instead
- */
- @Deprecated
- public long findCountByAnd(String entityName) throws GenericEntityException;
-
- /**
- * NOTE 20080502: 8 references; all changed to use findCountByCondition
- *
- * @deprecated Use findCountByCondition() instead
- */
- @Deprecated
- public long findCountByAnd(String entityName, Map<String, ? extends Object> fields) throws GenericEntityException;
-
- /**
- * NOTE 20080502: 1 references; all changed to use findCountByCondition
- *
- * @deprecated Use findCountByCondition() instead
- */
- @Deprecated
- public long findCountByAnd(String entityName, Object... fields) throws GenericEntityException;
-
- /**
- * NOTE 20080502: 17 references; all changed to use remaining
- * findCountByCondition
- *
- * @deprecated Use findCountByCondition() instead
- */
- @Deprecated
- public long findCountByCondition(String entityName, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition) throws GenericEntityException;
-
- /**
* NOTE 20080502: 2 references
*/
public long findCountByCondition(String entityName, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, EntityFindOptions findOptions) throws GenericEntityException;
@@ -977,67 +478,6 @@
public EntityListIterator findListIteratorByCondition(DynamicViewEntity dynamicViewEntity, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, Collection<String> fieldsToSelect, List<String> orderBy, EntityFindOptions findOptions) throws GenericEntityException;
/**
- * Finds GenericValues by the conditions specified in the EntityCondition
- * object, the the EntityCondition javadoc for more details. NOTE 20080502:
- * 26 references; all changed to find
- *
- * @param entityName
- * The Name of the Entity as defined in the entity model XML file
- * @param entityCondition
- * The EntityCondition object that specifies how to constrain
- * this query before any groupings are done (if this is a view
- * entity with group-by aliases)
- * @param fieldsToSelect
- * The fields of the named entity to get from the database; if
- * empty or null all fields will be retreived
- * @param orderBy
- * The fields of the named entity to order the query by;
- * optionally add a " ASC" for ascending or " DESC" for
- * descending
- * @return EntityListIterator representing the result of the query: NOTE
- * THAT THIS MUST BE CLOSED WHEN YOU ARE DONE WITH IT, AND DON'T
- * LEAVE IT OPEN TOO LONG BEACUSE IT WILL MAINTAIN A DATABASE
- * CONNECTION.
- * @deprecated Use find() instead
- */
- @Deprecated
- public EntityListIterator findListIteratorByCondition(String entityName, EntityCondition entityCondition, Collection<String> fieldsToSelect, List<String> orderBy) throws GenericEntityException;
-
- /**
- * Finds GenericValues by the conditions specified in the EntityCondition
- * object, the the EntityCondition javadoc for more details. NOTE 20080502:
- * 12 references; all changed to find
- *
- * @param entityName
- * The name of the Entity as defined in the entity XML file
- * @param whereEntityCondition
- * The EntityCondition object that specifies how to constrain
- * this query before any groupings are done (if this is a view
- * entity with group-by aliases)
- * @param havingEntityCondition
- * The EntityCondition object that specifies how to constrain
- * this query after any groupings are done (if this is a view
- * entity with group-by aliases)
- * @param fieldsToSelect
- * The fields of the named entity to get from the database; if
- * empty or null all fields will be retreived
- * @param orderBy
- * The fields of the named entity to order the query by;
- * optionally add a " ASC" for ascending or " DESC" for
- * descending
- * @param findOptions
- * An instance of EntityFindOptions that specifies advanced query
- * options. See the EntityFindOptions JavaDoc for more details.
- * @return EntityListIterator representing the result of the query: NOTE
- * THAT THIS MUST BE CLOSED WHEN YOU ARE DONE WITH IT, AND DON'T
- * LEAVE IT OPEN TOO LONG BEACUSE IT WILL MAINTAIN A DATABASE
- * CONNECTION.
- * @deprecated Use find() instead
- */
- @Deprecated
- public EntityListIterator findListIteratorByCondition(String entityName, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, Collection<String> fieldsToSelect, List<String> orderBy, EntityFindOptions findOptions) throws GenericEntityException;
-
- /**
* Find a Generic Entity by its Primary Key NOTE 20080502: 6 references
*
* @param entityName
@@ -1298,24 +738,6 @@
/**
* Get the named Related Entity for the GenericValue from the persistent
- * store NOTE 20080502: 1 references; all changed to use remaining
- * getRelated
- *
- * @param relationName
- * String containing the relation name which is the combination
- * of relation.title and relation.rel-entity-name as specified in
- * the entity XML definition file
- * @param value
- * GenericValue instance containing the entity
- * @return List of GenericValue instances as specified in the relation
- * definition
- * @deprecated Use getRelated() instead
- */
- @Deprecated
- public List<GenericValue> getRelated(String relationName, GenericValue value) throws GenericEntityException;
-
- /**
- * Get the named Related Entity for the GenericValue from the persistent
* store NOTE 20080502: 5 references
*
* @param relationName
@@ -1337,25 +759,6 @@
/**
* Get the named Related Entity for the GenericValue from the persistent
- * store NOTE 20080502: 1 references; all changed to use getRelated
- *
- * @param relationName
- * String containing the relation name which is the combination
- * of relation.title and relation.rel-entity-name as specified in
- * the entity XML definition file
- * @param byAndFields
- * the fields that must equal in order to keep; may be null
- * @param value
- * GenericValue instance containing the entity
- * @return List of GenericValue instances as specified in the relation
- * definition
- * @deprecated Use getRelated() instead
- */
- @Deprecated
- public List<GenericValue> getRelatedByAnd(String relationName, Map<String, ? extends Object> byAndFields, GenericValue value) throws GenericEntityException;
-
- /**
- * Get the named Related Entity for the GenericValue from the persistent
* store, checking first in the cache to see if the desired value is there
* NOTE 20080502: 4 references
*
@@ -1406,27 +809,6 @@
*/
public GenericValue getRelatedOneCache(String relationName, GenericValue value) throws GenericEntityException;
- /**
- * Get the named Related Entity for the GenericValue from the persistent
- * store NOTE 20080502: 1 references; all changed to use getRelated
- *
- * @param relationName
- * String containing the relation name which is the combination
- * of relation.title and relation.rel-entity-name as specified in
- * the entity XML definition file
- * @param orderBy
- * The fields of the named entity to order the query by; may be
- * null; optionally add a " ASC" for ascending or " DESC" for
- * descending
- * @param value
- * GenericValue instance containing the entity
- * @return List of GenericValue instances as specified in the relation
- * definition
- * @deprecated Use getRelated() instead
- */
- @Deprecated
- public List<GenericValue> getRelatedOrderBy(String relationName, List<String> orderBy, GenericValue value) throws GenericEntityException;
-
public void initEntityEcaHandler();
public GenericPK makePK(Element element);
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/DelegatorFactory.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/DelegatorFactory.java?rev=821391&r1=821390&r2=821391&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/DelegatorFactory.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/DelegatorFactory.java Sat Oct 3 18:52:29 2009
@@ -20,4 +20,5 @@
import org.ofbiz.base.util.Factory;
-public interface DelegatorFactory extends Factory<Delegator> {}
+/** <code>Delegator</code> factory interface. */
+public interface DelegatorFactory extends Factory<Delegator, String> {}
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/DelegatorFactoryImpl.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/DelegatorFactoryImpl.java?rev=821391&r1=821390&r2=821391&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/DelegatorFactoryImpl.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/DelegatorFactoryImpl.java Sat Oct 3 18:52:29 2009
@@ -20,15 +20,13 @@
import org.ofbiz.base.util.Debug;
+/** A <code>DelegatorFactory</code> implementation that returns an
+ * instance of <code>GenericDelegator</code>. */
public class DelegatorFactoryImpl implements DelegatorFactory {
public static final String module = DelegatorFactoryImpl.class.getName();
- public Delegator getInstance(Object obj) {
- String delegatorName = null;
- try {
- delegatorName = (String) obj;
- } catch (Exception e) {}
+ public Delegator getInstance(String delegatorName) {
if (delegatorName == null) {
delegatorName = "default";
Debug.logWarning(new Exception("Location where getting delegator with null name"), "Got a getGenericDelegator call with a null delegatorName, assuming default for the name.", module);
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=821391&r1=821390&r2=821391&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java Sat Oct 3 18:52:29 2009
@@ -123,7 +123,7 @@
private String originalDelegatorName = null;
- /** @deprecated Use Delegator delegator = (Delegator) UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName);
+ /** @deprecated Use Delegator delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName);
* @param delegatorName
* @return
*/