From df422c9673316b6a7ecdb96e314aeabd660985ad Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Fri, 29 Jun 2007 05:03:09 +0000 Subject: Fixed IllegalArgumentException with optimized join queries of the form "a.b = ? & (a.c = ? | a.d = ?)". --- .../amazon/carbonado/repo/jdbc/JDBCSupport.java | 3 +++ .../carbonado/repo/sleepycat/BDBStorage.java | 26 +++++++++++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/repo') diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCSupport.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCSupport.java index 304c816..7c212cc 100644 --- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCSupport.java +++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCSupport.java @@ -34,6 +34,9 @@ import com.amazon.carbonado.gen.MasterSupport; public interface JDBCSupport extends MasterSupport { public JDBCRepository getJDBCRepository(); + // FIXME: Lob convert methods need to take Storable and property name. With + // this, the optional Lob adapting trigger must be invoked. + /** * @param loader used to reload Blob outside original transaction */ diff --git a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBStorage.java b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBStorage.java index c2d1844..03874aa 100644 --- a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBStorage.java +++ b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBStorage.java @@ -684,9 +684,14 @@ abstract class BDBStorage implements Storage, Storag return database; } - Blob getBlob(long locator) throws FetchException { + Blob getBlob(S storable, String name, long locator) throws FetchException { try { - return mRepository.getLobEngine().getBlobValue(locator); + Blob blob = mRepository.getLobEngine().getBlobValue(locator); + Trigger trigger = mTriggerManager.getAdaptLobTrigger(); + if (trigger != null) { + blob = trigger.adaptBlob(storable, name, blob); + } + return blob; } catch (RepositoryException e) { throw e.toFetchException(); } @@ -702,9 +707,14 @@ abstract class BDBStorage implements Storage, Storag } } - Clob getClob(long locator) throws FetchException { + Clob getClob(S storable, String name, long locator) throws FetchException { try { - return mRepository.getLobEngine().getClobValue(locator); + Clob clob = mRepository.getLobEngine().getClobValue(locator); + Trigger trigger = mTriggerManager.getAdaptLobTrigger(); + if (trigger != null) { + clob = trigger.adaptClob(storable, name, clob); + } + return clob; } catch (RepositoryException e) { throw e.toFetchException(); } @@ -1075,16 +1085,16 @@ abstract class BDBStorage implements Storage, Storag } } - public Blob getBlob(long locator) throws FetchException { - return mStorage.getBlob(locator); + public Blob getBlob(S storable, String name, long locator) throws FetchException { + return mStorage.getBlob(storable, name, locator); } public long getLocator(Blob blob) throws PersistException { return mStorage.getLocator(blob); } - public Clob getClob(long locator) throws FetchException { - return mStorage.getClob(locator); + public Clob getClob(S storable, String name, long locator) throws FetchException { + return mStorage.getClob(storable, name, locator); } public long getLocator(Clob clob) throws PersistException { -- cgit v1.2.3