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 [4/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/meta/strats/HandlerStrategies.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/HandlerStrategies.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/HandlerStrategies.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/HandlerStrategies.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.ClassMapping;
import org.apache.openjpa.jdbc.meta.RelationId;
@@ -175,7 +175,7 @@
* Load the Object value from the given result.
*/
public static Object loadObject(ValueMapping vm, OpenJPAStateManager sm,
- JDBCStore store, JDBCFetchState fetchState, Result res,
+ JDBCStore store, JDBCFetchConfiguration fetch, Result res,
Joins joins, Column[] cols, boolean objectValueRequiresLoad)
throws SQLException {
if (cols.length == 0)
@@ -184,8 +184,7 @@
Object val = loadDataStore(vm, res, joins, cols);
if (objectValueRequiresLoad)
- return vm.getHandler().toObjectValue(vm, val, sm, store,
- fetchState);
+ return vm.getHandler().toObjectValue(vm, val, sm, store, fetch);
return vm.getHandler().toObjectValue(vm, val);
}
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/LRSCollectionFieldStrategy.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/LRSCollectionFieldStrategy.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/LRSCollectionFieldStrategy.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/LRSCollectionFieldStrategy.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.ClassMapping;
import org.apache.openjpa.jdbc.meta.FieldMapping;
@@ -74,7 +74,7 @@
* {@link #loadElement}.
*/
public void selectElement(Select sel, ClassMapping elem,
- JDBCStore store, JDBCFetchState fetchState, int eagerMode,
+ JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode,
Joins joins);
/**
@@ -83,7 +83,7 @@
* results.
*/
public Object loadElement(OpenJPAStateManager sm, 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/strats/LRSMapFieldStrategy.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/LRSMapFieldStrategy.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/LRSMapFieldStrategy.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/LRSMapFieldStrategy.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.ClassMapping;
import org.apache.openjpa.jdbc.meta.FieldMapping;
@@ -89,14 +89,14 @@
* This method is only used if the key is not derived from the value.
*/
public void selectKey(Select sel, ClassMapping key, OpenJPAStateManager sm,
- JDBCStore store, JDBCFetchState fetchState, Joins joins);
+ JDBCStore store, JDBCFetchConfiguration fetch, Joins joins);
/**
* Load a key from the given result.
* This method is only used if the key is not derived from the value.
*/
public Object loadKey(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res, Joins joins)
+ JDBCFetchConfiguration fetch, Result res, Joins joins)
throws SQLException;
/**
@@ -114,14 +114,14 @@
* Elements of the result will be loaded with {@link #loadValue}.
*/
public void selectValue(Select sel, ClassMapping val,
- OpenJPAStateManager sm,
- JDBCStore store, JDBCFetchState fetchState, Joins joins);
+ OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch,
+ Joins joins);
/**
* Load a value from the given result.
*/
public Object loadValue(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res, Joins joins)
+ JDBCFetchConfiguration fetch, Result res, Joins joins)
throws SQLException;
/**
@@ -132,7 +132,7 @@
* {@link #deriveKey} and {@link #loadValue} methods.
*/
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;
/**
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/LRSProxyCollection.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/LRSProxyCollection.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/LRSProxyCollection.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/LRSProxyCollection.java Fri Jul 28 16:48:13 2006
@@ -21,7 +21,6 @@
import org.apache.openjpa.conf.OpenJPAConfiguration;
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;
@@ -127,8 +126,6 @@
final OpenJPAStateManager sm = assertOwner();
final JDBCStore store = getStore();
final JDBCFetchConfiguration fetch = store.getFetchConfiguration();
- final JDBCFetchState fetchState =
- (JDBCFetchState) fetch.newFetchState();
final Joins[] resJoins = new Joins[Math.max(1, elems.length)];
final FieldMapping fm = _strat.getFieldMapping();
@@ -150,14 +147,14 @@
resJoins[idx] = _strat.joinElementRelation(sel.newJoins(),
elem);
fm.orderRelation(sel, elem, resJoins[idx]);
- _strat.selectElement(sel, elem, store, fetchState,
- fetch.EAGER_JOIN, resJoins[idx]);
+ _strat.selectElement(sel, elem, store, fetch, fetch.EAGER_JOIN,
+ resJoins[idx]);
}
});
try {
Result res = union.execute(store, fetch);
- return new ResultIterator(sm, store, fetchState, res, resJoins);
+ return new ResultIterator(sm, store, fetch, res, resJoins);
} catch (SQLException se) {
throw SQLExceptions.getStore(se, store.getDBDictionary());
}
@@ -184,16 +181,16 @@
private final OpenJPAStateManager _sm;
private final JDBCStore _store;
- private final JDBCFetchState _fetchState;
+ private final JDBCFetchConfiguration _fetch;
private final Result _res;
private final Joins[] _joins;
private Boolean _next = null;
public ResultIterator(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res, Joins[] joins) {
+ JDBCFetchConfiguration fetch, Result res, Joins[] joins) {
_sm = sm;
_store = store;
- _fetchState = fetchState;
+ _fetch = fetch;
_res = res;
_joins = joins;
}
@@ -214,7 +211,7 @@
throw new NoSuchElementException();
try {
_next = null;
- return _strat.loadElement(_sm, _store, _fetchState, _res,
+ return _strat.loadElement(_sm, _store, _fetch, _res,
_joins[_res.indexOf()]);
} catch (SQLException se) {
throw SQLExceptions.getStore(se, _store.getDBDictionary());
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/LRSProxyMap.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/LRSProxyMap.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/LRSProxyMap.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/LRSProxyMap.java Fri Jul 28 16:48:13 2006
@@ -25,7 +25,6 @@
import org.apache.openjpa.conf.OpenJPAConfiguration;
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.schema.Column;
@@ -166,8 +165,6 @@
final ClassMapping[] clss = _strat.getIndependentKeyMappings(true);
final JDBCFetchConfiguration fetch = store.getFetchConfiguration();
- final JDBCFetchState jfetchState = (JDBCFetchState) fetch
- .newFetchState();
final Joins[] resJoins = new Joins[Math.max(1, clss.length)];
Union union = store.getSQLFactory().newUnion
@@ -207,8 +204,7 @@
if (resJoins[idx] == null)
resJoins[idx] = _strat.joinKeyRelation(sel.newJoins(),
cls);
- _strat.selectKey(sel, cls, sm, store, jfetchState,
- resJoins[idx]);
+ _strat.selectKey(sel, cls, sm, store, fetch, resJoins[idx]);
}
});
@@ -217,7 +213,7 @@
try {
res = union.execute(store, fetch);
while (res.next())
- keys.add(_strat.loadKey(sm, store, jfetchState, res,
+ keys.add(_strat.loadKey(sm, store, fetch, res,
resJoins[res.indexOf()]));
return keys;
} catch (SQLException se) {
@@ -239,8 +235,6 @@
}
final JDBCFetchConfiguration fetch = store.getFetchConfiguration();
- final JDBCFetchState fetchState =
- (JDBCFetchState) fetch.newFetchState();
final ClassMapping[] clss = _strat.getIndependentValueMappings(true);
final Joins[] resJoins = new Joins[Math.max(1, clss.length)];
Union union = store.getSQLFactory().newUnion
@@ -282,8 +276,7 @@
if (resJoins[idx] == null)
resJoins[idx] = _strat.joinValueRelation(sel.newJoins(),
cls);
- _strat.selectValue(sel, cls, sm, store, fetchState,
- resJoins[idx]);
+ _strat.selectValue(sel, cls, sm, store, fetch, resJoins[idx]);
}
});
@@ -291,7 +284,7 @@
try {
res = union.execute(store, fetch);
if (res.next())
- return _strat.loadValue(sm, store, fetchState, res,
+ return _strat.loadValue(sm, store, fetch, res,
resJoins[res.indexOf()]);
return null;
} catch (SQLException se) {
@@ -306,12 +299,11 @@
OpenJPAStateManager sm = assertOwner();
JDBCStore store = getStore();
JDBCFetchConfiguration fetch = store.getFetchConfiguration();
- JDBCFetchState jfetchState = (JDBCFetchState) fetch.newFetchState();
try {
Joins[] joins = new Joins[2];
- Result[] res = _strat.getResults(sm, store, jfetchState,
- fetch.EAGER_JOIN, joins, true);
- return new ResultIterator(sm, store, jfetchState, res, joins);
+ Result[] res = _strat.getResults(sm, store, fetch, fetch.EAGER_JOIN,
+ joins, true);
+ return new ResultIterator(sm, store, fetch, res, joins);
} catch (SQLException se) {
throw SQLExceptions.getStore(se, store.getDBDictionary());
}
@@ -338,16 +330,16 @@
private final OpenJPAStateManager _sm;
private final JDBCStore _store;
- private final JDBCFetchState _fetchState;
+ private final JDBCFetchConfiguration _fetch;
private final Result[] _res;
private final Joins[] _joins;
private Boolean _next = null;
public ResultIterator(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result[] res, Joins[] joins) {
+ JDBCFetchConfiguration fetch, Result[] res, Joins[] joins) {
_sm = sm;
_store = store;
- _fetchState = fetchState;
+ _fetch = fetch;
_res = res;
_joins = joins;
}
@@ -378,11 +370,11 @@
try {
if (!keyDerived)
- entry.key = _strat.loadKey(_sm, _store, _fetchState,
- _res[0], _joins[0]);
+ entry.key = _strat.loadKey(_sm, _store, _fetch, _res[0],
+ _joins[0]);
if (!valDerived)
- entry.val = _strat.loadValue(_sm, _store, _fetchState,
- _res[1], _joins[1]);
+ entry.val = _strat.loadValue(_sm, _store, _fetch, _res[1],
+ _joins[1]);
if (keyDerived)
entry.key = _strat.deriveKey(_store, entry.val);
if (valDerived)
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/MapTableFieldStrategy.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/MapTableFieldStrategy.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/MapTableFieldStrategy.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/MapTableFieldStrategy.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.meta.FieldMapping;
@@ -114,7 +113,7 @@
}
public void load(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState)
+ JDBCFetchConfiguration fetch)
throws SQLException {
if (field.isLRS()) {
sm.storeObjectField(field.getIndex(), new LRSProxyMap(this,
@@ -124,7 +123,7 @@
// select all and load into a normal proxy
Joins[] joins = new Joins[2];
- Result[] res = getResults(sm, store, fetchState,
+ Result[] res = getResults(sm, store, fetch,
JDBCFetchConfiguration.EAGER_PARALLEL, joins, false);
try {
Map map = (Map) sm.newProxy(field.getIndex());
@@ -133,8 +132,8 @@
if (res[1] != res[0] && !res[1].next())
break;
- key = loadKey(sm, store, fetchState, res[0], joins[0]);
- val = loadValue(sm, store, fetchState, res[1], joins[1]);
+ key = loadKey(sm, store, fetch, res[0], joins[0]);
+ val = loadValue(sm, store, fetch, res[1], joins[1]);
map.put(key, val);
}
sm.storeObject(field.getIndex(), map);
@@ -146,15 +145,15 @@
}
public Object loadKeyProjection(JDBCStore store,
- JDBCFetchState fetchState, Result res, Joins joins)
+ JDBCFetchConfiguration fetch, Result res, Joins joins)
throws SQLException {
- return loadKey(null, store, fetchState, res, joins);
+ return loadKey(null, store, fetch, res, joins);
}
- public Object loadProjection(JDBCStore store, JDBCFetchState fetchState,
+ public Object loadProjection(JDBCStore store, JDBCFetchConfiguration fetch,
Result res, Joins joins)
throws SQLException {
- return loadValue(null, store, fetchState, res, joins);
+ return loadValue(null, store, fetch, res, joins);
}
public Joins join(Joins joins, boolean forceOuter) {
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/MaxEmbeddedLobFieldStrategy.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/MaxEmbeddedLobFieldStrategy.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/MaxEmbeddedLobFieldStrategy.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/MaxEmbeddedLobFieldStrategy.java Fri Jul 28 16:48:13 2006
@@ -21,7 +21,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.JavaSQLTypes;
import org.apache.openjpa.jdbc.meta.ValueMappingInfo;
@@ -192,7 +191,7 @@
}
public void load(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res)
+ JDBCFetchConfiguration fetch, Result res)
throws SQLException {
Column col = field.getColumns()[0];
if (res.contains(col))
@@ -200,15 +199,14 @@
}
public void load(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState)
+ JDBCFetchConfiguration fetch)
throws SQLException {
Column col = field.getColumns()[0];
Select sel = store.getSQLFactory().newSelect();
sel.select(col);
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())
@@ -243,7 +241,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 {
return load(field.getColumns()[0], res, joins);
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/PrimitiveFieldStrategy.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/PrimitiveFieldStrategy.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/PrimitiveFieldStrategy.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/PrimitiveFieldStrategy.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.Joinable;
@@ -173,13 +172,13 @@
}
public int select(Select sel, OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, int eagerMode) {
+ JDBCFetchConfiguration fetch, int eagerMode) {
sel.select(field.getColumns()[0], field.join(sel));
return 1;
}
public void load(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res)
+ JDBCFetchConfiguration fetch, Result res)
throws SQLException {
Column col = field.getColumns()[0];
if (!res.contains(col))
@@ -240,7 +239,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 {
return res.getObject(field.getColumns()[0], null, joins);
@@ -393,7 +392,7 @@
}
public void loadEmbedded(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Object val)
+ JDBCFetchConfiguration fetch, Object val)
throws SQLException {
sm.store(field.getIndex(), val);
}
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationCollectionInverseKeyFieldStrategy.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationCollectionInverseKeyFieldStrategy.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationCollectionInverseKeyFieldStrategy.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationCollectionInverseKeyFieldStrategy.java Fri Jul 28 16:48:13 2006
@@ -18,7 +18,7 @@
import java.sql.SQLException;
import org.apache.openjpa.conf.OpenJPAConfiguration;
-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;
@@ -63,14 +63,14 @@
}
public void selectElement(Select sel, ClassMapping elem, JDBCStore store,
- JDBCFetchState fetchState, int eagerMode, Joins joins) {
- super.selectElement(sel, elem, store, fetchState, eagerMode, joins);
+ JDBCFetchConfiguration fetch, int eagerMode, Joins joins) {
+ super.selectElement(sel, elem, store, fetch, eagerMode, joins);
}
public Object loadElement(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res, Joins joins)
+ JDBCFetchConfiguration fetch, Result res, Joins joins)
throws SQLException {
- return super.loadElement(sm, store, fetchState, res, joins);
+ return super.loadElement(sm, store, fetch, res, joins);
}
public Joins join(Joins joins, ClassMapping elem) {
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationCollectionTableFieldStrategy.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationCollectionTableFieldStrategy.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationCollectionTableFieldStrategy.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationCollectionTableFieldStrategy.java Fri Jul 28 16:48:13 2006
@@ -18,7 +18,7 @@
import java.sql.SQLException;
import org.apache.openjpa.conf.OpenJPAConfiguration;
-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;
@@ -62,14 +62,14 @@
}
public void selectElement(Select sel, ClassMapping elem, JDBCStore store,
- JDBCFetchState fetchState, int eagerMode, Joins joins) {
- super.selectElement(sel, elem, store, fetchState, eagerMode, joins);
+ JDBCFetchConfiguration fetch, int eagerMode, Joins joins) {
+ super.selectElement(sel, elem, store, fetch, eagerMode, joins);
}
public Object loadElement(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res, Joins joins)
+ JDBCFetchConfiguration fetch, Result res, Joins joins)
throws SQLException {
- return super.loadElement(sm, store, fetchState, res, joins);
+ return super.loadElement(sm, store, fetch, res, joins);
}
public Joins join(Joins joins, ClassMapping elem) {
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationFieldStrategy.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationFieldStrategy.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationFieldStrategy.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationFieldStrategy.java Fri Jul 28 16:48:13 2006
@@ -20,7 +20,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.meta.Embeddable;
@@ -342,19 +341,18 @@
public void selectEagerParallel(SelectExecutor sel,
final OpenJPAStateManager sm, final JDBCStore store,
- final JDBCFetchState fetchState, final int eagerMode) {
+ final JDBCFetchConfiguration fetch, final int eagerMode) {
final ClassMapping[] clss = field.getIndependentTypeMappings();
if (!(sel instanceof Union))
- selectEagerParallel((Select) sel, clss[0], store, fetchState,
- eagerMode);
+ selectEagerParallel((Select) sel, clss[0], store, fetch, eagerMode);
else {
Union union = (Union) sel;
- if (fetchState.getJDBCFetchConfiguration().getSubclassFetchMode
- (field.getTypeMapping()) != JDBCFetchConfiguration.EAGER_JOIN)
+ if (fetch.getSubclassFetchMode (field.getTypeMapping())
+ != JDBCFetchConfiguration.EAGER_JOIN)
union.abortUnion();
union.select(new Union.Selector() {
public void select(Select sel, int idx) {
- selectEagerParallel(sel, clss[idx], store, fetchState,
+ selectEagerParallel(sel, clss[idx], store, fetch,
eagerMode);
}
});
@@ -365,7 +363,7 @@
* Perform an eager parallel select.
*/
private void selectEagerParallel(Select sel, ClassMapping cls,
- JDBCStore store, JDBCFetchState fetchState, int eagerMode) {
+ JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) {
sel.selectPrimaryKey(field.getDefiningMapping());
// set a variable name that does not conflict with any in the query;
// using a variable guarantees that the selected data will use different
@@ -373,18 +371,18 @@
// that might otherwise limit the relations that match
Joins joins = sel.newJoins().setVariable("*");
eagerJoin(joins, cls, true);
- sel.select(cls, field.getSelectSubclasses(), store, fetchState,
- eagerMode, joins);
+ sel.select(cls, field.getSelectSubclasses(), store, fetch, eagerMode,
+ joins);
}
public void selectEagerJoin(Select sel, OpenJPAStateManager sm,
- JDBCStore store, JDBCFetchState fetchState, int eagerMode) {
+ JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) {
// limit the eager mode to single on recursive eager fetching b/c
// at this point the select has been modified and an attempt to
// clone it for a to-many eager select can result in a clone that
// produces invalid SQL
ClassMapping cls = field.getIndependentTypeMappings()[0];
- sel.select(cls, field.getSelectSubclasses(), store, fetchState,
+ sel.select(cls, field.getSelectSubclasses(), store, fetch,
JDBCFetchConfiguration.EAGER_JOIN,
eagerJoin(sel.newJoins(), cls, false));
}
@@ -405,7 +403,7 @@
}
public int select(Select sel, OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, int eagerMode) {
+ JDBCFetchConfiguration fetch, int eagerMode) {
if (field.getJoinDirection() == field.JOIN_INVERSE)
return -1;
// already cached oid?
@@ -418,13 +416,12 @@
}
public Object loadEagerParallel(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Object res)
+ JDBCFetchConfiguration fetch, Object res)
throws SQLException {
// process batched results if we haven't already
Map rels;
if (res instanceof Result)
- rels = processEagerParallelResult(sm, store, fetchState,
- (Result) res);
+ rels = processEagerParallelResult(sm, store, fetch, (Result) res);
else
rels = (Map) res;
@@ -437,7 +434,7 @@
* Process the given batched result.
*/
private Map processEagerParallelResult(OpenJPAStateManager sm,
- JDBCStore store, JDBCFetchState fetchState, Result res)
+ JDBCStore store, JDBCFetchConfiguration fetch, Result res)
throws SQLException {
// do same joins as for load
//### cheat: we know typical result joins only care about the relation
@@ -455,7 +452,7 @@
if (cls == null)
cls = clss[0];
oid = owner.getObjectId(store, res, null, true, null);
- rels.put(oid, res.load(cls, store, fetchState, joins));
+ rels.put(oid, res.load(cls, store, fetch, joins));
}
res.close();
@@ -463,15 +460,15 @@
}
public void loadEagerJoin(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res)
+ JDBCFetchConfiguration fetch, Result res)
throws SQLException {
ClassMapping cls = field.getIndependentTypeMappings()[0];
- sm.storeObject(field.getIndex(), res.load(cls, store, fetchState,
+ sm.storeObject(field.getIndex(), res.load(cls, store, fetch,
eagerJoin(res.newJoins(), cls, false)));
}
public void load(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res)
+ JDBCFetchConfiguration fetch, Result res)
throws SQLException {
if (field.getJoinDirection() == field.JOIN_INVERSE)
return;
@@ -522,15 +519,13 @@
}
public void load(final OpenJPAStateManager sm, final JDBCStore store,
- final JDBCFetchState fetchState)
+ final JDBCFetchConfiguration fetch)
throws SQLException {
- final JDBCFetchConfiguration fetch =
- fetchState.getJDBCFetchConfiguration();
// check for cached oid value, or load oid if no way to join
if (Boolean.TRUE.equals(_fkOid)) {
Object oid = sm.getIntermediate(field.getIndex());
if (oid != null) {
- Object val = store.find(oid, field, fetchState);
+ Object val = store.find(oid, field, fetch);
sm.storeObject(field.getIndex(), val);
return;
}
@@ -559,8 +554,8 @@
false, false);
field.wherePrimaryKey(sel, sm, store);
}
- sel.select(rels[idx], subs, store, fetchState,
- fetch.EAGER_JOIN, resJoins[idx]);
+ sel.select(rels[idx], subs, store, fetch, fetch.EAGER_JOIN,
+ resJoins[idx]);
}
});
@@ -568,7 +563,7 @@
try {
Object val = null;
if (res.next())
- val = res.load(rels[res.indexOf()], store, fetchState,
+ val = res.load(rels[res.indexOf()], store, fetch,
resJoins[res.indexOf()]);
sm.storeObject(field.getIndex(), val);
} finally {
@@ -695,7 +690,7 @@
}
public void loadEmbedded(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Object val)
+ JDBCFetchConfiguration fetch, Object val)
throws SQLException {
ClassMapping relMapping = field.getTypeMapping();
Object oid;
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationMapInverseKeyFieldStrategy.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationMapInverseKeyFieldStrategy.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationMapInverseKeyFieldStrategy.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationMapInverseKeyFieldStrategy.java Fri Jul 28 16:48:13 2006
@@ -21,7 +21,6 @@
import org.apache.openjpa.conf.OpenJPAConfiguration;
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;
@@ -78,12 +77,12 @@
}
public void selectKey(Select sel, ClassMapping key, OpenJPAStateManager sm,
- JDBCStore store, JDBCFetchState fetchState, Joins joins) {
+ JDBCStore store, JDBCFetchConfiguration fetch, Joins joins) {
throw new InternalException();
}
public Object loadKey(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res, Joins joins)
+ JDBCFetchConfiguration fetch, Result res, Joins joins)
throws SQLException {
throw new InternalException();
}
@@ -100,38 +99,36 @@
}
public void selectValue(Select sel, ClassMapping val,
- OpenJPAStateManager sm,
- JDBCStore store, JDBCFetchState fetchState, Joins joins) {
- selectElement(sel, val, store, fetchState,
- JDBCFetchConfiguration.EAGER_NONE, joins);
+ OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch,
+ Joins joins) {
+ selectElement(sel, val, store, fetch, JDBCFetchConfiguration.EAGER_NONE,
+ joins);
}
public Object loadValue(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res, Joins joins)
+ JDBCFetchConfiguration fetch, Result res, Joins joins)
throws SQLException {
- return loadElement(sm, store, fetchState, res, joins);
+ return loadElement(sm, store, fetch, res, joins);
}
public Result[] getResults(final OpenJPAStateManager sm,
- final JDBCStore store, final JDBCFetchState fetchState,
+ final JDBCStore store, final JDBCFetchConfiguration fetch,
final int eagerMode, final Joins[] joins, boolean lrs)
throws SQLException {
ValueMapping val = field.getElementMapping();
final ClassMapping[] vals = val.getIndependentTypeMappings();
Union union = store.getSQLFactory().newUnion(vals.length);
- JDBCFetchConfiguration fetch = fetchState.getJDBCFetchConfiguration();
if (fetch.getSubclassFetchMode(val.getTypeMapping())
!= JDBCFetchConfiguration.EAGER_JOIN)
union.abortUnion();
union.setLRS(lrs);
union.select(new Union.Selector() {
public void select(Select sel, int idx) {
- joins[1] = selectAll(sel, vals[idx], sm, store, fetchState,
+ joins[1] = selectAll(sel, vals[idx], sm, store, fetch,
eagerMode);
}
});
- Result res = union.execute(store,
- fetchState.getJDBCFetchConfiguration());
+ Result res = union.execute(store, fetch);
return new Result[]{ res, res };
}
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationMapTableFieldStrategy.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationMapTableFieldStrategy.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationMapTableFieldStrategy.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationMapTableFieldStrategy.java Fri Jul 28 16:48:13 2006
@@ -21,7 +21,6 @@
import org.apache.openjpa.conf.OpenJPAConfiguration;
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;
@@ -78,12 +77,12 @@
}
public void selectKey(Select sel, ClassMapping key, OpenJPAStateManager sm,
- JDBCStore store, JDBCFetchState fetchState, Joins joins) {
+ JDBCStore store, JDBCFetchConfiguration fetch, Joins joins) {
throw new InternalException();
}
public Object loadKey(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res, Joins joins)
+ JDBCFetchConfiguration fetch, Result res, Joins joins)
throws SQLException {
throw new InternalException();
}
@@ -100,38 +99,36 @@
}
public void selectValue(Select sel, ClassMapping val,
- OpenJPAStateManager sm,
- JDBCStore store, JDBCFetchState fetchState, Joins joins) {
- selectElement(sel, val, store, fetchState,
- JDBCFetchConfiguration.EAGER_NONE, joins);
+ OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch,
+ Joins joins) {
+ selectElement(sel, val, store, fetch, JDBCFetchConfiguration.EAGER_NONE,
+ joins);
}
public Object loadValue(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res, Joins joins)
+ JDBCFetchConfiguration fetch, Result res, Joins joins)
throws SQLException {
- return loadElement(sm, store, fetchState, res, joins);
+ return loadElement(sm, store, fetch, res, joins);
}
public Result[] getResults(final OpenJPAStateManager sm,
- final JDBCStore store, final JDBCFetchState fetchState,
+ final JDBCStore store, final JDBCFetchConfiguration fetch,
final int eagerMode, final Joins[] joins, boolean lrs)
throws SQLException {
ValueMapping val = field.getElementMapping();
final ClassMapping[] vals = val.getIndependentTypeMappings();
Union union = store.getSQLFactory().newUnion(vals.length);
- JDBCFetchConfiguration fetch = fetchState.getJDBCFetchConfiguration();
if (fetch.getSubclassFetchMode(val.getTypeMapping())
!= JDBCFetchConfiguration.EAGER_JOIN)
union.abortUnion();
union.setLRS(lrs);
union.select(new Union.Selector() {
public void select(Select sel, int idx) {
- joins[1] = selectAll(sel, vals[idx], sm, store, fetchState,
+ joins[1] = selectAll(sel, vals[idx], sm, store, fetch,
eagerMode);
}
});
- Result res = union.execute(store,
- fetchState.getJDBCFetchConfiguration());
+ Result res = union.execute(store, fetch);
return new Result[]{ res, res };
}
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationToManyInverseKeyFieldStrategy.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationToManyInverseKeyFieldStrategy.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationToManyInverseKeyFieldStrategy.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationToManyInverseKeyFieldStrategy.java Fri Jul 28 16:48:13 2006
@@ -19,7 +19,7 @@
import java.util.Collection;
import java.util.Iterator;
-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;
@@ -68,19 +68,19 @@
}
protected void selectElement(Select sel, ClassMapping elem,
- JDBCStore store, JDBCFetchState fetchState, int eagerMode,
+ JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode,
Joins joins) {
sel.select(elem, field.getElementMapping().getSelectSubclasses(),
- store, fetchState, eagerMode, joins);
+ store, fetch, eagerMode, joins);
}
protected Object loadElement(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res, Joins joins)
+ JDBCFetchConfiguration fetch, Result res, Joins joins)
throws SQLException {
ClassMapping elem = res.getBaseMapping();
if (elem == null)
elem = field.getElementMapping().getIndependentTypeMappings()[0];
- return res.load(elem, store, fetchState, joins);
+ return res.load(elem, store, fetch, joins);
}
protected Joins join(Joins joins, ClassMapping elem) {
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationToManyTableFieldStrategy.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationToManyTableFieldStrategy.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationToManyTableFieldStrategy.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationToManyTableFieldStrategy.java Fri Jul 28 16:48:13 2006
@@ -19,7 +19,7 @@
import java.util.Collection;
import java.util.Iterator;
-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;
@@ -64,19 +64,19 @@
}
protected void selectElement(Select sel, ClassMapping elem,
- JDBCStore store, JDBCFetchState fetchState, int eagerMode,
+ JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode,
Joins joins) {
sel.select(elem, field.getElementMapping().getSelectSubclasses(),
- store, fetchState, eagerMode, joins);
+ store, fetch, eagerMode, joins);
}
protected Object loadElement(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res, Joins joins)
+ JDBCFetchConfiguration fetch, Result res, Joins joins)
throws SQLException {
ClassMapping elem = res.getBaseMapping();
if (elem == null)
elem = field.getElementMapping().getIndependentTypeMappings()[0];
- return res.load(elem, store, fetchState, joins);
+ return res.load(elem, store, fetch, joins);
}
protected Joins join(Joins joins, ClassMapping elem) {
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java Fri Jul 28 16:48:13 2006
@@ -23,7 +23,6 @@
import org.apache.openjpa.conf.OpenJPAConfiguration;
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;
@@ -67,7 +66,7 @@
* {@link #loadElement}.
*/
protected abstract void selectElement(Select sel, ClassMapping elem,
- JDBCStore store, JDBCFetchState fetchState, int eagerMode,
+ JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode,
Joins joins);
/**
@@ -76,8 +75,7 @@
* results.
*/
protected abstract Object loadElement(OpenJPAStateManager sm,
- JDBCStore store,
- JDBCFetchState fetchState, Result res, Joins joins)
+ JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins)
throws SQLException;
/**
@@ -143,34 +141,32 @@
public void selectEagerParallel(SelectExecutor sel,
final OpenJPAStateManager sm, final JDBCStore store,
- final JDBCFetchState fetchState, final int eagerMode) {
+ final JDBCFetchConfiguration fetch, final int eagerMode) {
if (!(sel instanceof Union))
selectEager((Select) sel, getDefaultElementMapping(true), sm,
- store, fetchState, eagerMode, true, false);
+ store, fetch, eagerMode, true, false);
else {
final ClassMapping[] elems = getIndependentElementMappings(true);
Union union = (Union) sel;
- JDBCFetchConfiguration fetch =
- fetchState.getJDBCFetchConfiguration();
if (fetch.getSubclassFetchMode(field.getElementMapping().
getTypeMapping()) != fetch.EAGER_JOIN)
union.abortUnion();
union.select(new Union.Selector() {
public void select(Select sel, int idx) {
- selectEager(sel, elems[idx], sm, store, fetchState,
- eagerMode, true, false);
+ selectEager(sel, elems[idx], sm, store, fetch, eagerMode,
+ true, false);
}
});
}
}
public void selectEagerJoin(Select sel, OpenJPAStateManager sm,
- JDBCStore store, JDBCFetchState fetchState, int eagerMode) {
+ JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) {
// we limit further eager fetches to joins, because after this point
// the select has been modified such that parallel clones may produce
// invalid sql
- selectEager(sel, getDefaultElementMapping(true), sm, store,
- fetchState, JDBCFetchConfiguration.EAGER_JOIN, false,
+ selectEager(sel, getDefaultElementMapping(true), sm, store, fetch,
+ JDBCFetchConfiguration.EAGER_JOIN, false,
field.getNullValue()
!= FieldMapping.NULL_EXCEPTION);
}
@@ -183,7 +179,7 @@
* Select our data eagerly.
*/
private void selectEager(Select sel, ClassMapping elem,
- OpenJPAStateManager sm, JDBCStore store, JDBCFetchState fetchState,
+ OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch,
int eagerMode, boolean selectOid, boolean outer) {
// force distinct if there was a to-many join to avoid dups, but
// if this is a parallel select don't make distinct based on the
@@ -221,17 +217,16 @@
if (outer)
joins = sel.outer(joins);
field.orderRelation(sel, elem, joins);
- selectElement(sel, elem, store, fetchState, eagerMode, joins);
+ selectElement(sel, elem, store, fetch, eagerMode, joins);
}
public Object loadEagerParallel(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Object res)
+ JDBCFetchConfiguration fetch, Object res)
throws SQLException {
// process batched results if we haven't already
Map rels;
if (res instanceof Result)
- rels = processEagerParallelResult(sm, store, fetchState,
- (Result) res);
+ rels = processEagerParallelResult(sm, store, fetch, (Result) res);
else
rels = (Map) res;
@@ -252,7 +247,7 @@
* Process the given batched result.
*/
private Map processEagerParallelResult(OpenJPAStateManager sm,
- JDBCStore store, JDBCFetchState fetchState, Result res)
+ JDBCStore store, JDBCFetchConfiguration fetch, Result res)
throws SQLException {
// do same joins as for load
//### cheat: we know typical result joins only care about the relation
@@ -293,8 +288,7 @@
if (field.getOrderColumn() != null)
seq = res.getInt(field.getOrderColumn(), orderJoins) + 1;
- add(store, coll, loadElement(null, store, fetchState, res,
- dataJoins));
+ add(store, coll, loadElement(null, store, fetch, res, dataJoins));
}
res.close();
@@ -324,7 +318,7 @@
}
public void loadEagerJoin(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res)
+ JDBCFetchConfiguration fetch, Result res)
throws SQLException {
// initialize field value
Object coll;
@@ -364,8 +358,7 @@
if (field.getOrderColumn() != null)
seq = res.getInt(field.getOrderColumn(), refJoins) + 1;
res.setBaseMapping(null);
- add(store, coll, loadElement(sm, store, fetchState, res,
- dataJoins));
+ add(store, coll, loadElement(sm, store, fetch, res, dataJoins));
if (!res.next() || res.indexOf() != typeIdx) {
res.pushBack();
break;
@@ -413,7 +406,7 @@
}
public void load(final OpenJPAStateManager sm, final JDBCStore store,
- final JDBCFetchState fetchState)
+ final JDBCFetchConfiguration fetch)
throws SQLException {
if (field.isLRS()) {
Proxy coll = newLRSProxy(store.getConfiguration());
@@ -434,8 +427,7 @@
sel.whereForeignKey(getJoinForeignKey(rel),
sm.getObjectId(), field.getDefiningMapping(), store);
- Result res = sel.execute(store,
- fetchState.getJDBCFetchConfiguration());
+ Result res = sel.execute(store, fetch);
try {
res.next();
coll.getChangeTracker().setNextSequence
@@ -456,7 +448,7 @@
union.select(new Union.Selector() {
public void select(Select sel, int idx) {
ClassMapping elem = (elems.length == 0) ? null : elems[idx];
- resJoins[idx] = selectAll(sel, elem, sm, store, fetchState,
+ resJoins[idx] = selectAll(sel, elem, sm, store, fetch,
JDBCFetchConfiguration.EAGER_PARALLEL);
}
});
@@ -473,14 +465,13 @@
}
// load values
- Result res = union.execute(store,
- fetchState.getJDBCFetchConfiguration());
+ Result res = union.execute(store, fetch);
try {
int seq = 0;
while (res.next()) {
if (ct != null && field.getOrderColumn() != null)
seq = res.getInt(field.getOrderColumn());
- add(store, coll, loadElement(sm, store, fetchState, res,
+ add(store, coll, loadElement(sm, store, fetch, res,
resJoins[res.indexOf()]));
}
if (ct != null && field.getOrderColumn() != null)
@@ -501,7 +492,7 @@
* Select data for loading, starting in field table.
*/
protected Joins selectAll(Select sel, ClassMapping elem,
- OpenJPAStateManager sm, JDBCStore store, JDBCFetchState fetchState,
+ OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch,
int eagerMode) {
sel.whereForeignKey(getJoinForeignKey(elem), sm.getObjectId(),
field.getDefiningMapping(), store);
@@ -511,14 +502,14 @@
field.orderLocal(sel, elem, null);
Joins joins = joinElementRelation(sel.newJoins(), elem);
field.orderRelation(sel, elem, joins);
- selectElement(sel, elem, store, fetchState, eagerMode, joins);
+ selectElement(sel, elem, store, fetch, eagerMode, joins);
return joins;
}
- public Object loadProjection(JDBCStore store, JDBCFetchState fetchState,
+ public Object loadProjection(JDBCStore store, JDBCFetchConfiguration fetch,
Result res, Joins joins)
throws SQLException {
- return loadElement(null, store, fetchState, res, joins);
+ return loadElement(null, store, fetch, res, joins);
}
protected ForeignKey getJoinForeignKey() {
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StringFieldStrategy.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StringFieldStrategy.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StringFieldStrategy.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StringFieldStrategy.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;
@@ -140,13 +139,13 @@
}
public int select(Select sel, OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetch, int eagerMode) {
+ JDBCFetchConfiguration fetch, int eagerMode) {
sel.select(field.getColumns()[0], field.join(sel));
return 1;
}
public void load(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Result res)
+ JDBCFetchConfiguration fetch, Result res)
throws SQLException {
Column col = field.getColumns()[0];
if (res.contains(col))
@@ -169,7 +168,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 {
return res.getString(field.getColumns()[0], joins);
@@ -250,7 +249,7 @@
}
public void loadEmbedded(OpenJPAStateManager sm, JDBCStore store,
- JDBCFetchState fetchState, Object val)
+ JDBCFetchConfiguration fetch, Object val)
throws SQLException {
sm.storeString(field.getIndex(), (String) val);
}
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/UntypedPCValueHandler.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/UntypedPCValueHandler.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/UntypedPCValueHandler.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/UntypedPCValueHandler.java Fri Jul 28 16:48:13 2006
@@ -18,7 +18,7 @@
import java.sql.SQLException;
import org.apache.openjpa.enhance.PersistenceCapable;
-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.RelationId;
import org.apache.openjpa.jdbc.meta.ValueMapping;
@@ -83,7 +83,7 @@
}
public Object toObjectValue(ValueMapping vm, Object val,
- OpenJPAStateManager sm, JDBCStore store, JDBCFetchState fetchState)
+ OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch)
throws SQLException {
if (val == null)
return null;
@@ -107,7 +107,7 @@
}
Object oid = ctx.newObjectId(cls, oidStr);
- return store.find(oid, vm, fetchState);
+ return store.find(oid, vm, fetch);
}
public Object toRelationDataStoreValue(OpenJPAStateManager sm, Column col) {
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractResult.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractResult.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractResult.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractResult.java Fri Jul 28 16:48:13 2006
@@ -34,7 +34,7 @@
import java.util.Locale;
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.kernel.JDBCStoreManager;
import org.apache.openjpa.jdbc.meta.ClassMapping;
@@ -243,16 +243,15 @@
}
public Object load(ClassMapping mapping, JDBCStore store,
- JDBCFetchState fetchState)
+ JDBCFetchConfiguration fetch)
throws SQLException {
- return load(mapping, store, fetchState, null);
+ return load(mapping, store, fetch, null);
}
public Object load(ClassMapping mapping, JDBCStore store,
- JDBCFetchState fetchState, Joins joins)
+ JDBCFetchConfiguration fetch, Joins joins)
throws SQLException {
- return ((JDBCStoreManager) store).load(mapping, fetchState, null,
- this);
+ return ((JDBCStoreManager) store).load(mapping, fetch, null, this);
}
public Array getArray(Object obj)
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java Fri Jul 28 16:48:13 2006
@@ -58,7 +58,6 @@
import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
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.kernel.exps.FilterValue;
import org.apache.openjpa.jdbc.meta.ClassMapping;
@@ -1858,15 +1857,14 @@
sql.append(col.getName());
sql.append(" = ");
val.initialize(sel, store, false);
- JDBCFetchState fetchState = (JDBCFetchState) store.
- getFetchConfiguration().newFetchState();
- val.calculateValue(sel, store, params, null, fetchState);
+ JDBCFetchConfiguration fetch = store.getFetchConfiguration();
+ val.calculateValue(sel, store, params, null, fetch);
// append the value with a null for the Select; i
// indicates that the
for (int j = 0; j < val.length(); j++)
- val.appendTo(sql, j, allowAlias ? sel : null,
- store, params, fetchState);
+ val.appendTo(sql, j, (allowAlias) ? sel : null, store, params,
+ fetch);
if (i.hasNext())
sql.append(", ");
@@ -2083,13 +2081,20 @@
group, having, order, distinct, forUpdate, start, end);
}
+ /**
+ * Return the "SELECT" operation clause, adding any available hints, etc.
+ */
public String getSelectOperation(JDBCFetchConfiguration fetch) {
return "SELECT";
}
- public SQLBuffer toOperation(String op, SQLBuffer selects, SQLBuffer from,
- SQLBuffer where, SQLBuffer group, SQLBuffer having, SQLBuffer order,
- boolean distinct, boolean forUpdate, long start, long end) {
+ /**
+ * Return the SQL for the given selecting operation.
+ */
+ protected SQLBuffer toOperation(String op, SQLBuffer selects,
+ SQLBuffer from, SQLBuffer where, SQLBuffer group, SQLBuffer having,
+ SQLBuffer order, boolean distinct, boolean forUpdate, long start,
+ long end) {
SQLBuffer buf = new SQLBuffer(this);
buf.append(op);
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HSQLDictionary.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HSQLDictionary.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HSQLDictionary.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HSQLDictionary.java Fri Jul 28 16:48:13 2006
@@ -189,9 +189,10 @@
return buf.toString();
}
- public SQLBuffer toOperation(String op, SQLBuffer selects, SQLBuffer from,
- SQLBuffer where, SQLBuffer group, SQLBuffer having, SQLBuffer order,
- boolean distinct, boolean forUpdate, long start, long end) {
+ protected SQLBuffer toOperation(String op, SQLBuffer selects,
+ SQLBuffer from, SQLBuffer where, SQLBuffer group, SQLBuffer having,
+ SQLBuffer order, boolean distinct, boolean forUpdate, long start,
+ long end) {
// hsql requires ordering when limit is used
if ((start != 0 || end != Long.MAX_VALUE)
&& (order == null || order.isEmpty()))
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/LogicalUnion.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/LogicalUnion.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/LogicalUnion.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/LogicalUnion.java Fri Jul 28 16:48:13 2006
@@ -25,7 +25,6 @@
import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
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;
@@ -555,19 +554,18 @@
}
public void select(ClassMapping mapping, int subclasses,
- JDBCStore store, JDBCFetchState fetchState, int eager) {
- select(mapping, subclasses, store, fetchState, eager, null, false);
+ JDBCStore store, JDBCFetchConfiguration fetch, int eager) {
+ select(mapping, subclasses, store, fetch, eager, null, false);
}
public void select(ClassMapping mapping, int subclasses,
- JDBCStore store, JDBCFetchState fetchState, int eager,
+ JDBCStore store, JDBCFetchConfiguration fetch, int eager,
Joins joins) {
- select(mapping, subclasses, store, fetchState, eager, joins,
- false);
+ select(mapping, subclasses, store, fetch, eager, joins, false);
}
private void select(ClassMapping mapping, int subclasses,
- JDBCStore store, JDBCFetchState fetchState, int eager,
+ JDBCStore store, JDBCFetchConfiguration fetch, int eager,
Joins joins, boolean identifier) {
// if this is the first (primary) mapping selected for this
// SELECT, record it so we can figure out what the result type is
@@ -575,7 +573,7 @@
if (mappings[pos] == null)
mappings[pos] = mapping;
- sel.select(this, mapping, subclasses, store, fetchState, eager,
+ sel.select(this, mapping, subclasses, store, fetch, eager,
joins, identifier);
}
@@ -596,14 +594,14 @@
}
public void selectIdentifier(ClassMapping mapping, int subclasses,
- JDBCStore store, JDBCFetchState fetchState, int eager) {
- select(mapping, subclasses, store, fetchState, eager, null, true);
+ JDBCStore store, JDBCFetchConfiguration fetch, int eager) {
+ select(mapping, subclasses, store, fetch, eager, null, true);
}
public void selectIdentifier(ClassMapping mapping, int subclasses,
- JDBCStore store, JDBCFetchState fetchState, int eager,
+ JDBCStore store, JDBCFetchConfiguration fetch, int eager,
Joins joins) {
- select(mapping, subclasses, store, fetchState, eager, joins, true);
+ select(mapping, subclasses, store, fetch, eager, joins, true);
}
public int selectPrimaryKey(ClassMapping mapping) {
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MergedResult.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MergedResult.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MergedResult.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MergedResult.java Fri Jul 28 16:48:13 2006
@@ -32,7 +32,7 @@
import java.util.Locale;
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;
@@ -213,15 +213,15 @@
}
public Object load(ClassMapping mapping, JDBCStore store,
- JDBCFetchState fetchState)
+ JDBCFetchConfiguration fetch)
throws SQLException {
- return _res[_idx].load(mapping, store, fetchState);
+ return _res[_idx].load(mapping, store, fetch);
}
public Object load(ClassMapping mapping, JDBCStore store,
- JDBCFetchState fetchState, Joins joins)
+ JDBCFetchConfiguration fetch, Joins joins)
throws SQLException {
- return _res[_idx].load(mapping, store, fetchState, joins);
+ return _res[_idx].load(mapping, store, fetch, joins);
}
public Array getArray(Object obj)
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Result.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Result.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Result.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Result.java Fri Jul 28 16:48:13 2006
@@ -31,7 +31,7 @@
import java.util.Locale;
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;
@@ -167,14 +167,14 @@
* Load a pc object using the given store manager.
*/
public Object load(ClassMapping mapping, JDBCStore store,
- JDBCFetchState fetchState)
+ JDBCFetchConfiguration fetch)
throws SQLException;
/**
* Load a pc object using the given store manager.
*/
public Object load(ClassMapping mapping, JDBCStore store,
- JDBCFetchState fetchState, Joins joins)
+ JDBCFetchConfiguration fetch, Joins joins)
throws SQLException;
/**
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Select.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Select.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Select.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Select.java Fri Jul 28 16:48:13 2006
@@ -19,7 +19,7 @@
import java.util.Iterator;
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.ClassMapping;
import org.apache.openjpa.jdbc.meta.FieldMapping;
@@ -322,7 +322,7 @@
* case the given mapping batches other selects.
*/
public void select(ClassMapping mapping, int subclasses,
- JDBCStore store, JDBCFetchState fetchState, int eager);
+ JDBCStore store, JDBCFetchConfiguration fetch, int eager);
/**
* Select the columns of the given mapping, possibly including subclasses.
@@ -330,7 +330,7 @@
* case the given mapping batches other selects.
*/
public void select(ClassMapping mapping, int subclasses,
- JDBCStore store, JDBCFetchState fetchState, int eager,
+ JDBCStore store, JDBCFetchConfiguration fetch, int eager,
Joins joins);
/**
@@ -383,7 +383,7 @@
* not using an LRSSize setting of <code>count</code>.
*/
public void selectIdentifier(ClassMapping mapping, int subclasses,
- JDBCStore store, JDBCFetchState fetchState, int eager);
+ JDBCStore store, JDBCFetchConfiguration fetch, int eager);
/**
* Select the columns of the given mapping, possibly including subclasses.
@@ -395,7 +395,7 @@
* not using an LRSSize setting of <code>count</code>.
*/
public void selectIdentifier(ClassMapping mapping, int subclasses,
- JDBCStore store, JDBCFetchState fetchState, int eager,
+ JDBCStore store, JDBCFetchConfiguration fetch, int eager,
Joins joins);
/**
Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java Fri Jul 28 16:48:13 2006
@@ -38,7 +38,6 @@
import org.apache.commons.collections.iterators.EmptyIterator;
import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchState;
import org.apache.openjpa.jdbc.kernel.JDBCLockManager;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.kernel.JDBCStoreManager;
@@ -699,22 +698,21 @@
}
public void select(ClassMapping mapping, int subclasses,
- JDBCStore store, JDBCFetchState fetchState, int eager) {
- select(mapping, subclasses, store, fetchState, eager, null);
+ JDBCStore store, JDBCFetchConfiguration fetch, int eager) {
+ select(mapping, subclasses, store, fetch, eager, null);
}
public void select(ClassMapping mapping, int subclasses,
- JDBCStore store, JDBCFetchState fetchState, int eager,
+ JDBCStore store, JDBCFetchConfiguration fetch, int eager,
Joins joins) {
- select(this, mapping, subclasses, store, fetchState, eager, joins,
- false);
+ select(this, mapping, subclasses, store, fetch, eager, joins, false);
}
/**
* Select the given mapping.
*/
void select(Select wrapper, ClassMapping mapping, int subclasses,
- JDBCStore store, JDBCFetchState fetchState, int eager,
+ JDBCStore store, JDBCFetchConfiguration fetch, int eager,
Joins joins, boolean ident) {
// note that this is one case where we don't want to use the result
// of getJoins(); just use the given joins, which will either be clean
@@ -744,7 +742,7 @@
// delegate to store manager to select in same order it loads result
((JDBCStoreManager) store).select(wrapper, mapping, subclasses, null,
- null, fetchState, eager, ident);
+ null, fetch, eager, ident);
// reset
if (hasJoins)
@@ -777,15 +775,14 @@
}
public void selectIdentifier(ClassMapping mapping, int subclasses,
- JDBCStore store, JDBCFetchState fetchState, int eager) {
- selectIdentifier(mapping, subclasses, store, fetchState, eager, null);
+ JDBCStore store, JDBCFetchConfiguration fetch, int eager) {
+ selectIdentifier(mapping, subclasses, store, fetch, eager, null);
}
public void selectIdentifier(ClassMapping mapping, int subclasses,
- JDBCStore store, JDBCFetchState fetchState, int eager,
+ JDBCStore store, JDBCFetchConfiguration fetch, int eager,
Joins joins) {
- select(this, mapping, subclasses, store, fetchState, eager, joins,
- true);
+ select(this, mapping, subclasses, store, fetch, eager, joins, true);
}
public int selectPrimaryKey(ClassMapping mapping) {
@@ -2055,7 +2052,7 @@
}
public Object load(ClassMapping mapping, JDBCStore store,
- JDBCFetchState fetchState, Joins joins)
+ JDBCFetchConfiguration fetch, Joins joins)
throws SQLException {
boolean hasJoins = joins != null
&& ((PathJoins) joins).path() != null;
@@ -2065,7 +2062,7 @@
_preJoins.push(joins);
}
- Object obj = super.load(mapping, store, fetchState, joins);
+ Object obj = super.load(mapping, store, fetch, joins);
// reset
if (hasJoins)
Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreManager.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreManager.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreManager.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreManager.java Fri Jul 28 16:48:13 2006
@@ -26,7 +26,6 @@
import org.apache.openjpa.conf.OpenJPAConfigurationImpl;
import org.apache.openjpa.kernel.FetchConfiguration;
import org.apache.openjpa.kernel.FetchConfigurationImpl;
-import org.apache.openjpa.kernel.FetchState;
import org.apache.openjpa.kernel.OpenJPAStateManager;
import org.apache.openjpa.kernel.PCState;
import org.apache.openjpa.kernel.Seq;
@@ -211,7 +210,7 @@
* data into the object.
*/
public abstract boolean initialize(OpenJPAStateManager sm, PCState state,
- FetchState fetchState, Object context);
+ FetchConfiguration fetch, Object context);
/**
* This method is invoked when OpenJPA needs to load additional data
@@ -223,7 +222,7 @@
* data into the object.
*/
public abstract boolean load(OpenJPAStateManager sm, BitSet fields,
- FetchState fetchState, int lockLevel, Object context);
+ FetchConfiguration fetch, int lockLevel, Object context);
/**
* This implementation just delegates to the proper singular
@@ -364,7 +363,8 @@
* The implementation of the result provider will typically execute
* some sort of data store query to find all the applicable objects, loop
* through the returned data, extracting object IDs from the data, and
- * invoking {@link StoreContext#find(Object,FetchState,BitSet,Object,int)}
+ * invoking
+ * {@link StoreContext#find(Object,FetchConfiguration,BitSet,Object,int)}
* on each OID. When invoking this method, the first argument is the OID.
* The second is the given fetch configuration. The
* third argument is a mask of fields to exclude from loading; it will
Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java Fri Jul 28 16:48:13 2006
@@ -42,7 +42,7 @@
import org.apache.openjpa.meta.MetaDataRepository;
import org.apache.openjpa.util.ClassResolver;
import org.apache.openjpa.util.ProxyManager;
-import org.apache.openjpa.conf.StoreFacadeTypeRegistry;
+import org.apache.openjpa.util.StoreFacadeTypeRegistry;
/**
* Defines the properties necessary to configure runtime properties and
Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java Fri Jul 28 16:48:13 2006
@@ -54,7 +54,7 @@
import org.apache.openjpa.util.ClassResolver;
import org.apache.openjpa.util.ImplHelper;
import org.apache.openjpa.util.ProxyManager;
-import org.apache.openjpa.conf.StoreFacadeTypeRegistry;
+import org.apache.openjpa.util.StoreFacadeTypeRegistry;
/**
* Implementation of the {@link OpenJPAConfiguration} interface.
Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheStoreManager.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheStoreManager.java?rev=426710&r1=426709&r2=426710&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheStoreManager.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheStoreManager.java Fri Jul 28 16:48:13 2006
@@ -29,7 +29,6 @@
import org.apache.openjpa.enhance.PCDataGenerator;
import org.apache.openjpa.kernel.DelegatingStoreManager;
import org.apache.openjpa.kernel.FetchConfiguration;
-import org.apache.openjpa.kernel.FetchState;
import org.apache.openjpa.kernel.LockLevels;
import org.apache.openjpa.kernel.OpenJPAStateManager;
import org.apache.openjpa.kernel.PCState;
@@ -316,25 +315,22 @@
}
public boolean initialize(OpenJPAStateManager sm, PCState state,
- FetchState fetchState, Object edata) {
+ FetchConfiguration fetch, Object edata) {
DataCache cache = sm.getMetaData().getDataCache();
if (cache == null || sm.isEmbedded())
- return super.initialize(sm, state, fetchState, edata);
+ return super.initialize(sm, state, fetch, edata);
DataCachePCData data = cache.get(sm.getObjectId());
- FetchConfiguration fetch = (fetchState == null)
- ? _ctx.getFetchConfiguration()
- : fetchState.getFetchConfiguration();
if (data != null && !isLocking(fetch)) {
//### the 'data.type' access here probably needs to be
//### addressed for bug 511
sm.initialize(data.getType(), state);
- data.load(sm, fetchState, edata);
+ data.load(sm, fetch, edata);
return true;
}
// initialize from store manager
- if (!super.initialize(sm, state, fetchState, edata))
+ if (!super.initialize(sm, state, fetch, edata))
return false;
if (!_ctx.getPopulateDataCache())
return true;
@@ -361,25 +357,21 @@
}
public boolean load(OpenJPAStateManager sm, BitSet fields,
- FetchState fetchState, int lockLevel, Object edata) {
- FetchConfiguration fetch = (fetchState == null)
- ? _ctx.getFetchConfiguration()
- : fetchState.getFetchConfiguration();
+ FetchConfiguration fetch, int lockLevel, Object edata) {
DataCache cache = sm.getMetaData().getDataCache();
if (cache == null || sm.isEmbedded())
- return super.load(sm, fields, fetchState, lockLevel, edata);
+ return super.load(sm, fields, fetch, lockLevel, edata);
DataCachePCData data = cache.get(sm.getObjectId());
if (lockLevel == LockLevels.LOCK_NONE && !isLocking(fetch)
&& data != null)
- data.load(sm, fields, fetchState, edata);
+ data.load(sm, fields, fetch, edata);
if (fields.length() == 0)
return true;
// load from store manager; clone the set of still-unloaded fields
// so that if the store manager decides to modify it it won't affect us
- if (!super.load(sm, (BitSet) fields.clone(), fetchState,
- lockLevel, edata))
+ if (!super.load(sm, (BitSet) fields.clone(), fetch, lockLevel, edata))
return false;
if (!_ctx.getPopulateDataCache())
return true;
@@ -432,7 +424,7 @@
//### the 'data.type' access here probably needs
//### to be addressed for bug 511
sm.initialize(data.getType(), state);
- data.load(sm, fetch.newFetchState(), edata);
+ data.load(sm, fetch, edata);
} else
unloaded = addUnloaded(sm, null, unloaded);
} else if (load != FORCE_LOAD_NONE
@@ -440,9 +432,8 @@
data = cache.get(sm.getObjectId());
if (data != null) {
// load unloaded fields
- FetchState fetchState = fetch.newFetchState();
- fields = sm.getUnloaded(fetchState);
- data.load(sm, fields, fetchState, edata);
+ fields = sm.getUnloaded(fetch);
+ data.load(sm, fields, fetch, edata);
if (fields.length() > 0)
unloaded = addUnloaded(sm, fields, unloaded);
} else