diff options
| author | Brian S. O'Neill <bronee@gmail.com> | 2007-06-29 05:03:09 +0000 | 
|---|---|---|
| committer | Brian S. O'Neill <bronee@gmail.com> | 2007-06-29 05:03:09 +0000 | 
| commit | df422c9673316b6a7ecdb96e314aeabd660985ad (patch) | |
| tree | bf12ddea3ddb19c08064cbf95ff3781050f3c101 /src/main/java/com/amazon/carbonado/raw | |
| parent | 214be70045e4dde7b15aac6e33d764163dec0762 (diff) | |
Fixed IllegalArgumentException with optimized join queries of the form "a.b = ? & (a.c = ? | a.d = ?)".
Diffstat (limited to 'src/main/java/com/amazon/carbonado/raw')
| -rw-r--r-- | src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java | 12 | ||||
| -rw-r--r-- | src/main/java/com/amazon/carbonado/raw/RawSupport.java | 12 | 
2 files changed, 19 insertions, 5 deletions
diff --git a/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java b/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java index d741c08..4c295dd 100644 --- a/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java +++ b/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java @@ -1462,8 +1462,8 @@ public class GenericEncodingStrategy<S extends Storable> {      /**
       * Generates code to get a Lob from a locator from RawSupport. RawSupport
 -     * instance and long locator must be on the stack. Result is a Lob on the
 -     * stack, which may be null.
 +     * instance, Storable instance, property name and long locator must be on
 +     * the stack. Result is a Lob on the stack, which may be null.
       */
      private void getLobFromLocator(CodeAssembler a, StorablePropertyInfo info) {
          if (!info.isLob()) {
 @@ -1481,7 +1481,8 @@ public class GenericEncodingStrategy<S extends Storable> {          }
          a.invokeInterface(TypeDesc.forClass(RawSupport.class), name,
 -                          type, new TypeDesc[] {TypeDesc.LONG});
 +                          type, new TypeDesc[] {TypeDesc.forClass(Storable.class),
 +                                                TypeDesc.STRING, TypeDesc.LONG});
      }
      /////////////////////////////////////////////////////////////////////////////////
 @@ -1601,6 +1602,11 @@ public class GenericEncodingStrategy<S extends Storable> {              if (info.isLob()) {
                  // Need RawSupport instance for getting Lob from locator.
                  pushRawSupport(a, instanceVar);
 +
 +                // Also need to pass this stuff along when getting Lob.
 +                a.loadThis();
 +                a.loadConstant(info.getPropertyName());
 +
                  // Locator is encoded as a long.
                  storageType = TypeDesc.LONG;
              }
 diff --git a/src/main/java/com/amazon/carbonado/raw/RawSupport.java b/src/main/java/com/amazon/carbonado/raw/RawSupport.java index 63577d7..b83e548 100644 --- a/src/main/java/com/amazon/carbonado/raw/RawSupport.java +++ b/src/main/java/com/amazon/carbonado/raw/RawSupport.java @@ -73,8 +73,12 @@ public interface RawSupport<S extends Storable> extends MasterSupport<S> {      /**
       * Returns the Blob for the given locator, returning null if not found.
 +     *
 +     * @param storable storable that contains Blob
 +     * @param name name of Blob property
 +     * @param locator Blob locator
       */
 -    Blob getBlob(long locator) throws FetchException;
 +    Blob getBlob(S storable, String name, long locator) throws FetchException;
      /**
       * Returns the locator for the given Blob, returning zero if null.
 @@ -85,8 +89,12 @@ public interface RawSupport<S extends Storable> extends MasterSupport<S> {      /**
       * Returns the Clob for the given locator, returning null if not found.
 +     *
 +     * @param storable storable that contains Blob
 +     * @param name name of Clob property
 +     * @param locator Clob locator
       */
 -    Clob getClob(long locator) throws FetchException;
 +    Clob getClob(S storable, String name, long locator) throws FetchException;
      /**
       * Returns the locator for the given Clob, returning zero if null.
  | 
