Always use an explicit query if we aren't using a cache.
This commit is contained in:
@@ -148,7 +148,8 @@ public abstract class DepotRepository
|
|||||||
throws PersistenceException
|
throws PersistenceException
|
||||||
{
|
{
|
||||||
DepotMarshaller<T> marsh = _ctx.getMarshaller(type);
|
DepotMarshaller<T> marsh = _ctx.getMarshaller(type);
|
||||||
boolean useExplicit = (marsh.getTableName() == null) || !marsh.hasPrimaryKey();
|
boolean useExplicit =
|
||||||
|
(marsh.getTableName() == null) || !marsh.hasPrimaryKey() || !_ctx.isUsingCache();
|
||||||
|
|
||||||
// TODO: This is a very conservative approach where all complicated queries are handled
|
// TODO: This is a very conservative approach where all complicated queries are handled
|
||||||
// TODO: with the traditional single-pass query. The double pass algorithm can handle a
|
// TODO: with the traditional single-pass query. The double pass algorithm can handle a
|
||||||
|
|||||||
@@ -264,6 +264,14 @@ public class PersistenceContext
|
|||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if there is a {@link CacheAdapter} configured, false otherwise.
|
||||||
|
*/
|
||||||
|
public boolean isUsingCache ()
|
||||||
|
{
|
||||||
|
return _cache != null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Looks up an entry in the cache by the given key.
|
* Looks up an entry in the cache by the given key.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user