You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by aw...@apache.org on 2006/07/29 01:48:18 UTC
svn commit: r426710 [3/6] - in /incubator/openjpa/trunk:
openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/
openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/
openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ openjpa-jdbc/sr...
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/NotEqualExpression.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/NotEqualExpression.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/NotEqualExpression.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/NotEqualExpression.java Fri Jul 28 16:48:13 2006
@@ -15,7 +15,7 @@
*/
package org.apache.openjpa.jdbc.kernel.exps;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
+import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.sql.SQLBuffer;
import org.apache.openjpa.jdbc.sql.Select;
@@ -36,7 +36,7 @@
}
public void appendTo(SQLBuffer buf, Select sel, JDBCStore store,
- Object[] params, JDBCFetchState fetchState, boolean val1Null,
+ Object[] params, JDBCFetchConfiguration fetch, boolean val1Null,
boolean val2Null) {
if (val1Null && val2Null)
buf.appendValue(null).append(" IS NOT ").appendValue(null);
@@ -47,27 +47,27 @@
for (int i = 0; i < len; i++) {
if (i > 0)
buf.append(" AND ");
- val.appendTo(buf, i, sel, store, params, fetchState);
+ val.appendTo(buf, i, sel, store, params, fetch);
buf.append(" IS NOT ").appendValue(null);
}
} else
- val.appendIsNotNull(buf, sel, store, params, fetchState);
+ val.appendIsNotNull(buf, sel, store, params, fetch);
} else {
Val val1 = getValue1();
Val val2 = getValue2();
if (val1.length() == 1 && val2.length() == 1) {
store.getDBDictionary().comparison(buf, "<>",
- new FilterValueImpl(val1, sel, store, params, fetchState),
- new FilterValueImpl(val2, sel, store, params, fetchState));
+ new FilterValueImpl(val1, sel, store, params, fetch),
+ new FilterValueImpl(val2, sel, store, params, fetch));
} else {
int len = java.lang.Math.max(val1.length(), val2.length());
buf.append("(");
for (int i = 0; i < len; i++) {
if (i > 0)
buf.append(" OR ");
- val1.appendTo(buf, i, sel, store, params, fetchState);
+ val1.appendTo(buf, i, sel, store, params, fetch);
buf.append(" <> ");
- val2.appendTo(buf, i, sel, store, params, fetchState);
+ val2.appendTo(buf, i, sel, store, params, fetch);
}
buf.append(")");
}
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/NotExpression.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/NotExpression.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/NotExpression.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/NotExpression.java Fri Jul 28 16:48:13 2006
@@ -17,7 +17,7 @@
import java.util.Map;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
+import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.sql.Joins;
import org.apache.openjpa.jdbc.sql.SQLBuffer;
@@ -48,15 +48,15 @@
}
public void appendTo(SQLBuffer buf, Select sel, JDBCStore store,
- Object[] params, JDBCFetchState fetchState) {
+ Object[] params, JDBCFetchConfiguration fetch) {
buf.append("NOT (");
- _exp.appendTo(buf, sel, store, params, fetchState);
+ _exp.appendTo(buf, sel, store, params, fetch);
buf.append(")");
}
public void selectColumns(Select sel, JDBCStore store,
- Object[] params, boolean pks, JDBCFetchState fetchState) {
- _exp.selectColumns(sel, store, params, pks, fetchState);
+ Object[] params, boolean pks, JDBCFetchConfiguration fetch) {
+ _exp.selectColumns(sel, store, params, pks, fetch);
}
public Joins getJoins() {
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Null.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Null.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Null.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Null.java Fri Jul 28 16:48:13 2006
@@ -15,7 +15,7 @@
*/
package org.apache.openjpa.jdbc.kernel.exps;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
+import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.sql.SQLBuffer;
import org.apache.openjpa.jdbc.sql.Select;
@@ -40,11 +40,11 @@
}
public void calculateValue(Select sel, JDBCStore store,
- Object[] params, Val other, JDBCFetchState fetchState) {
+ Object[] params, Val other, JDBCFetchConfiguration fetch) {
}
public void appendTo(SQLBuffer sql, int index, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
sql.appendValue(null);
}
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/OrExpression.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/OrExpression.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/OrExpression.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/OrExpression.java Fri Jul 28 16:48:13 2006
@@ -19,7 +19,7 @@
import java.util.Iterator;
import java.util.Map;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
+import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.sql.Joins;
import org.apache.openjpa.jdbc.sql.SQLBuffer;
@@ -73,14 +73,14 @@
}
public void appendTo(SQLBuffer buf, Select sel, JDBCStore store,
- Object[] params, JDBCFetchState fetchState) {
+ Object[] params, JDBCFetchConfiguration fetch) {
boolean paren = _joins != null && !_joins.isEmpty();
if (paren)
buf.append("(");
- _exp1.appendTo(buf, sel, store, params, fetchState);
+ _exp1.appendTo(buf, sel, store, params, fetch);
buf.append(" OR ");
- _exp2.appendTo(buf, sel, store, params, fetchState);
+ _exp2.appendTo(buf, sel, store, params, fetch);
if (paren)
buf.append(")");
@@ -88,9 +88,9 @@
}
public void selectColumns(Select sel, JDBCStore store,
- Object[] params, boolean pks, JDBCFetchState fetchState) {
- _exp1.selectColumns(sel, store, params, pks, fetchState);
- _exp2.selectColumns(sel, store, params, pks, fetchState);
+ Object[] params, boolean pks, JDBCFetchConfiguration fetch) {
+ _exp1.selectColumns(sel, store, params, pks, fetch);
+ _exp2.selectColumns(sel, store, params, pks, fetch);
}
public Joins getJoins() {
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/PCPath.java Fri Jul 28 16:48:13 2006
@@ -21,7 +21,6 @@
import java.util.ListIterator;
import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.meta.ClassMapping;
import org.apache.openjpa.jdbc.meta.FieldMapping;
@@ -471,12 +470,12 @@
}
public void select(Select sel, JDBCStore store, Object[] params,
- boolean pks, JDBCFetchState fetchState) {
- selectColumns(sel, store, params, pks, fetchState);
+ boolean pks, JDBCFetchConfiguration fetch) {
+ selectColumns(sel, store, params, pks, fetch);
}
public void selectColumns(Select sel, JDBCStore store,
- Object[] params, boolean pks, JDBCFetchState fetchState) {
+ Object[] params, boolean pks, JDBCFetchConfiguration fetch) {
ClassMapping mapping = getClassMapping();
if (mapping == null || !_joinedRel)
sel.select(getColumns(), _joins);
@@ -490,42 +489,42 @@
// the candidate class on the select
int subs = (_type == UNBOUND_VAR) ? sel.SUBS_JOINABLE
: sel.SUBS_ANY_JOINABLE;
- sel.select(mapping, subs, store, fetchState,
+ sel.select(mapping, subs, store, fetch,
JDBCFetchConfiguration.EAGER_NONE, sel.outer(_joins));
}
}
public void groupBy(Select sel, JDBCStore store, Object[] params,
- JDBCFetchState fetchState) {
+ JDBCFetchConfiguration fetch) {
sel.groupBy(getColumns(), sel.outer(_joins), false);
}
public void orderBy(Select sel, JDBCStore store, Object[] params,
- boolean asc, JDBCFetchState fetchState) {
+ boolean asc, JDBCFetchConfiguration fetch) {
sel.orderBy(getColumns(), asc, sel.outer(_joins), false);
}
public Object load(Result res, JDBCStore store,
- JDBCFetchState fetchState)
+ JDBCFetchConfiguration fetch)
throws SQLException {
- return load(res, store, false, fetchState);
+ return load(res, store, false, fetch);
}
Object load(Result res, JDBCStore store, boolean pks,
- JDBCFetchState fetchState)
+ JDBCFetchConfiguration fetch)
throws SQLException {
ClassMapping mapping = getClassMapping();
if (mapping != null && (_field == null || !_field.isEmbedded())) {
if (pks)
return mapping.getObjectId(store, res, null, true, _joins);
- return res.load(mapping, store, fetchState, _joins);
+ return res.load(mapping, store, fetch, _joins);
}
Object ret;
if (_key)
- ret = _field.loadKeyProjection(store, fetchState, res, _joins);
+ ret = _field.loadKeyProjection(store, fetch, res, _joins);
else
- ret = _field.loadProjection(store, fetchState, res, _joins);
+ ret = _field.loadProjection(store, fetch, res, _joins);
if (_cast != null)
ret = Filters.convert(ret, _cast);
return ret;
@@ -545,7 +544,7 @@
}
public void calculateValue(Select sel, JDBCStore store,
- Object[] params, Val other, JDBCFetchState fetchState) {
+ Object[] params, Val other, JDBCFetchConfiguration fetch) {
// we don't create the SQL b/c it forces the Select to cache aliases
// for the tables we use, and these aliases might not ever be used if
// we eventually call appendIsEmpty or appendIsNull rather than appendTo
@@ -559,7 +558,7 @@
}
public void appendTo(SQLBuffer sql, int index, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
Column col = getColumns()[index];
// if select is null, it means we are not aliasing columns
@@ -571,7 +570,7 @@
}
public void appendIsEmpty(SQLBuffer sql, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
if (_field == null)
sql.append("1 <> 1");
else
@@ -579,7 +578,7 @@
}
public void appendIsNotEmpty(SQLBuffer sql, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
if (_field == null)
sql.append("1 <> 1");
else
@@ -587,7 +586,7 @@
}
public void appendSize(SQLBuffer sql, Select sel, JDBCStore store,
- Object[] params, JDBCFetchState fetchState) {
+ Object[] params, JDBCFetchConfiguration fetch) {
if (_field == null)
sql.append("1");
else
@@ -595,7 +594,7 @@
}
public void appendIsNull(SQLBuffer sql, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
if (_field == null)
sql.append("1 <> 1");
else
@@ -603,7 +602,7 @@
}
public void appendIsNotNull(SQLBuffer sql, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
if (_field == null)
sql.append("1 = 1");
else
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Param.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Param.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Param.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Param.java Fri Jul 28 16:48:13 2006
@@ -18,7 +18,7 @@
import java.util.Collection;
import java.util.Map;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
+import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.sql.SQLBuffer;
import org.apache.openjpa.jdbc.sql.Select;
@@ -92,8 +92,8 @@
}
public void calculateValue(Select sel, JDBCStore store,
- Object[] params, Val other, JDBCFetchState fetchState) {
- super.calculateValue(sel, store, params, other, fetchState);
+ Object[] params, Val other, JDBCFetchConfiguration fetch) {
+ super.calculateValue(sel, store, params, other, fetch);
_val = Filters.convert(params[_idx], getType());
if (other != null && !_container) {
_sqlVal = other.toDataStoreValue(_val, store);
@@ -103,7 +103,7 @@
}
public void appendTo(SQLBuffer sql, int index, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
if (_otherLen > 1)
sql.appendValue(((Object[]) _sqlVal)[index], getColumn(index));
else
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/SelectConstructor.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/SelectConstructor.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/SelectConstructor.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/SelectConstructor.java Fri Jul 28 16:48:13 2006
@@ -19,7 +19,6 @@
import java.util.Map;
import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.meta.ClassMapping;
import org.apache.openjpa.jdbc.sql.DBDictionary;
@@ -60,7 +59,7 @@
*/
public Select evaluate(JDBCStore store, Select parent, String alias,
QueryExpressions exps, Object[] params, int level,
- JDBCFetchState fetchState) {
+ JDBCFetchConfiguration fetch) {
// already know that this query is equivalent to an extent?
Select sel;
if (_extent) {
@@ -85,8 +84,7 @@
} else {
// create a new select and initialize it with the joins needed for
// the criteria of this query
- sel = newJoinsSelect(store, parent, alias, exps, params,
- fetchState);
+ sel = newJoinsSelect(store, parent, alias, exps, params, fetch);
}
// if this select wasn't cloned from a full template,
@@ -97,7 +95,7 @@
// query should be treated like an extent
Select inner = sel.getFromSelect();
SQLBuffer where = buildWhere((inner != null) ? inner : sel,
- store, exps.filter, params, fetchState);
+ store, exps.filter, params, fetch);
if (where == null && exps.projections.length == 0
&& exps.ordering.length == 0
&& (sel.getJoins() == null || sel.getJoins().isEmpty())) {
@@ -132,12 +130,11 @@
if (exps.having != null) {
Exp havingExp = (Exp) exps.having;
SQLBuffer buf = new SQLBuffer(store.getDBDictionary());
- havingExp.appendTo(buf, sel, store, params, fetchState);
+ havingExp.appendTo(buf, sel, store, params, fetch);
sel.having(buf);
}
for (int i = 0; i < exps.grouping.length; i++)
- ((Val) exps.grouping[i]).groupBy(sel, store, params,
- fetchState);
+ ((Val) exps.grouping[i]).groupBy(sel, store, params, fetch);
// if template is still null at this point, must be a full cache
if (_template == null && level == CACHE_FULL) {
@@ -154,13 +151,9 @@
*/
private Select newJoinsSelect(JDBCStore store, Select parent,
String alias, QueryExpressions exps, Object[] params,
- JDBCFetchState fetchState) {
+ JDBCFetchConfiguration fetch) {
Select sel = store.getSQLFactory().newSelect();
sel.setAutoDistinct((exps.distinct & exps.DISTINCT_AUTO) != 0);
- JDBCFetchConfiguration fetch = (fetchState == null)
- ?
- (JDBCFetchConfiguration) store.getContext().getFetchConfiguration()
- : fetchState.getJDBCFetchConfiguration();
sel.setJoinSyntax(fetch.getJoinSyntax());
sel.setParent(parent, alias);
initializeJoins(sel, store, exps, params);
@@ -267,12 +260,12 @@
* Create the where sql.
*/
private SQLBuffer buildWhere(Select sel, JDBCStore store,
- Expression filter, Object[] params, JDBCFetchState fetchState) {
+ Expression filter, Object[] params, JDBCFetchConfiguration fetch) {
// create where buffer
SQLBuffer where = new SQLBuffer(store.getDBDictionary());
where.append("(");
Exp filterExp = (Exp) filter;
- filterExp.appendTo(where, sel, store, params, fetchState);
+ filterExp.appendTo(where, sel, store, params, fetch);
if (where.sqlEquals("(") || where.sqlEquals("(1 = 1"))
return null;
@@ -284,7 +277,7 @@
*/
public void select(JDBCStore store, ClassMapping mapping,
boolean subclasses, Select sel, QueryExpressions exps,
- Object[] params, JDBCFetchState fetchState, int eager) {
+ Object[] params, JDBCFetchConfiguration fetch, int eager) {
Select inner = sel.getFromSelect();
Val val;
Joins joins = null;
@@ -295,12 +288,12 @@
// ordering gets applied after query ordering
for (int i = 0; i < exps.ordering.length; i++)
((Val) exps.ordering[i]).orderBy(sel, store, params,
- exps.ascending[i], fetchState);
+ exps.ascending[i], fetch);
// if no result string set, select matching objects like normal
if (exps.projections.length == 0 && sel.getParent() == null) {
int subs = (subclasses) ? sel.SUBS_JOINABLE : sel.SUBS_NONE;
- sel.selectIdentifier(mapping, subs, store, fetchState, eager);
+ sel.selectIdentifier(mapping, subs, store, fetch, eager);
} else if (exps.projections.length == 0) {
// subselect for objects; we really just need the primary key values
sel.select(mapping.getPrimaryKeyColumns(), joins);
@@ -316,8 +309,8 @@
for (int i = 0; i < exps.projections.length; i++) {
val = (Val) exps.projections[i];
if (inner != null)
- val.selectColumns(inner, store, params, pks, fetchState);
- val.select(sel, store, params, pks, fetchState);
+ val.selectColumns(inner, store, params, pks, fetch);
+ val.select(sel, store, params, pks, fetch);
}
// make sure grouping and having columns are selected since it
@@ -325,12 +318,12 @@
// result processing
if (exps.having != null && inner != null)
((Exp) exps.having).selectColumns(inner, store, params, true,
- fetchState);
+ fetch);
for (int i = 0; i < exps.grouping.length; i++) {
val = (Val) exps.grouping[i];
if (inner != null)
- val.selectColumns(inner, store, params, true, fetchState);
- val.select(sel, store, params, true, fetchState);
+ val.selectColumns(inner, store, params, true, fetch);
+ val.select(sel, store, params, true, fetch);
}
}
@@ -338,8 +331,8 @@
for (int i = 0; i < exps.ordering.length; i++) {
val = (Val) exps.ordering[i];
if (inner != null)
- val.selectColumns(inner, store, params, true, fetchState);
- val.select(sel, store, params, true, fetchState);
+ val.selectColumns(inner, store, params, true, fetch);
+ val.select(sel, store, params, true, fetch);
}
// add conditions limiting the projections to the proper classes; if
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Size.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Size.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Size.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Size.java Fri Jul 28 16:48:13 2006
@@ -15,7 +15,7 @@
*/
package org.apache.openjpa.jdbc.kernel.exps;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
+import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.sql.SQLBuffer;
import org.apache.openjpa.jdbc.sql.Select;
@@ -40,9 +40,9 @@
}
public void appendTo(SQLBuffer sql, int index, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
- getVal().calculateValue(sel, store, params, null, fetchState);
- getVal().appendSize(sql, sel, store, params, fetchState);
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
+ getVal().calculateValue(sel, store, params, null, fetch);
+ getVal().appendSize(sql, sel, store, params, fetch);
sel.append(sql, getVal().getJoins());
getVal().clearParameters();
}
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/StartsWithExpression.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/StartsWithExpression.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/StartsWithExpression.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/StartsWithExpression.java Fri Jul 28 16:48:13 2006
@@ -17,7 +17,7 @@
import java.util.Map;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
+import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.meta.ClassMapping;
import org.apache.openjpa.jdbc.meta.FieldMapping;
@@ -67,9 +67,9 @@
}
public void appendTo(SQLBuffer buf, Select sel, JDBCStore store,
- Object[] params, JDBCFetchState fetchState) {
- _val1.calculateValue(sel, store, params, _val2, fetchState);
- _val2.calculateValue(sel, store, params, _val1, fetchState);
+ Object[] params, JDBCFetchConfiguration fetch) {
+ _val1.calculateValue(sel, store, params, _val2, fetch);
+ _val2.calculateValue(sel, store, params, _val1, fetch);
if (_val1 instanceof Const && ((Const) _val1).getValue() == null)
buf.append("1 <> 1");
@@ -85,7 +85,7 @@
col = cols[0];
}
- _val1.appendTo(buf, 0, sel, store, params, fetchState);
+ _val1.appendTo(buf, 0, sel, store, params, fetch);
buf.append(" LIKE ");
buf.appendValue(o.toString() + "%", col);
}
@@ -95,11 +95,11 @@
DBDictionary dict = store.getDBDictionary();
dict.assertSupport(_pre != null, "StringLengthFunction");
dict.substring(buf,
- new FilterValueImpl(_val1, sel, store, params, fetchState),
+ new FilterValueImpl(_val1, sel, store, params, fetch),
new ZeroFilterValue(sel),
- new StringLengthFilterValue(sel, store, params, fetchState));
+ new StringLengthFilterValue(sel, store, params, fetch));
buf.append(" = ");
- _val2.appendTo(buf, 0, sel, store, params, fetchState);
+ _val2.appendTo(buf, 0, sel, store, params, fetch);
}
sel.append(buf, _joins);
@@ -108,9 +108,9 @@
}
public void selectColumns(Select sel, JDBCStore store,
- Object[] params, boolean pks, JDBCFetchState fetchState) {
- _val1.selectColumns(sel, store, params, true, fetchState);
- _val2.selectColumns(sel, store, params, true, fetchState);
+ Object[] params, boolean pks, JDBCFetchConfiguration fetch) {
+ _val1.selectColumns(sel, store, params, true, fetch);
+ _val2.selectColumns(sel, store, params, true, fetch);
}
public Joins getJoins() {
@@ -199,14 +199,14 @@
private final Select _sel;
private final JDBCStore _store;
private final Object[] _params;
- private final JDBCFetchState _fetchState;
+ private final JDBCFetchConfiguration _fetch;
public StringLengthFilterValue(Select sel, JDBCStore store,
- Object[] params, JDBCFetchState fetchState) {
+ Object[] params, JDBCFetchConfiguration fetch) {
_sel = sel;
_store = store;
_params = params;
- _fetchState = fetchState;
+ _fetch = fetch;
}
public Class getType() {
@@ -223,7 +223,7 @@
public void appendTo(SQLBuffer buf, int index) {
buf.append(_pre);
- _val2.appendTo(buf, index, _sel, _store, _params, _fetchState);
+ _val2.appendTo(buf, index, _sel, _store, _params, _fetch);
buf.append(_post);
}
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/StringFunction.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/StringFunction.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/StringFunction.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/StringFunction.java Fri Jul 28 16:48:13 2006
@@ -17,7 +17,7 @@
import java.sql.SQLException;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
+import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.meta.JavaSQLTypes;
import org.apache.openjpa.jdbc.sql.Joins;
@@ -76,36 +76,36 @@
}
public void select(Select sel, JDBCStore store, Object[] params,
- boolean pks, JDBCFetchState fetchState) {
- sel.select(newSQLBuffer(sel, store, params, fetchState), this);
+ boolean pks, JDBCFetchConfiguration fetch) {
+ sel.select(newSQLBuffer(sel, store, params, fetch), this);
}
public void selectColumns(Select sel, JDBCStore store,
- Object[] params, boolean pks, JDBCFetchState fetchState) {
- _val.selectColumns(sel, store, params, true, fetchState);
+ Object[] params, boolean pks, JDBCFetchConfiguration fetch) {
+ _val.selectColumns(sel, store, params, true, fetch);
}
public void groupBy(Select sel, JDBCStore store, Object[] params,
- JDBCFetchState fetchState) {
- sel.groupBy(newSQLBuffer(sel, store, params, fetchState), false);
+ JDBCFetchConfiguration fetch) {
+ sel.groupBy(newSQLBuffer(sel, store, params, fetch), false);
}
public void orderBy(Select sel, JDBCStore store, Object[] params,
- boolean asc, JDBCFetchState fetchState) {
- sel.orderBy(newSQLBuffer(sel, store, params, fetchState), asc, false);
+ boolean asc, JDBCFetchConfiguration fetch) {
+ sel.orderBy(newSQLBuffer(sel, store, params, fetch), asc, false);
}
private SQLBuffer newSQLBuffer(Select sel, JDBCStore store,
- Object[] params, JDBCFetchState fetchState) {
- calculateValue(sel, store, params, null, fetchState);
+ Object[] params, JDBCFetchConfiguration fetch) {
+ calculateValue(sel, store, params, null, fetch);
SQLBuffer buf = new SQLBuffer(store.getDBDictionary());
- appendTo(buf, 0, sel, store, params, fetchState);
+ appendTo(buf, 0, sel, store, params, fetch);
clearParameters();
return buf;
}
public Object load(Result res, JDBCStore store,
- JDBCFetchState fetchState)
+ JDBCFetchConfiguration fetch)
throws SQLException {
return Filters.convert(res.getObject(this,
JavaSQLTypes.JDBC_DEFAULT, null), getType());
@@ -116,8 +116,8 @@
}
public void calculateValue(Select sel, JDBCStore store,
- Object[] params, Val other, JDBCFetchState fetchState) {
- _val.calculateValue(sel, store, params, null, fetchState);
+ Object[] params, Val other, JDBCFetchConfiguration fetch) {
+ _val.calculateValue(sel, store, params, null, fetch);
}
public void clearParameters() {
@@ -129,9 +129,9 @@
}
public void appendTo(SQLBuffer sql, int index, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
sql.append(_pre);
- _val.appendTo(sql, 0, sel, store, params, fetchState);
+ _val.appendTo(sql, 0, sel, store, params, fetch);
sql.append(_post);
}
}
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/SubQ.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/SubQ.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/SubQ.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/SubQ.java Fri Jul 28 16:48:13 2006
@@ -18,7 +18,6 @@
import java.sql.SQLException;
import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.meta.ClassMapping;
import org.apache.openjpa.jdbc.meta.JavaSQLTypes;
@@ -123,34 +122,34 @@
}
public void select(Select sel, JDBCStore store, Object[] params,
- boolean pks, JDBCFetchState fetchState) {
- selectColumns(sel, store, params, pks, fetchState);
+ boolean pks, JDBCFetchConfiguration fetch) {
+ selectColumns(sel, store, params, pks, fetch);
}
public void selectColumns(Select sel, JDBCStore store,
- Object[] params, boolean pks, JDBCFetchState fetchState) {
- sel.select(newSQLBuffer(sel, store, params, fetchState), this);
+ Object[] params, boolean pks, JDBCFetchConfiguration fetch) {
+ sel.select(newSQLBuffer(sel, store, params, fetch), this);
}
public void groupBy(Select sel, JDBCStore store, Object[] params,
- JDBCFetchState fetchState) {
- sel.groupBy(newSQLBuffer(sel, store, params, fetchState), false);
+ JDBCFetchConfiguration fetch) {
+ sel.groupBy(newSQLBuffer(sel, store, params, fetch), false);
}
public void orderBy(Select sel, JDBCStore store, Object[] params,
- boolean asc, JDBCFetchState fetchState) {
- sel.orderBy(newSQLBuffer(sel, store, params, fetchState), asc, false);
+ boolean asc, JDBCFetchConfiguration fetch) {
+ sel.orderBy(newSQLBuffer(sel, store, params, fetch), asc, false);
}
private SQLBuffer newSQLBuffer(Select sel, JDBCStore store,
- Object[] params, JDBCFetchState fetchState) {
+ Object[] params, JDBCFetchConfiguration fetch) {
SQLBuffer buf = new SQLBuffer(store.getDBDictionary());
- appendTo(buf, 0, sel, store, params, fetchState);
+ appendTo(buf, 0, sel, store, params, fetch);
return buf;
}
public Object load(Result res, JDBCStore store,
- JDBCFetchState fetchState)
+ JDBCFetchConfiguration fetch)
throws SQLException {
return Filters.convert(res.getObject(this,
JavaSQLTypes.JDBC_DEFAULT, null), getType());
@@ -176,7 +175,7 @@
}
public void calculateValue(Select sel, JDBCStore store,
- Object[] params, Val other, JDBCFetchState fetchState) {
+ Object[] params, Val other, JDBCFetchConfiguration fetch) {
}
public void clearParameters() {
@@ -187,18 +186,17 @@
}
public void appendTo(SQLBuffer sql, int index, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
- appendTo(sql, index, sel, store, params, fetchState, false);
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
+ appendTo(sql, index, sel, store, params, fetch, false);
}
private void appendTo(SQLBuffer sql, int index, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState,
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch,
boolean size) {
- JDBCFetchConfiguration fetch = fetchState.getJDBCFetchConfiguration();
sel = _cons.evaluate(store, sel, _alias, _exps, params,
- _cons.CACHE_NULL, fetchState);
+ _cons.CACHE_NULL, fetch);
_cons.select(store, _candidate, _subs, sel, _exps, params,
- fetchState, fetch.EAGER_NONE);
+ fetch, fetch.EAGER_NONE);
sel.setRange(_startIdx, _endIdx);
if (size)
@@ -208,31 +206,31 @@
}
public void appendIsEmpty(SQLBuffer sql, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
sql.append("NOT EXISTS ");
- appendTo(sql, 0, sel, store, params, fetchState);
+ appendTo(sql, 0, sel, store, params, fetch);
}
public void appendIsNotEmpty(SQLBuffer sql, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
sql.append("EXISTS ");
- appendTo(sql, 0, sel, store, params, fetchState);
+ appendTo(sql, 0, sel, store, params, fetch);
}
public void appendSize(SQLBuffer sql, Select sel, JDBCStore store,
- Object[] params, JDBCFetchState fetchState) {
- appendTo(sql, 0, sel, store, params, fetchState, true);
+ Object[] params, JDBCFetchConfiguration fetch) {
+ appendTo(sql, 0, sel, store, params, fetch, true);
}
public void appendIsNull(SQLBuffer sql, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
- appendTo(sql, 0, sel, store, params, fetchState);
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
+ appendTo(sql, 0, sel, store, params, fetch);
sql.append(" IS NULL");
}
public void appendIsNotNull(SQLBuffer sql, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
- appendTo(sql, 0, sel, store, params, fetchState);
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
+ appendTo(sql, 0, sel, store, params, fetch);
sql.append(" IS NOT NULL");
}
}
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Substring.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Substring.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Substring.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Substring.java Fri Jul 28 16:48:13 2006
@@ -17,7 +17,7 @@
import java.sql.SQLException;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
+import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.meta.JavaSQLTypes;
import org.apache.openjpa.jdbc.sql.Joins;
@@ -83,37 +83,37 @@
}
public void select(Select sel, JDBCStore store, Object[] params,
- boolean pks, JDBCFetchState fetchState) {
- sel.select(newSQLBuffer(sel, store, params, fetchState), this);
+ boolean pks, JDBCFetchConfiguration fetch) {
+ sel.select(newSQLBuffer(sel, store, params, fetch), this);
}
public void selectColumns(Select sel, JDBCStore store,
- Object[] params, boolean pks, JDBCFetchState fetchState) {
- _val1.selectColumns(sel, store, params, true, fetchState);
- _val2.selectColumns(sel, store, params, true, fetchState);
+ Object[] params, boolean pks, JDBCFetchConfiguration fetch) {
+ _val1.selectColumns(sel, store, params, true, fetch);
+ _val2.selectColumns(sel, store, params, true, fetch);
}
public void groupBy(Select sel, JDBCStore store, Object[] params,
- JDBCFetchState fetchState) {
- sel.groupBy(newSQLBuffer(sel, store, params, fetchState), false);
+ JDBCFetchConfiguration fetch) {
+ sel.groupBy(newSQLBuffer(sel, store, params, fetch), false);
}
public void orderBy(Select sel, JDBCStore store, Object[] params,
- boolean asc, JDBCFetchState fetchState) {
- sel.orderBy(newSQLBuffer(sel, store, params, fetchState), asc, false);
+ boolean asc, JDBCFetchConfiguration fetch) {
+ sel.orderBy(newSQLBuffer(sel, store, params, fetch), asc, false);
}
private SQLBuffer newSQLBuffer(Select sel, JDBCStore store,
- Object[] params, JDBCFetchState fetchState) {
- calculateValue(sel, store, params, null, fetchState);
+ Object[] params, JDBCFetchConfiguration fetch) {
+ calculateValue(sel, store, params, null, fetch);
SQLBuffer buf = new SQLBuffer(store.getDBDictionary());
- appendTo(buf, 0, sel, store, params, fetchState);
+ appendTo(buf, 0, sel, store, params, fetch);
clearParameters();
return buf;
}
public Object load(Result res, JDBCStore store,
- JDBCFetchState fetchState)
+ JDBCFetchConfiguration fetch)
throws SQLException {
return Filters.convert(res.getObject(this,
JavaSQLTypes.JDBC_DEFAULT, null), getType());
@@ -124,9 +124,9 @@
}
public void calculateValue(Select sel, JDBCStore store,
- Object[] params, Val other, JDBCFetchState fetchState) {
- _val1.calculateValue(sel, store, params, null, fetchState);
- _val2.calculateValue(sel, store, params, null, fetchState);
+ Object[] params, Val other, JDBCFetchConfiguration fetch) {
+ _val1.calculateValue(sel, store, params, null, fetch);
+ _val2.calculateValue(sel, store, params, null, fetch);
}
public void clearParameters() {
@@ -139,18 +139,17 @@
}
public void appendTo(SQLBuffer sql, int index, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
- FilterValue str = new FilterValueImpl(_val1, sel, store, params,
- fetchState);
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
+ FilterValue str = new FilterValueImpl(_val1, sel, store, params, fetch);
FilterValue start;
FilterValue end = null;
if (_val2 instanceof Args) {
Val[] args = ((Args) _val2).getVals();
start =
- new FilterValueImpl(args[0], sel, store, params, fetchState);
- end = new FilterValueImpl(args[1], sel, store, params, fetchState);
+ new FilterValueImpl(args[0], sel, store, params, fetch);
+ end = new FilterValueImpl(args[1], sel, store, params, fetch);
} else
- start = new FilterValueImpl(_val2, sel, store, params, fetchState);
+ start = new FilterValueImpl(_val2, sel, store, params, fetch);
store.getDBDictionary().substring(sql, str, start, end);
}
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Trim.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Trim.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Trim.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Trim.java Fri Jul 28 16:48:13 2006
@@ -18,7 +18,7 @@
import java.lang.Math;
import java.sql.SQLException;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
+import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.meta.JavaSQLTypes;
import org.apache.openjpa.jdbc.sql.DBDictionary;
@@ -98,36 +98,36 @@
}
public void select(Select sel, JDBCStore store, Object[] params,
- boolean pks, JDBCFetchState fetchState) {
- sel.select(newSQLBuffer(sel, store, params, fetchState), this);
+ boolean pks, JDBCFetchConfiguration fetch) {
+ sel.select(newSQLBuffer(sel, store, params, fetch), this);
}
public void selectColumns(Select sel, JDBCStore store,
- Object[] params, boolean pks, JDBCFetchState fetchState) {
- _val.selectColumns(sel, store, params, true, fetchState);
+ Object[] params, boolean pks, JDBCFetchConfiguration fetch) {
+ _val.selectColumns(sel, store, params, true, fetch);
}
public void groupBy(Select sel, JDBCStore store, Object[] params,
- JDBCFetchState fetchState) {
- sel.groupBy(newSQLBuffer(sel, store, params, fetchState), false);
+ JDBCFetchConfiguration fetch) {
+ sel.groupBy(newSQLBuffer(sel, store, params, fetch), false);
}
public void orderBy(Select sel, JDBCStore store, Object[] params,
- boolean asc, JDBCFetchState fetchState) {
- sel.orderBy(newSQLBuffer(sel, store, params, fetchState), asc, false);
+ boolean asc, JDBCFetchConfiguration fetch) {
+ sel.orderBy(newSQLBuffer(sel, store, params, fetch), asc, false);
}
private SQLBuffer newSQLBuffer(Select sel, JDBCStore store,
- Object[] params, JDBCFetchState fetchState) {
- calculateValue(sel, store, params, null, fetchState);
+ Object[] params, JDBCFetchConfiguration fetch) {
+ calculateValue(sel, store, params, null, fetch);
SQLBuffer buf = new SQLBuffer(store.getDBDictionary());
- appendTo(buf, 0, sel, store, params, fetchState);
+ appendTo(buf, 0, sel, store, params, fetch);
clearParameters();
return buf;
}
public Object load(Result res, JDBCStore store,
- JDBCFetchState fetchState)
+ JDBCFetchConfiguration fetch)
throws SQLException {
return Filters.convert(res.getObject(this,
JavaSQLTypes.JDBC_DEFAULT, null), getType());
@@ -138,8 +138,8 @@
}
public void calculateValue(Select sel, JDBCStore store,
- Object[] params, Val other, JDBCFetchState fetchState) {
- _val.calculateValue(sel, store, params, null, fetchState);
+ Object[] params, Val other, JDBCFetchConfiguration fetch) {
+ _val.calculateValue(sel, store, params, null, fetch);
}
public void clearParameters() {
@@ -151,9 +151,9 @@
}
public void appendTo(SQLBuffer sql, int index, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
- _val.calculateValue(sel, store, params, _trimChar, fetchState);
- _trimChar.calculateValue(sel, store, params, _val, fetchState);
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
+ _val.calculateValue(sel, store, params, _trimChar, fetch);
+ _trimChar.calculateValue(sel, store, params, _val, fetch);
int fromPart = _func.indexOf("{0}");
int charPart = _func.indexOf("{1}");
@@ -172,12 +172,12 @@
sql.append(part1);
(fromPart < charPart ? _val : _trimChar).
- appendTo(sql, 0, sel, store, params, fetchState);
+ appendTo(sql, 0, sel, store, params, fetch);
sql.append(part2);
if (charPart != _func.length()) {
(fromPart > charPart ? _val : _trimChar).
- appendTo(sql, 0, sel, store, params, fetchState);
+ appendTo(sql, 0, sel, store, params, fetch);
sql.append(part3);
} else {
// since the trim statement did not specify the token for
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/UnaryOp.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/UnaryOp.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/UnaryOp.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/UnaryOp.java Fri Jul 28 16:48:13 2006
@@ -17,7 +17,7 @@
import java.sql.SQLException;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
+import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.meta.JavaSQLTypes;
import org.apache.openjpa.jdbc.sql.Joins;
@@ -86,38 +86,38 @@
}
public void select(Select sel, JDBCStore store, Object[] params,
- boolean pks, JDBCFetchState fetchState) {
- sel.select(newSQLBuffer(sel, store, params, fetchState), this);
+ boolean pks, JDBCFetchConfiguration fetch) {
+ sel.select(newSQLBuffer(sel, store, params, fetch), this);
if (isAggregate())
sel.setAggregate(true);
}
public void selectColumns(Select sel, JDBCStore store,
- Object[] params, boolean pks, JDBCFetchState fetchState) {
- _val.selectColumns(sel, store, params, true, fetchState);
+ Object[] params, boolean pks, JDBCFetchConfiguration fetch) {
+ _val.selectColumns(sel, store, params, true, fetch);
}
public void groupBy(Select sel, JDBCStore store, Object[] params,
- JDBCFetchState fetchState) {
- sel.groupBy(newSQLBuffer(sel, store, params, fetchState), false);
+ JDBCFetchConfiguration fetch) {
+ sel.groupBy(newSQLBuffer(sel, store, params, fetch), false);
}
public void orderBy(Select sel, JDBCStore store, Object[] params,
- boolean asc, JDBCFetchState fetchState) {
- sel.orderBy(newSQLBuffer(sel, store, params, fetchState), asc, false);
+ boolean asc, JDBCFetchConfiguration fetch) {
+ sel.orderBy(newSQLBuffer(sel, store, params, fetch), asc, false);
}
private SQLBuffer newSQLBuffer(Select sel, JDBCStore store,
- Object[] params, JDBCFetchState fetchState) {
- calculateValue(sel, store, params, null, fetchState);
+ Object[] params, JDBCFetchConfiguration fetch) {
+ calculateValue(sel, store, params, null, fetch);
SQLBuffer buf = new SQLBuffer(store.getDBDictionary());
- appendTo(buf, 0, sel, store, params, fetchState);
+ appendTo(buf, 0, sel, store, params, fetch);
clearParameters();
return buf;
}
public Object load(Result res, JDBCStore store,
- JDBCFetchState fetchState)
+ JDBCFetchConfiguration fetch)
throws SQLException {
return Filters.convert(res.getObject(this,
JavaSQLTypes.JDBC_DEFAULT, null), getType());
@@ -128,8 +128,8 @@
}
public void calculateValue(Select sel, JDBCStore store,
- Object[] params, Val other, JDBCFetchState fetchState) {
- _val.calculateValue(sel, store, params, null, fetchState);
+ Object[] params, Val other, JDBCFetchConfiguration fetch) {
+ _val.calculateValue(sel, store, params, null, fetch);
}
public void clearParameters() {
@@ -141,10 +141,10 @@
}
public void appendTo(SQLBuffer sql, int index, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
sql.append(getOperator());
sql.append("(");
- _val.appendTo(sql, 0, sel, store, params, fetchState);
+ _val.appendTo(sql, 0, sel, store, params, fetch);
sql.append(")");
}
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Val.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Val.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Val.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Val.java Fri Jul 28 16:48:13 2006
@@ -17,7 +17,7 @@
import java.sql.SQLException;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
+import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.sql.Joins;
import org.apache.openjpa.jdbc.sql.Result;
@@ -69,31 +69,31 @@
* Select the data for this value.
*/
public void select(Select sel, JDBCStore store, Object[] params,
- boolean pks, JDBCFetchState fetchState);
+ boolean pks, JDBCFetchConfiguration fetch);
/**
* Select just the columns for this value.
*/
public void selectColumns(Select sel, JDBCStore store, Object[] params,
- boolean pks, JDBCFetchState fetchState);
+ boolean pks, JDBCFetchConfiguration fetch);
/**
* Group by this value.
*/
public void groupBy(Select sel, JDBCStore store, Object[] params,
- JDBCFetchState fetchState);
+ JDBCFetchConfiguration fetch);
/**
* Order by this value.
*/
public void orderBy(Select sel, JDBCStore store, Object[] params,
- boolean asc, JDBCFetchState fetchState);
+ boolean asc, JDBCFetchConfiguration fetch);
/**
* Load the data for this value.
*/
public Object load(Result res, JDBCStore store,
- JDBCFetchState fetchState)
+ JDBCFetchConfiguration fetch)
throws SQLException;
/**
@@ -108,7 +108,7 @@
* @param other the value being compared to, or null if not a comparison
*/
public void calculateValue(Select sel, JDBCStore store,
- Object[] params, Val other, JDBCFetchState fetchState);
+ Object[] params, Val other, JDBCFetchConfiguration fetch);
/**
* Clear parameter values held by this value or its subcomponents.
@@ -125,37 +125,37 @@
* Append the <code>index</code>th SQL element to the given buffer.
*/
public void appendTo(SQLBuffer sql, int index, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState);
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch);
/**
* Append the SQL testing whether this value is empty to the given buffer.
*/
public void appendIsEmpty(SQLBuffer sql, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState);
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch);
/**
* Append the SQL testing whether this value is not empty to
* the given buffer.
*/
public void appendIsNotEmpty(SQLBuffer sql, Select sel, JDBCStore store,
- Object[] params, JDBCFetchState fetchState);
+ Object[] params, JDBCFetchConfiguration fetch);
/**
* Append the SQL checking the size of this value.
*/
public void appendSize(SQLBuffer sql, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState);
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch);
/**
* Append the SQL testing whether this value is null to the given buffer.
*/
public void appendIsNull(SQLBuffer sql, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState);
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch);
/**
* Append the SQL testing whether this value is not null to the given
* buffer.
*/
public void appendIsNotNull(SQLBuffer sql, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState);
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch);
}
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Variable.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Variable.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Variable.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Variable.java Fri Jul 28 16:48:13 2006
@@ -17,7 +17,7 @@
import java.sql.SQLException;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
+import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.sql.Joins;
import org.apache.openjpa.jdbc.sql.Result;
@@ -122,23 +122,23 @@
}
public void select(Select sel, JDBCStore store, Object[] params,
- boolean pks, JDBCFetchState fetchState) {
+ boolean pks, JDBCFetchConfiguration fetch) {
}
public void selectColumns(Select sel, JDBCStore store,
- Object[] params, boolean pks, JDBCFetchState fetchState) {
+ Object[] params, boolean pks, JDBCFetchConfiguration fetch) {
}
public void groupBy(Select sel, JDBCStore store, Object[] params,
- JDBCFetchState fetchState) {
+ JDBCFetchConfiguration fetch) {
}
public void orderBy(Select sel, JDBCStore store, Object[] params,
- boolean asc, JDBCFetchState fetchState) {
+ boolean asc, JDBCFetchConfiguration fetch) {
}
public Object load(Result res, JDBCStore store,
- JDBCFetchState fetchState)
+ JDBCFetchConfiguration fetch)
throws SQLException {
return null;
}
@@ -148,9 +148,9 @@
}
public void calculateValue(Select sel, JDBCStore store,
- Object[] params, Val other, JDBCFetchState fetchState) {
+ Object[] params, Val other, JDBCFetchConfiguration fetch) {
if (_path != null)
- _path.calculateValue(sel, store, params, other, fetchState);
+ _path.calculateValue(sel, store, params, other, fetch);
}
public void clearParameters() {
@@ -163,26 +163,26 @@
}
public void appendTo(SQLBuffer sql, int index, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
}
public void appendIsEmpty(SQLBuffer sql, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
}
public void appendIsNotEmpty(SQLBuffer sql, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
}
public void appendSize(SQLBuffer sql, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
}
public void appendIsNull(SQLBuffer sql, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
}
public void appendIsNotNull(SQLBuffer sql, Select sel,
- JDBCStore store, Object[] params, JDBCFetchState fetchState) {
+ JDBCStore store, Object[] params, JDBCFetchConfiguration fetch) {
}
}
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/Embeddable.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/Embeddable.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/Embeddable.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/Embeddable.java Fri Jul 28 16:48:13 2006
@@ -17,7 +17,7 @@
import java.sql.SQLException;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
+import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.schema.Column;
import org.apache.openjpa.jdbc.schema.ColumnIO;
@@ -77,6 +77,6 @@
* does not have to be loaded immediately; it may be stored as impl data.
*/
public void loadEmbedded(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Object val)
+ JDBCFetchConfiguration fetch, Object val)
throws SQLException;
}
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/FieldMapping.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/FieldMapping.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/FieldMapping.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/FieldMapping.java Fri Jul 28 16:48:13 2006
@@ -18,7 +18,6 @@
import java.sql.SQLException;
import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.meta.strats.NoneFieldStrategy;
import org.apache.openjpa.jdbc.schema.Column;
@@ -694,15 +693,13 @@
}
public void selectEagerParallel(SelectExecutor sel, OpenJPAStateManager sm,
- JDBCStore store, JDBCFetchState fetchState, int eagerMode) {
- assertStrategy().selectEagerParallel(sel, sm, store, fetchState,
- eagerMode);
+ JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) {
+ assertStrategy().selectEagerParallel(sel, sm, store, fetch, eagerMode);
}
public void selectEagerJoin(Select sel, OpenJPAStateManager sm,
- JDBCStore store, JDBCFetchState fetchState, int eagerMode) {
- assertStrategy().selectEagerJoin(sel, sm, store, fetchState,
- eagerMode);
+ JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) {
+ assertStrategy().selectEagerJoin(sel, sm, store, fetch, eagerMode);
}
public boolean isEagerSelectToMany() {
@@ -710,8 +707,8 @@
}
public int select(Select sel, OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, int eagerMode) {
- return assertStrategy().select(sel, sm, store, fetchState, eagerMode);
+ JDBCFetchConfiguration fetch, int eagerMode) {
+ return assertStrategy().select(sel, sm, store, fetch, eagerMode);
}
/**
@@ -771,27 +768,27 @@
}
public Object loadEagerParallel(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Object res)
+ JDBCFetchConfiguration fetch, Object res)
throws SQLException {
- return assertStrategy().loadEagerParallel(sm, store, fetchState, res);
+ return assertStrategy().loadEagerParallel(sm, store, fetch, res);
}
public void loadEagerJoin(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res)
+ JDBCFetchConfiguration fetch, Result res)
throws SQLException {
- assertStrategy().loadEagerJoin(sm, store, fetchState, res);
+ assertStrategy().loadEagerJoin(sm, store, fetch, res);
}
public void load(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res)
+ JDBCFetchConfiguration fetch, Result res)
throws SQLException {
- assertStrategy().load(sm, store, fetchState, res);
+ assertStrategy().load(sm, store, fetch, res);
}
public void load(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState)
+ JDBCFetchConfiguration fetch)
throws SQLException {
- assertStrategy().load(sm, store, fetchState);
+ assertStrategy().load(sm, store, fetch);
}
public Object toDataStoreValue(Object val, JDBCStore store) {
@@ -852,17 +849,17 @@
return joins.join(_fk, true, toMany);
}
- public Object loadProjection(JDBCStore store, JDBCFetchState fetchState,
+ public Object loadProjection(JDBCStore store, JDBCFetchConfiguration fetch,
Result res, Joins joins)
throws SQLException {
- return assertStrategy().loadProjection(store, fetchState, res, joins);
+ return assertStrategy().loadProjection(store, fetch, res, joins);
}
public Object loadKeyProjection(JDBCStore store,
- JDBCFetchState fetchState, Result res, Joins joins)
+ JDBCFetchConfiguration fetch, Result res, Joins joins)
throws SQLException {
return assertStrategy()
- .loadKeyProjection(store, fetchState, res, joins);
+ .loadKeyProjection(store, fetch, res, joins);
}
public boolean isVersionable() {
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/FieldStrategy.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/FieldStrategy.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/FieldStrategy.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/FieldStrategy.java Fri Jul 28 16:48:13 2006
@@ -18,7 +18,6 @@
import java.sql.SQLException;
import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.sql.Joins;
import org.apache.openjpa.jdbc.sql.Result;
@@ -62,7 +61,7 @@
* @see #select
*/
public void selectEagerParallel(SelectExecutor sel, OpenJPAStateManager sm,
- JDBCStore store, JDBCFetchState fetchState, int eagerMode);
+ JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode);
/**
* Fill in joined select to related objects.
@@ -70,7 +69,7 @@
* @see #select
*/
public void selectEagerJoin(Select sel, OpenJPAStateManager sm,
- JDBCStore store, JDBCFetchState fetchState, int eagerMode);
+ JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode);
/**
* Whether the eager joins or selects used by this field are to-many.
@@ -92,7 +91,7 @@
* require it, or < 0 if no data was selected
*/
public int select(Select sel, OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, int eagerMode);
+ JDBCFetchConfiguration fetch, int eagerMode);
/**
* Load the batched eager result.
@@ -102,14 +101,14 @@
* passed to subsequent calls
*/
public Object loadEagerParallel(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Object res)
+ JDBCFetchConfiguration fetch, Object res)
throws SQLException;
/**
* Load the joined eager result.
*/
public void loadEagerJoin(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res)
+ JDBCFetchConfiguration fetch, Result res)
throws SQLException;
/**
@@ -118,14 +117,14 @@
* result contains its needed column data before loading.
*/
public void load(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res)
+ JDBCFetchConfiguration fetch, Result res)
throws SQLException;
/**
* Load secondary data using a connection from the store manager.
*/
public void load(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState)
+ JDBCFetchConfiguration fetch)
throws SQLException;
///////////
@@ -212,7 +211,7 @@
* Load this field value using the given result. The result
* will contain the columns from {@link ValueMapping#getColumns}.
*/
- public Object loadProjection(JDBCStore store, JDBCFetchState fetchState,
+ public Object loadProjection(JDBCStore store, JDBCFetchConfiguration fetch,
Result res, Joins joins)
throws SQLException;
@@ -221,7 +220,7 @@
* contain the columns from {@link ValueMapping#getColumns}.
*/
public Object loadKeyProjection(JDBCStore store,
- JDBCFetchState fetchState, Result res, Joins joins)
+ JDBCFetchConfiguration fetch, Result res, Joins joins)
throws SQLException;
//////////////
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ValueHandler.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ValueHandler.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ValueHandler.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ValueHandler.java Fri Jul 28 16:48:13 2006
@@ -17,7 +17,7 @@
import java.sql.SQLException;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
+import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.schema.Column;
import org.apache.openjpa.jdbc.schema.ColumnIO;
@@ -94,6 +94,6 @@
* loading a projection
*/
public Object toObjectValue(ValueMapping vm, Object val,
- OpenJPAStateManager sm, JDBCStore store, JDBCFetchState fetchState)
+ OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch)
throws SQLException;
}
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/AbstractFieldStrategy.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/AbstractFieldStrategy.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/AbstractFieldStrategy.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/AbstractFieldStrategy.java Fri Jul 28 16:48:13 2006
@@ -18,7 +18,6 @@
import java.sql.SQLException;
import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.meta.FieldMapping;
import org.apache.openjpa.jdbc.meta.FieldStrategy;
@@ -68,11 +67,11 @@
}
public void selectEagerJoin(Select sel, OpenJPAStateManager sm,
- JDBCStore store, JDBCFetchState fetchState, int eagerMode) {
+ JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) {
}
public void selectEagerParallel(SelectExecutor sel, OpenJPAStateManager sm,
- JDBCStore store, JDBCFetchState fetchState, int eagerMode) {
+ JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) {
}
public boolean isEagerSelectToMany() {
@@ -80,28 +79,28 @@
}
public int select(Select sel, OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, int eagerMode) {
+ JDBCFetchConfiguration fetch, int eagerMode) {
return -1;
}
public Object loadEagerParallel(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Object res)
+ JDBCFetchConfiguration fetch, Object res)
throws SQLException {
return res;
}
public void loadEagerJoin(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res)
+ JDBCFetchConfiguration fetch, Result res)
throws SQLException {
}
public void load(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res)
+ JDBCFetchConfiguration fetch, Result res)
throws SQLException {
}
public void load(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState)
+ JDBCFetchConfiguration fetch)
throws SQLException {
}
@@ -151,14 +150,14 @@
return joins;
}
- public Object loadProjection(JDBCStore store, JDBCFetchState fetchState,
+ public Object loadProjection(JDBCStore store, JDBCFetchConfiguration fetch,
Result res, Joins joins)
throws SQLException {
return null;
}
public Object loadKeyProjection(JDBCStore store,
- JDBCFetchState fetchState, Result res, Joins joins)
+ JDBCFetchConfiguration fetch, Result res, Joins joins)
throws SQLException {
return null;
}
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/AbstractValueHandler.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/AbstractValueHandler.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/AbstractValueHandler.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/AbstractValueHandler.java Fri Jul 28 16:48:13 2006
@@ -17,7 +17,7 @@
import java.sql.SQLException;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
+import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.meta.ValueHandler;
import org.apache.openjpa.jdbc.meta.ValueMapping;
@@ -51,7 +51,7 @@
}
public Object toObjectValue(ValueMapping vm, Object val,
- OpenJPAStateManager sm, JDBCStore store, JDBCFetchState fetchState)
+ OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch)
throws SQLException {
return val;
}
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/EmbedFieldStrategy.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/EmbedFieldStrategy.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/EmbedFieldStrategy.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/EmbedFieldStrategy.java Fri Jul 28 16:48:13 2006
@@ -35,7 +35,6 @@
import org.apache.openjpa.enhance.PersistenceCapable;
import org.apache.openjpa.enhance.StateManager;
import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.meta.ClassMapping;
import org.apache.openjpa.jdbc.meta.FieldMapping;
@@ -52,7 +51,7 @@
import org.apache.openjpa.jdbc.sql.RowManager;
import org.apache.openjpa.jdbc.sql.SQLBuffer;
import org.apache.openjpa.jdbc.sql.Select;
-import org.apache.openjpa.kernel.FetchState;
+import org.apache.openjpa.kernel.FetchConfiguration;
import org.apache.openjpa.kernel.OpenJPAStateManager;
import org.apache.openjpa.kernel.PCState;
import org.apache.openjpa.kernel.StoreContext;
@@ -377,7 +376,7 @@
}
public int select(Select sel, OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, int eagerMode) {
+ JDBCFetchConfiguration fetch, int eagerMode) {
Joins joins = field.join(sel);
sel.select(field.getColumns(), joins); // null indicator
@@ -386,12 +385,12 @@
// result in a clone that produces invalid SQL
eagerMode = Math.min(eagerMode, JDBCFetchConfiguration.EAGER_JOIN);
sel.select(field.getEmbeddedMapping(), sel.SUBS_EXACT, store,
- fetchState, eagerMode, joins);
+ fetch, eagerMode, joins);
return 1;
}
public void load(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res)
+ JDBCFetchConfiguration fetch, Result res)
throws SQLException {
Boolean isNull = indicatesNull(res);
if (isNull == null)
@@ -420,15 +419,14 @@
res.startDataRequest(fields[i]);
try {
if (eres == res)
- fields[i].loadEagerJoin(em, store, fetchState, res);
+ fields[i].loadEagerJoin(em, store, fetch, res);
else if (eres != null) {
processed =
- fields[i].loadEagerParallel(em, store, fetchState,
- eres);
+ fields[i].loadEagerParallel(em, store, fetch, eres);
if (processed != eres)
res.putEager(fields[i], processed);
} else
- fields[i].load(em, store, fetchState, res);
+ fields[i].load(em, store, fetch, res);
loaded |= em.getLoaded().get(i);
} finally {
res.endDataRequest();
@@ -438,7 +436,7 @@
// after loading everything from result, load the rest of the
// configured fields
if (loaded)
- em.load(fetchState);
+ em.load(fetch);
}
/**
@@ -517,7 +515,7 @@
return field.join(joins, forceOuter, false);
}
- public Object loadProjection(JDBCStore store, JDBCFetchState fetchState,
+ public Object loadProjection(JDBCStore store, JDBCFetchConfiguration fetch,
Result res, Joins joins)
throws SQLException {
throw new UserException(_loc.get("cant-project-owned", field));
@@ -557,7 +555,7 @@
throw new InternalException();
}
- public void load(FetchState fetchState) {
+ public void load(FetchConfiguration fetch) {
throw new InternalException();
}
@@ -655,7 +653,7 @@
return EMPTY_BITSET;
}
- public BitSet getUnloaded(FetchState fetchState) {
+ public BitSet getUnloaded(FetchConfiguration fetch) {
throw new InternalException();
}
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/EmbedValueHandler.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/EmbedValueHandler.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/EmbedValueHandler.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/EmbedValueHandler.java Fri Jul 28 16:48:13 2006
@@ -18,7 +18,7 @@
import java.sql.SQLException;
import java.util.List;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
+import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.meta.Embeddable;
import org.apache.openjpa.jdbc.meta.FieldMapping;
@@ -128,12 +128,12 @@
* @param vm owning value
* @param val datastore value
* @param store optional store manager
- * @param fetchState optional fetch configuration
+ * @param fetch optional fetch configuration
* @param cols embedded columns
* @param idx index in columns array to start
*/
protected void toObjectValue(OpenJPAStateManager em, ValueMapping vm,
- Object val, JDBCStore store, JDBCFetchState fetchState,
+ Object val, JDBCStore store, JDBCFetchConfiguration fetch,
Column[] cols, int idx)
throws SQLException {
FieldMapping[] fms = vm.getEmbeddedMapping().getFieldMappings();
@@ -159,7 +159,7 @@
}
if (store != null)
- embed.loadEmbedded(em, store, fetchState, cval);
+ embed.loadEmbedded(em, store, fetch, cval);
else {
cval = embed.toEmbeddedObjectValue(cval);
em.store(fms[i].getIndex(), cval);
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/HandlerFieldStrategy.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/HandlerFieldStrategy.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/HandlerFieldStrategy.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/HandlerFieldStrategy.java Fri Jul 28 16:48:13 2006
@@ -18,7 +18,6 @@
import java.sql.SQLException;
import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.meta.Embeddable;
import org.apache.openjpa.jdbc.meta.FieldMapping;
@@ -148,7 +147,7 @@
}
public int select(Select sel, OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, int eagerMode) {
+ JDBCFetchConfiguration fetch, int eagerMode) {
if (_cols.length == 0)
return -1;
@@ -161,7 +160,7 @@
}
public void load(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res)
+ JDBCFetchConfiguration fetch, Result res)
throws SQLException {
if (_cols.length == 0 || !res.containsAll(_cols))
return;
@@ -178,13 +177,13 @@
}
public void load(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState)
+ JDBCFetchConfiguration fetch)
throws SQLException {
// even if no columns, allow a handler to load a generated value
if (_cols.length == 0) {
if (_load)
sm.store(field.getIndex(), field.getHandler().
- toObjectValue(field, null, sm, store, fetchState));
+ toObjectValue(field, null, sm, store, fetch));
else
sm.store(field.getIndex(), field.getHandler().
toObjectValue(field, null));
@@ -198,7 +197,7 @@
if (ds == NULL)
ds = null;
sm.store(field.getIndex(), field.getHandler().
- toObjectValue(field, ds, sm, store, fetchState));
+ toObjectValue(field, ds, sm, store, fetch));
return;
}
}
@@ -207,8 +206,7 @@
sel.select(_cols);
field.wherePrimaryKey(sel, sm, store);
- Result res = sel.execute(store,
- fetchState.getJDBCFetchConfiguration());
+ Result res = sel.execute(store, fetch);
Object val = null;
try {
if (res.next())
@@ -217,7 +215,7 @@
res.close();
}
- loadEmbedded(sm, store, fetchState, val);
+ loadEmbedded(sm, store, fetch, val);
}
public Object toDataStoreValue(Object val, JDBCStore store) {
@@ -259,10 +257,10 @@
return joins;
}
- public Object loadProjection(JDBCStore store, JDBCFetchState fetchState,
+ public Object loadProjection(JDBCStore store, JDBCFetchConfiguration fetch,
Result res, Joins joins)
throws SQLException {
- return HandlerStrategies.loadObject(field, null, store, fetchState, res,
+ return HandlerStrategies.loadObject(field, null, store, fetch, res,
joins, _cols, _load);
}
@@ -387,13 +385,13 @@
}
public void loadEmbedded(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Object val)
+ JDBCFetchConfiguration fetch, Object val)
throws SQLException {
if (val == null && _cols.length > 1)
val = new Object[_cols.length];
if (_load)
sm.store(field.getIndex(), field.getHandler().
- toObjectValue(field, val, sm, store, fetchState));
+ toObjectValue(field, val, sm, store, fetch));
else
sm.store(field.getIndex(), field.getHandler().
toObjectValue(field, val));
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/HandlerHandlerMapTableFieldStrategy.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/HandlerHandlerMapTableFieldStrategy.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/HandlerHandlerMapTableFieldStrategy.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/HandlerHandlerMapTableFieldStrategy.java Fri Jul 28 16:48:13 2006
@@ -20,7 +20,7 @@
import java.util.Iterator;
import java.util.Map;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
+import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.meta.ClassMapping;
import org.apache.openjpa.jdbc.meta.ValueHandler;
@@ -68,18 +68,18 @@
}
public void selectKey(Select sel, ClassMapping cls, OpenJPAStateManager sm,
- JDBCStore store, JDBCFetchState fetchState, Joins joins) {
+ JDBCStore store, JDBCFetchConfiguration fetch, Joins joins) {
sel.select(_kcols, joins);
}
public void selectValue(Select sel, ClassMapping cls,
OpenJPAStateManager sm,
- JDBCStore store, JDBCFetchState fetchState, Joins joins) {
+ JDBCStore store, JDBCFetchConfiguration fetch, Joins joins) {
sel.select(_vcols, joins);
}
public Result[] getResults(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, int eagerMode, Joins[] joins, boolean lrs)
+ JDBCFetchConfiguration fetch, int eagerMode, Joins[] joins, boolean lrs)
throws SQLException {
Select sel = store.getSQLFactory().newSelect();
sel.setLRS(lrs);
@@ -87,23 +87,22 @@
sel.select(_vcols);
sel.whereForeignKey(field.getJoinForeignKey(), sm.getObjectId(),
field.getDefiningMapping(), store);
- Result res = sel.execute(store,
- fetchState.getJDBCFetchConfiguration());
+ Result res = sel.execute(store, fetch);
return new Result[]{ res, res };
}
public Object loadKey(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res, Joins joins)
+ JDBCFetchConfiguration fetch, Result res, Joins joins)
throws SQLException {
return HandlerStrategies.loadObject(field.getKeyMapping(),
- sm, store, fetchState, res, joins, _kcols, _kload);
+ sm, store, fetch, res, joins, _kcols, _kload);
}
public Object loadValue(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res, Joins joins)
+ JDBCFetchConfiguration fetch, Result res, Joins joins)
throws SQLException {
return HandlerStrategies.loadObject(field.getElementMapping(),
- sm, store, fetchState, res, joins, _vcols, _vload);
+ sm, store, fetch, res, joins, _vcols, _vload);
}
public void map(boolean adapt) {