[cvs] expresso commit by lhamel: make getValidValuesList not depend
on
JCorporate Ltd
jcorp at jcorporate.com
Fri May 27 17:02:14 UTC 2005
Log Message:
-----------
make getValidValuesList not depend on getValidValues()
Modified Files:
--------------
expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj:
DBObject.java
Revision Data
-------------
Index: DBObject.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj/DBObject.java,v
retrieving revision 1.250
retrieving revision 1.251
diff -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj/DBObject.java -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj/DBObject.java -u -r1.250 -r1.251
--- expresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj/DBObject.java
+++ expresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj/DBObject.java
@@ -93,6 +93,7 @@
import com.jcorporate.expresso.core.misc.DateTime;
import com.jcorporate.expresso.core.misc.StringUtil;
import com.jcorporate.expresso.core.registry.RequestRegistry;
+import com.jcorporate.expresso.core.security.SuperUser;
import com.jcorporate.expresso.core.security.filters.Filter;
import com.jcorporate.expresso.kernel.util.ClassLocator;
import com.jcorporate.expresso.kernel.util.FastStringBuffer;
@@ -125,7 +126,6 @@
import java.util.Map;
import java.util.StringTokenizer;
import java.util.Vector;
-import com.jcorporate.expresso.core.security.SuperUser;
/**
@@ -2463,7 +2463,6 @@
* Call inside find() to find if we have the keys needed to call retrieve()
* instead of find which allows us to potentially use the Cache instead
* of making a roundtrip to the database.
- * @param metadata JDBCObjectMetaData the database metadata
* @return boolean
* @throws DBException
*/
@@ -3839,11 +3838,11 @@
* @throws DBException upon error
*/
public java.util.List getValidValuesList(String fieldName) throws DBException {
- return getValidValues(fieldName);
+ return new ArrayList(getValidValuesPriv(fieldName));
}
/**
- * New method to replace getValues with a structure of valid values
+ * a structure of valid values
* and descriptions. Database objects should extend this method to
* return Vectors of ValidValue objects for multi-valued fields. A
* specific object can return it's own list of ValidValues, or it
@@ -3853,9 +3852,17 @@
* @param fieldName The name of the fields for which a value set is requested
* @return A Vector of ValidValue objects
* @throws DBException upon error.
+ * @todo will be deprecated; use getValidValuesList() instead
*/
public synchronized Vector getValidValues(String fieldName)
throws DBException {
+ return getValidValuesPriv(fieldName);
+ } /* getValidValues(String) */
+
+ /**
+ * do the actual work of getting valid values
+ */
+ private Vector getValidValuesPriv(String fieldName) throws DBException {
if (getMetaData().getFieldMetadata(fieldName).isMultiValued()) {
String lookupObj = getLookupObject(fieldName);
@@ -3890,7 +3897,7 @@
mdo.setDataContext(getDataContext());
} else {
try {
- Class[] params = {java.lang.String.class};
+ Class[] params = {String.class};
Method m = c.getMethod("setDBName", params);
if (m != null) {
@@ -3943,7 +3950,7 @@
"' is not specified as multi-valued, so you cannot " +
"call getValidValues for this field");
}
- } /* getValidValues(String) */
+ }
/**
More information about the cvs
mailing list