diff options
4 files changed, 13 insertions, 6 deletions
diff --git a/src/main/java/com/amazon/carbonado/Sequence.java b/src/main/java/com/amazon/carbonado/Sequence.java index a810e39..ada2ace 100644 --- a/src/main/java/com/amazon/carbonado/Sequence.java +++ b/src/main/java/com/amazon/carbonado/Sequence.java @@ -21,10 +21,10 @@ package com.amazon.carbonado; import java.lang.annotation.*;
/**
- * Identifies a {@link Storable} property capable of selecting its own value
- * on insert, by a named sequence. Sequences are supported at the storage
- * layer, and implementions that do not support sequences ignore this
- * annotation.
+ * Identifies a {@link Storable} property capable of selecting its own value on
+ * insert, by a named sequence. Support for sequences is repository dependent,
+ * and if not supported, a {@link PersistException} is thrown when trying to
+ * insert. Explicitly specifying a value bypasses the sequence altogether.
*
* <p>Example:<pre>
* @PrimaryKey("userInfoID")
@@ -38,6 +38,7 @@ import java.lang.annotation.*; * </pre>
*
* @author Brian S O'Neill
+ * @see Automatic
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
diff --git a/src/main/java/com/amazon/carbonado/spi/LobEngineTrigger.java b/src/main/java/com/amazon/carbonado/spi/LobEngineTrigger.java index 2e42d8e..4b5ac5f 100644 --- a/src/main/java/com/amazon/carbonado/spi/LobEngineTrigger.java +++ b/src/main/java/com/amazon/carbonado/spi/LobEngineTrigger.java @@ -70,7 +70,9 @@ class LobEngineTrigger<S extends Storable> extends Trigger<S> { }
public void afterInsert(S storable, Object state) throws PersistException {
- // Save user lob value contents into new lobs.
+ // Save user lob value contents into new lobs. This is done after the
+ // insert of the enclosing record to avoid an expensive rollback if a
+ // constraint violation is detected.
Object[] userLobs = (Object[]) state;
int length = mLobProperties.length;
for (int i=0; i<length; i++) {
diff --git a/src/main/java/com/amazon/carbonado/spi/MasterFeature.java b/src/main/java/com/amazon/carbonado/spi/MasterFeature.java index f1d68f7..1ec1fc3 100644 --- a/src/main/java/com/amazon/carbonado/spi/MasterFeature.java +++ b/src/main/java/com/amazon/carbonado/spi/MasterFeature.java @@ -39,7 +39,10 @@ public enum MasterFeature { /** Insert operation applies any sequences to unset properties */
INSERT_SEQUENCES,
- /** Insert operation checks that all required data properties have been set */
+ /**
+ * Insert operation checks that all required data properties have been set,
+ * excluding automatic properties and version property.
+ */
INSERT_CHECK_REQUIRED,
/** Ensure insert operation always is in a transaction */
diff --git a/src/main/java/com/amazon/carbonado/spi/StoredSequence.java b/src/main/java/com/amazon/carbonado/spi/StoredSequence.java index 97f18ab..023bca5 100644 --- a/src/main/java/com/amazon/carbonado/spi/StoredSequence.java +++ b/src/main/java/com/amazon/carbonado/spi/StoredSequence.java @@ -28,6 +28,7 @@ import com.amazon.carbonado.Storable; * Stores data for {@link SequenceValueGenerator}.
*
* @author Brian S O'Neill
+ * @deprecated Replaced by {@link com.amazon.carbonado.sequence.StoredSequence}
*/
@PrimaryKey("name")
@Authoritative
|