getProperties();
-
+
/**
*
- * @return a {@link ShardingKey.Builder} for this {@link Session}
- * @throws IllegalStateException if this Session is not active
+ * @return a {@link ShardingKey.Builder} for this {@code Session}
+ * @throws IllegalStateException if this Session is not open
*/
public ShardingKey.Builder shardingKeyBuilder();
/**
- * Provide a method that this {@link Session} will call to control the rate
- * of {@link Operation} submission. This {@link Session} will call
- * {@code request} with a positive argument when the {@link Session} is
- * able to accept more {@link Operation} submissions. The difference between
- * the sum of all arguments passed to {@code request} and the number of
+ * Provide a method that this {@code Session} will call to control the rate of
+ * {@link Operation} submission. This {@code Session} will call
+ * {@code request} with a positive argument when the {@code Session} is able
+ * to accept more {@link Operation} submissions. The difference between the
+ * sum of all arguments passed to {@code request} and the number of
* {@link Operation}s submitted after this method is called is the
* demand. The demand must always be non-negative. If an
* {@link Operation} is submitted that would make the demand negative the call
* to {@link Operation#submit} throws {@link IllegalStateException}. Prior to
- * a call to {@code requestHook}, the demand is defined to be infinite.
- * After a call to {@code requestHook}, the demand is defined to be
- * zero and is subsequently computed as described previously.
- * {@link Operation}s submitted prior to the call to {@code requestHook} do
- * not affect the demand.
+ * a call to {@code requestHook}, the demand is defined to be infinite. After
+ * a call to {@code requestHook}, the demand is defined to be zero and is
+ * subsequently computed as described previously. {@link Operation}s submitted
+ * prior to the call to {@code requestHook} do not affect the demand.
*
* @param request accepts calls to increase the demand. Not null.
- * @return this {@link Session}
+ * @return this {@code Session}
* @throws IllegalStateException if this method has been called previously or
- * this {@link Session} is not active.
+ * this {@code Session} is not open.
*/
public Session requestHook(LongConsumer request);
- /**
- * Make this {@link Session} ready for use. A newly created
- * {@link Session} is active. Calling this method on a {@link Session}
- * that is active is a no-op. If the lifecycle is {@link Lifecycle#INACTIVE}
- * -> {@link Lifecycle#OPEN}. If the lifecycle is
- * {@link Lifecycle#NEW_INACTIVE} -> {@link Lifecycle#NEW}.
- *
- * @return this {@link Session}
- * @throws IllegalStateException if this {@link Session} is closed.
- */
- public Session activate();
-
- /**
- * Makes this {@link Session} inactive. After a call to this method
- * previously submitted Operations will be executed normally. If the lifecycle
- * is {@link Lifecycle#NEW} -> {@link Lifecycle#NEW_INACTIVE}. if the
- * lifecycle is {@link Lifecycle#OPEN} -> {@link Lifecycle#INACTIVE}. If
- * the lifecycle is {@link Lifecycle#INACTIVE} or
- * {@link Lifecycle#NEW_INACTIVE} this method is a no-op. After calling this
- * method or calling any method other than {@link deactivate}, {@link activate},
- * {@link abort}, or {@link getSessionLifecycle} will throw
- * {@link IllegalStateException}. Data source state not specified
- * by {@link Session.Builder} may not be preserved.
- *
- *
- * In general {@link Session}s should not be pooled as the implementation
- * should cache and reuse the data source resources that back {@link Session}s
- * as appropriate, not cache the {@link Session}s themselves.
- * However, any {@link Session} pool is required by default to
- * call {@code deactivate} when putting a {@link Session} into the pool. The
- * pool is required by default to call {@code activate} when removing a
- * {@link Session} from the pool for use. A pool may have an optional mode where
- * it does not call {@code deactivate}/{@code activate} as required above. The
- * behavior of the pool and {@link Session}s cached in the pool in such a
- * mode is entirely implementation dependent.
- *
- * @return this {@link Session}
- * @throws IllegalStateException if this {@link Session} is closed
- */
- public Session deactivate();
-
}
diff -r 4f7713e6a308 -r c9cbac2979fb src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/SessionProperty.java
--- a/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/SessionProperty.java Thu Jul 12 15:23:13 2018 -0400
+++ b/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/SessionProperty.java Sat Oct 20 08:17:38 2018 -0400
@@ -22,41 +22,43 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+package jdk.incubator.sql2;
-package jdk.incubator.sql2;
+import java.io.Serializable;
/**
* An attribute of a {@link Session} that can be configured to influence its
- * behavior. Implementors of this interface define the properties of
- * {@link Session}s. The {@link Session.Builder#property} method is used to set the values
- * of {@link Session} properties.
- *
+ * behavior. implementers of this interface define the properties of
+ * {@link Session}s. The {@link Session.Builder#property} method is used to set
+ * the values of {@link Session} properties.
+ *
* Implementations must be thread safe.
- *
+ *
*/
-public interface SessionProperty {
+public interface SessionProperty extends Serializable {
/**
- * Return the name of this {@link SessionProperty}.
- *
- * @return the name of this {@link SessionProperty}
+ * Return the name of this {@code SessionProperty}.
+ *
+ * @return the name of this {@code SessionProperty}
*/
public String name();
/**
- * Return the type of the value of this {@link SessionProperty}. Any value
- * set for this property must be assignable to this type.
+ * Return the type of the value of this {@code SessionProperty}. Any value set
+ * for this property must be assignable to this type.
*
- * @return the type of the values of this {@link SessionProperty}
+ * @return the type of the values of this {@code SessionProperty}
*/
public Class> range();
/**
- * Determine whether a value is valid for this {@link SessionProperty}. Returns
- * {@code true} if {@code value} is valid and {@code false} otherwise.
- *
- * @param value a value for this {@link SessionProperty}
- * @return {@code true} iff {@code value} is valid for this {@link SessionProperty}
+ * Determine whether a value is valid for this {@code SessionProperty}.
+ * Returns {@code true} if {@code value} is valid and {@code false} otherwise.
+ *
+ * @param value a value for this {@code SessionProperty}
+ * @return {@code true} iff {@code value} is valid for this
+ * {@code SessionProperty}
*/
public default boolean validate(Object value) {
return (value == null && this.range() == Void.class) || this.range().isInstance(value);
@@ -65,15 +67,15 @@
/**
* Return the value for this property to use if no other value is set. For
* this to have any meaning for a user defined property the property must be
- * registered with the {@link DataSource} by calling
- * {@link DataSource.Builder#registerSessionProperty}.
+ * registered with the {@link DataSource} by calling
+ * {@link DataSource.Builder#registerSessionProperty}.
*
* @return the default value or {@code null} if there is no default value
*/
public Object defaultValue();
/**
- * Returns true if this {@link SessionProperty} contains sensitive information
+ * Returns true if this {@code SessionProperty} contains sensitive information
* such as a password or encryption key.
*
* @return true iff this is sensitive
@@ -85,15 +87,16 @@
* {@link Session} to have the specified property value. Returns {@code true}
* if any {@link Operation}s were submitted. {@code false} otherwise.
*
- * Called by {@link Session.Builder#build()} to configure a {@link Session} as
- * specified in the {@link Session.Builder#property} method. SessionProperties
- * known to the implementation may return {@code false} and rely on the
- * implementation to do the right thing.
+ * Potentially called when an attach {@link Operation} is executed to
+ * configure a {@link Session} as specified in the
+ * {@link Session.Builder#property} method. SessionProperties known to the
+ * implementation may return {@code false} and rely on the implementation to
+ * do the right thing.
*
* @param group an {@link OperationGroup} which will be the container of the
* submitted {@link Operation}s, if any
- * @param value the value to which the property is to be set. May be null if
- * {@link range()} is {@link Void}.
+ * @param value the value to which the property is to be set. May be
+ * {@code null} if {@link range()} is {@link Void}.
* @return true if any {@link Operation}s were submitted, false otherwise
* @throws IllegalStateException if it is not possible to configure the
* {@link Session} as specified.
diff -r 4f7713e6a308 -r c9cbac2979fb src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/ShardingKey.java
--- a/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/ShardingKey.java Thu Jul 12 15:23:13 2018 -0400
+++ b/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/ShardingKey.java Sat Oct 20 08:17:38 2018 -0400
@@ -25,13 +25,13 @@
package jdk.incubator.sql2;
/**
- * Interface used to indicate that this object represents a Sharding Key. A
- * {@link ShardingKey} instance is only guaranteed to be compatible with the
- * data source instance that it was derived from. A {@link ShardingKey} is
+ * Interface used to indicate that this object represents a sharding key. A
+ * {@code ShardingKey} instance is only guaranteed to be compatible with the
+ * data source instance that it was derived from. A {@code ShardingKey} is
* created using {@link Builder}.
*
* The following example illustrates the use of {@link Builder} to create a
- * {@link ShardingKey}:
+ * {@code ShardingKey}:
*
* {@code
*
@@ -44,11 +44,11 @@
*
*
*
- * A {@link ShardingKey} is used for specifying a
+ * A {@code ShardingKey} is used for specifying a
* {@link AdbaSessionProperty#SHARDING_KEY} or a
* {@link AdbaSessionProperty#SHARDING_GROUP_KEY}. Databases that support
- * composite Sharding may use a * to specify a additional level of partitioning
- * within to specify a additional level of partitioning within the Shard.
+ * composite sharding may use a * to specify a additional level of partitioning
+ * within to specify a additional level of partitioning within the shard.
*
* The following example illustrates the use of {@link Builder} to create a
* {@link AdbaSessionProperty#SHARDING_GROUP_KEY} for an eastern region with
@@ -59,10 +59,10 @@
*
* DataSource ds = new MyDataSource();
* ShardingKey superShardingKey = ds.shardingKeyBuilder()
- * .subkey("EASTERN_REGION", JDBCType.VARCHAR)
+ * .subkey("EASTERN_REGION", AdbaType.VARCHAR)
* .build();
* ShardingKey shardingKey = ds.shardingKeyBuilder()
- * .subkey("PITTSBURGH_BRANCH", JDBCType.VARCHAR)
+ * .subkey("PITTSBURGH_BRANCH", AdbaType.VARCHAR)
* .build();
* Session con = ds.builder()
* .property(SHARDING_GROUP_KEY, superShardingKey)
@@ -75,11 +75,11 @@
/**
* A builder created from a {@link DataSource} or object, used to create a
- * {@link ShardingKey} with sub-keys of supported data types. Implementations
+ * {@code ShardingKey} with sub-keys of supported data types. Implementations
* must support JDBCType.VARCHAR and may also support additional data types.
*
- * The following example illustrates the use of {@link Builder} to create a
- * {@link ShardingKey}:
+ * The following example illustrates the use of {@code Builder} to create a
+ * {@code ShardingKey}:
*
* {@code
*
@@ -100,7 +100,7 @@
* Key.
*
* @param subkey contains the object that needs to be part of shard sub key
- * @param subkeyType sub-key data type of type java.sql.SQLType
+ * @param subkeyType sub-key data type of type {@link SqlType}
* @return this builder object
*/
public Builder subkey(Object subkey, SqlType subkeyType);
diff -r 4f7713e6a308 -r c9cbac2979fb src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/SqlBlob.java
--- a/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/SqlBlob.java Thu Jul 12 15:23:13 2018 -0400
+++ b/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/SqlBlob.java Sat Oct 20 08:17:38 2018 -0400
@@ -35,94 +35,97 @@
/**
* Return an {@link Operation} that will release the temporary resources
- * associated with this {@link SqlBlob}.
+ * associated with this {@code SqlBlob}.
*
* @return an {@link Operation} that will release the temporary resources
- * associated with this {@link SqlBlob}.
+ * associated with this {@code SqlBlob}.
*/
public Operation closeOperation();
+ /**
+ * {@inheritDoc}
+ */
@Override
public default void close() {
this.closeOperation().submit();
}
/**
- * Return a {@link Operation} that fetches the position of this {@link SqlBlob}.
+ * Return a {@link Operation} that fetches the position of this {@code SqlBlob}.
* The position is 1-based. Position 0 is immediately before the first byte in
- * the {@link SqlBlob}. Position 1 is the first byte in the {@link SqlBlob}, etc.
- * Position {@link length()} is the last byte in the {@link SqlBlob}.
+ * the {@code SqlBlob}. Position 1 is the first byte in the {@code SqlBlob}, etc.
+ * Position {@link length()} is the last byte in the {@code SqlBlob}.
*
* Position is between 0 and length + 1.
*
- * @return a {@link Operation} that returns the position of this {@link SqlBlob}
+ * @return a {@link Operation} that returns the position of this {@code SqlBlob}
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlBlob} is closed.
+ * {@code SqlBlob} is closed.
*/
public Operation getPositionOperation();
/**
- * Get the position of this {@link SqlBlob}. The position is 1-based. Position 0
- * is immediately before the first byte in the {@link SqlBlob}. Position 1 is the
- * first byte in the {@link SqlBlob}, etc. Position {@link length()} is the last
- * byte in the {@link SqlBlob}.
+ * Get the position of this {@code SqlBlob}. The position is 1-based. Position 0
+ * is immediately before the first byte in the {@code SqlBlob}. Position 1 is the
+ * first byte in the {@code SqlBlob}, etc. Position {@link length()} is the last
+ * byte in the {@code SqlBlob}.
*
* Position is between 0 and length + 1.
*
* ISSUE: Should position be 1-based as SQL seems to do or 0-based as Java
* does?
*
- * @return a future which value is the 1-based position of this {@link SqlBlob}
+ * @return a future which value is the 1-based position of this {@code SqlBlob}
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlBlob} is closed.
+ * {@code SqlBlob} is closed.
*/
public default CompletionStage getPosition() {
return getPositionOperation().submit().getCompletionStage();
}
/**
- * Return a {@link Operation} that fetches the length of this {@link SqlBlob}.
+ * Return a {@link Operation} that fetches the length of this {@code SqlBlob}.
*
- * @return a {@link Operation} that returns the length of this {@link SqlBlob}
+ * @return a {@link Operation} that returns the length of this {@code SqlBlob}
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlBlob} is closed.
+ * {@code SqlBlob} is closed.
*/
public Operation lengthOperation();
/**
- * Get the length of this {@link SqlBlob}.
+ * Get the length of this {@code SqlBlob}.
*
- * @return a future which value is the number of bytes in this {@link SqlBlob}
+ * @return a future which value is the number of bytes in this {@code SqlBlob}
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlBlob} is closed.
+ * {@code SqlBlob} is closed.
*/
public default CompletionStage length() {
return lengthOperation().submit().getCompletionStage();
}
/**
- * Return a {@link Operation} that sets the position of this {@link SqlBlob}. If
- * offset exceeds the length of this {@link SqlBlob} set position to the length +
- * 1 of this {@link SqlBlob}, ie one past the last byte.
+ * Return a {@link Operation} that sets the position of this {@code SqlBlob}. If
+ * offset exceeds the length of this {@code SqlBlob} set position to the length +
+ * 1 of this {@code SqlBlob}, ie one past the last byte.
*
* @param offset a non-negative number
- * @return a {@link Operation} that sets the position of this {@link SqlBlob}
+ * @return a {@link Operation} that sets the position of this {@code SqlBlob}
* @throws IllegalArgumentException if {@code offset} is less than 0
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlBlob} is closed.
+ * {@code SqlBlob} is closed.
*/
public Operation setPositionOperation(long offset);
/**
- * Set the position of this {@link SqlBlob}. If offset exceeds the length of this
- * {@link SqlBlob} set position to the length + 1 of this {@link SqlBlob}, ie one
+ * Set the position of this {@code SqlBlob}. If offset exceeds the length of this
+ * {@code SqlBlob} set position to the length + 1 of this {@code SqlBlob}, ie one
* past the last byte.
*
* @param offset the 1-based position to set
- * @return this {@link SqlBlob}
+ * @return this {@code SqlBlob}
* @throws IllegalArgumentException if offset is less than 0
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlBlob} is closed.
+ * {@code SqlBlob} is closed.
*/
public default SqlBlob setPosition(long offset) {
setPositionOperation(offset).submit();
@@ -134,14 +137,14 @@
* occurrence of the target after the position. If there is no such occurrence
* set the position to 0.
*
- * @param target a {@link SqlBlob} created by the same {@link Session}
+ * @param target a {@code SqlBlob} created by the same {@link Session}
* containing the byte sequence to search for
* @return a {@link Operation} that locates {@code target} in this
- * {@link SqlBlob}
+ * {@code SqlBlob}
* @throws IllegalArgumentException if {@code target} was created by some
* other {@link Session}
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlBlob} is closed.
+ * {@code SqlBlob} is closed.
*/
public Operation locateOperation(SqlBlob target);
@@ -150,11 +153,11 @@
* after the position. If there is no such occurrence set the position to 0.
*
* @param target the byte sequence to search for
- * @return this {@link SqlBlob}
+ * @return this {@code SqlBlob}
* @throws IllegalArgumentException if {@code target} was created by some
* other {@link Session}
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlBlob} is closed
+ * {@code SqlBlob} is closed
*/
public default SqlBlob locate(SqlBlob target) {
locateOperation(target).submit();
@@ -168,9 +171,9 @@
*
* @param target the byte sequence to search for. Not {@code null}. Captured.
* @return a {@link Operation} that locates {@code target} in this
- * {@link SqlBlob}
+ * {@code SqlBlob}
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlBlob} is closed.
+ * {@code SqlBlob} is closed.
*/
public Operation locateOperation(byte[] target);
@@ -179,9 +182,9 @@
* after the position. If there is no such occurrence set the position to 0.
*
* @param target the byte sequence to search for
- * @return this {@link SqlBlob}
+ * @return this {@code SqlBlob}
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlBlob} is closed.
+ * {@code SqlBlob} is closed.
*/
public default SqlBlob locate(byte[] target) {
locateOperation(target).submit();
@@ -189,25 +192,25 @@
}
/**
- * Return a {@link Operation} that truncates this {@link SqlBlob} so that the
- * current position is the end of the {@link SqlBlob}. If the position is N, then
+ * Return a {@link Operation} that truncates this {@code SqlBlob} so that the
+ * current position is the end of the {@code SqlBlob}. If the position is N, then
* after {@link trim()} the length is N - 1. The position is still N. This
* will fail if position is 0.
*
- * @return a {@link Operation} that trims the length of this {@link SqlBlob}
+ * @return a {@link Operation} that trims the length of this {@code SqlBlob}
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlBlob} is closed or position is 0.
+ * {@code SqlBlob} is closed or position is 0.
*/
public Operation trimOperation();
/**
- * Truncate this {@link SqlBlob} so that the current position is the end of the
- * {@link SqlBlob}. If the position is N, then after {@link trim()} the length is
+ * Truncate this {@code SqlBlob} so that the current position is the end of the
+ * {@code SqlBlob}. If the position is N, then after {@link trim()} the length is
* N - 1. The position is still N. This will fail if position is 0.
*
* @return this SqlBlob
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlBlob} is closed or position is 0.
+ * {@code SqlBlob} is closed or position is 0.
*/
public default SqlBlob trim() {
trimOperation().submit();
@@ -216,7 +219,7 @@
/**
* Return a {@link java.nio.channels.Channel} that can be used to read bytes from the
- * {@link SqlBlob} beginning at the position. Reading bytes from the returned
+ * {@code SqlBlob} beginning at the position. Reading bytes from the returned
* {@link java.nio.channels.Channel} advances the position.
*
* Each call to a read method that fetches bytes from the server creates and
@@ -232,8 +235,8 @@
/**
* Return a {@link java.nio.channels.Channel} that can be used to write bytes
- * to this {@link SqlBlob} beginning at the position. Bytes written overwrite
- * bytes already in the {@link SqlBlob}. Writing bytes to the returned
+ * to this {@code SqlBlob} beginning at the position. Bytes written overwrite
+ * bytes already in the {@code SqlBlob}. Writing bytes to the returned
* {@link java.nio.channels.Channel} advances the position.
*
* Each call to a write method that flushes bytes to the server creates and
@@ -249,7 +252,7 @@
* @return a writable byte {@link java.nio.channels.Channel} beginning at the
* position.
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlBlob} is closed.
+ * {@code SqlBlob} is closed.
*/
public AsynchronousByteChannel getWriteChannel();
}
diff -r 4f7713e6a308 -r c9cbac2979fb src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/SqlClob.java
--- a/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/SqlClob.java Thu Jul 12 15:23:13 2018 -0400
+++ b/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/SqlClob.java Sat Oct 20 08:17:38 2018 -0400
@@ -36,94 +36,97 @@
/**
* Return an {@link Operation} that will release the temporary resources
- * associated with this {@link SqlClob}.
+ * associated with this {@code SqlClob}.
*
* @return an {@link Operation} that will release the temporary resources
- * associated with this {@link SqlClob}.
+ * associated with this {@code SqlClob}.
*/
public Operation closeOperation();
+ /**
+ * {@inheritDoc}
+ */
@Override
public default void close() {
this.closeOperation().submit();
}
/**
- * Return a {@link Operation} that fetches the position of this {@link SqlClob}.
- * Position 0 is immediately before the first char in the {@link SqlClob}.
- * Position 1 is the first char in the {@link SqlClob}, etc. Position
- * {@link length()} is the last char in the {@link SqlClob}.
+ * Return a {@link Operation} that fetches the position of this {@code SqlClob}.
+ * Position 0 is immediately before the first char in the {@code SqlClob}.
+ * Position 1 is the first char in the {@code SqlClob}, etc. Position
+ * {@link length()} is the last char in the {@code SqlClob}.
*
* Position is between 0 and length + 1.
*
- * @return an {@link Operation} that returns the position of this {@link SqlClob}
+ * @return an {@link Operation} that returns the position of this {@code SqlClob}
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlClob} is closed.;
+ * {@code SqlClob} is closed.;
*/
public Operation getPositionOperation();
/**
- * Get the position of this {@link SqlClob}. Position 0 is immediately before the
- * first char in the {@link SqlClob}. Position 1 is the first char in the
- * {@link SqlClob}, etc. Position {@link length()} is the last char in the SqlClob.
+ * Get the position of this {@code SqlClob}. Position 0 is immediately before the
+ * first char in the {@code SqlClob}. Position 1 is the first char in the
+ * {@code SqlClob}, etc. Position {@link length()} is the last char in the SqlClob.
Position is between 0 and length + 1.
ISSUE: Should position be 1-based as SQL seems to do or 0-based as Java
does?
*
- * @return a future which value is the position of this {@link SqlClob}
+ * @return a future which value is the position of this {@code SqlClob}
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlClob} is closed.
+ * {@code SqlClob} is closed.
*/
public default CompletionStage getPosition() {
return getPositionOperation().submit().getCompletionStage();
}
/**
- * Return a {@link Operation} that fetches the length of this {@link SqlClob}.
+ * Return a {@link Operation} that fetches the length of this {@code SqlClob}.
*
- * @return a {@link Operation} that returns the length of this {@link SqlClob}
+ * @return a {@link Operation} that returns the length of this {@code SqlClob}
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlClob} is closed.
+ * {@code SqlClob} is closed.
*/
public Operation lengthOperation();
/**
- * Get the length of this {@link SqlClob}.
+ * Get the length of this {@code SqlClob}.
*
* @return a {@link java.util.concurrent.Future} which value is the number of
- * chars in this {@link SqlClob}
+ * chars in this {@code SqlClob}
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlClob} is closed.
+ * {@code SqlClob} is closed.
*/
public default CompletionStage length() {
return lengthOperation().submit().getCompletionStage();
}
/**
- * Return an {@link Operation} that sets the position of this {@link SqlClob}. If
- * {@code offset} exceeds the length of this {@link SqlClob} set position to the
- * length + 1 of this {@link SqlClob}, ie one past the last char.
+ * Return an {@link Operation} that sets the position of this {@code SqlClob}. If
+ * {@code offset} exceeds the length of this {@code SqlClob} set position to the
+ * length + 1 of this {@code SqlClob}, ie one past the last char.
*
* @param offset a non-negative number
- * @return a {@link Operation} that sets the position of this {@link SqlClob}
+ * @return a {@link Operation} that sets the position of this {@code SqlClob}
* @throws IllegalArgumentException if {@code offset} is less than 0
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlClob} is closed.
+ * {@code SqlClob} is closed.
*/
public Operation setPositionOperation(long offset);
/**
- * Set the position of this {@link SqlClob}. If {@code offset} exceeds the length
- * of this {@link SqlClob} set position to the length + 1 of this {@link SqlClob},
+ * Set the position of this {@code SqlClob}. If {@code offset} exceeds the length
+ * of this {@code SqlClob} set position to the length + 1 of this {@code SqlClob},
* ie one past the last char.
*
* @param offset the 1-based position to set
- * @return this {@link SqlClob}
+ * @return this {@code SqlClob}
* @throws IllegalArgumentException if {@code offset} is less than 0
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlClob} is closed.
+ * {@code SqlClob} is closed.
*/
public default SqlClob setPosition(long offset) {
setPositionOperation(offset).submit();
@@ -135,14 +138,14 @@
* next occurrence of the target after the position. If there is no such
* occurrence set the position to 0.
*
- * @param target a {@link SqlClob} created by the same {@link Session}
+ * @param target a {@code SqlClob} created by the same {@link Session}
* containing the char sequence to search for
* @return an {@link Operation} that locates {@code target} in this
- * {@link SqlClob}
+ * {@code SqlClob}
* @throws IllegalArgumentException if {@code target} was created by some
* other {@link Session}
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlClob} is closed.
+ * {@code SqlClob} is closed.
*/
public Operation locateOperation(SqlClob target);
@@ -151,11 +154,11 @@
* after the position. If there is no such occurrence set the position to 0.
*
* @param target the char sequence to search for
- * @return this {@link SqlClob}
+ * @return this {@code SqlClob}
* @throws IllegalArgumentException if {@code target} was created by some
* other {@link Session}
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlClob} is closed
+ * {@code SqlClob} is closed
*/
public default SqlClob locate(SqlClob target) {
locateOperation(target).submit();
@@ -169,9 +172,9 @@
*
* @param target the char sequence to search for. Not {@code null}. Captured.
* @return an {@link Operation} that locates {@code target} in this
- * {@link SqlClob}
+ * {@code SqlClob}
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlClob} is closed.
+ * {@code SqlClob} is closed.
*/
public Operation locateOperation(CharSequence target);
@@ -180,9 +183,9 @@
* after the position. If there is no such occurrence set the position to 0.
*
* @param target the char sequence to search for
- * @return this {@link SqlClob}
+ * @return this {@code SqlClob}
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlClob} is closed.
+ * {@code SqlClob} is closed.
*/
public default SqlClob locate(CharSequence target) {
locateOperation(target).submit();
@@ -190,25 +193,25 @@
}
/**
- * Return an {@link Operation} that truncates this {@link SqlClob} so that the
- * current position is the end of the {@link SqlClob}. If the position is N, then
+ * Return an {@link Operation} that truncates this {@code SqlClob} so that the
+ * current position is the end of the {@code SqlClob}. If the position is N, then
* after trim() the length is N - 1. The position is still N. This will fail
* if position is 0.
*
- * @return an {@link Operation} that trims the length of this {@link SqlClob}
+ * @return an {@link Operation} that trims the length of this {@code SqlClob}
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlClob} is closed or position is 0.
+ * {@code SqlClob} is closed or position is 0.
*/
public Operation trimOperation();
/**
- * Truncate this {@link SqlClob} so that the current position is the end of the
- * {@link SqlClob}. If the position is N, then after {@link trim()} the length is
+ * Truncate this {@code SqlClob} so that the current position is the end of the
+ * {@code SqlClob}. If the position is N, then after {@link trim()} the length is
* N - 1. The position is still N. This will fail if position is 0.
*
- * @return this {@link SqlClob}
+ * @return this {@code SqlClob}
* @throws IllegalStateException if the {@link Session} that created this
- * {@link SqlClob} is closed or position is 0.
+ * {@code SqlClob} is closed or position is 0.
*/
public default SqlClob trim() {
trimOperation().submit();
@@ -216,7 +219,7 @@
}
/**
- * Returns a {@link Reader} for the characters in this {@link SqlClob}.
+ * Returns a {@link Reader} for the characters in this {@code SqlClob}.
* Characters are read starting at the current position. Each character read
* advances the position by one.
*
@@ -230,7 +233,7 @@
public Reader getReader();
/**
- * Returns a Writer for this {@link SqlClob}. Characters are written starting at
+ * Returns a Writer for this {@code SqlClob}. Characters are written starting at
* the current position. Each character written advances the position by one.
*
* ISSUE: There is no character analog to
@@ -238,7 +241,7 @@
* construct a {@link java.io.Writer} from an
* {@link java.nio.channels.AsynchronousByteChannel} however.
*
- * @return a Writer for the characters of this SqlClob
+ * @return a {@link java.io.Writer} for the characters of this {@code SqlClob}
*/
public Writer getWriter();
diff -r 4f7713e6a308 -r c9cbac2979fb src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/SqlException.java
--- a/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/SqlException.java Thu Jul 12 15:23:13 2018 -0400
+++ b/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/SqlException.java Sat Oct 20 08:17:38 2018 -0400
@@ -25,24 +25,21 @@
package jdk.incubator.sql2;
/**
- *
* An exception that provides information on a database access error or other
* errors.
*
*
- * Each SqlException
provides several kinds of information:
+ * Each {@code SqlException} provides several kinds of information:
*
* - a string describing the error. This is used as the Java Exception
- * message, available via the method
getMesasge
.
+ * message, available via the method {@link getMessage}.
* - a "SQLstate" string, which follows either the XOPEN SQLstate conventions
* or the SQL:2003 conventions. The values of the SQLState string are described
- * in the appropriate spec. The
DatabaseMetaData
method
- * getSQLStateType
can be used to discover whether the driver
- * returns the XOPEN type or the SQL:2003 type.
+ * in the appropriate spec.
* - an integer error code that is specific to each vendor. Normally this
* will be the actual error code returned by the underlying database.
- *
- the causal relationship, if any for this
SqlException
.
- * - the SQL string that was executing when the error occurred.
+ *
- the causal relationship, if any for this {@code SqlException}.
+ *
- the SQL string that was executing when the error occurred. May be {@code null}.
*
- the position in the SQL string where the error was detected.
*
*/
@@ -101,7 +98,7 @@
// Methods
/**
- * Retrieves the SqlState for this SqlException
object.
+ * Retrieves the SqlState for this {@code SqlException} object.
*
* @return the SQLState value
*/
@@ -111,7 +108,7 @@
/**
* Retrieves the vendor-specific exception code for this
- * SqlException
object.
+ * {@code SqlException} object.
*
* @return the vendor's error code
*/
@@ -123,7 +120,7 @@
* Get the position.
*
* @return the index of the first character in sql where an error is detected.
- * Zero based.
+ * Zero based. {@code -1} if the position is not defined or unknown.
*/
public int getPosition() {
return position;
@@ -132,7 +129,7 @@
/**
* Get the sql.
*
- * @return the SQL string sent to the database
+ * @return the SQL string sent to the database. May be {@code null}.
*/
public String getSqlString() {
return sqlString;
diff -r 4f7713e6a308 -r c9cbac2979fb src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/SqlSkippedException.java
--- a/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/SqlSkippedException.java Thu Jul 12 15:23:13 2018 -0400
+++ b/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/SqlSkippedException.java Sat Oct 20 08:17:38 2018 -0400
@@ -22,20 +22,21 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
-
package jdk.incubator.sql2;
/**
- * A {@link SqlException} that is used to complete an {@link Operation} when that {@link Operation} is
- * skipped. If an {@link Operation} is skipped the {@link Operation} is removed from the head of
- * the queue, no work is sent to the database and the {@link java.util.concurrent.CompletionStage} of that
- * {@link Operation} is completed exceptionally with a {@link SqlSkippedException}. The cause of
- * the {@link SqlSkippedException} is the {@link Throwable} that caused the {@link Operation} to be
- * skipped, if any.
+ * A {@link SqlException} that is used to complete an {@link Operation} when
+ * that {@link Operation} is skipped. If an {@link Operation} is skipped the
+ * {@link Operation} is removed from the head of the queue, no work is sent to
+ * the database and the {@link java.util.concurrent.CompletionStage} of that
+ * {@link Operation} is completed exceptionally with a
+ * {@code SqlSkippedException}. The cause of the {@code SqlSkippedException} is
+ * the {@link Throwable} that caused the {@link Operation} to be skipped, if
+ * any.
*
*/
public class SqlSkippedException extends SqlException {
-
+
private static final long serialVersionUID = 1L;
/**
@@ -50,7 +51,7 @@
public SqlSkippedException(String message, Throwable cause, String sqlState, int vendorCode, String sql, int position) {
super(message, cause, sqlState, vendorCode, sql, position);
}
-
+
/**
*
* @param cause
@@ -58,7 +59,7 @@
public SqlSkippedException(SqlException cause) {
super(cause.getMessage(), cause, cause.getSqlState(), cause.getVendorCode(), cause.getSqlString(), cause.getPosition());
}
-
+
/**
*
* @param cause
diff -r 4f7713e6a308 -r c9cbac2979fb src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/SqlStruct.java
--- a/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/SqlStruct.java Thu Jul 12 15:23:13 2018 -0400
+++ b/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/SqlStruct.java Sat Oct 20 08:17:38 2018 -0400
@@ -76,8 +76,8 @@
*
* Implementations may choose to directly access a field named with the same
* identifier or a constructor or static factory method where all of the
- * formal parameters are named by @Field annotations in the applied
- * @SqlStruct.
+ * formal parameters are named by Field annotations in the applied
+ * SqlStruct.
*
* @return a Java identifier
*/
diff -r 4f7713e6a308 -r c9cbac2979fb src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/SqlType.java
--- a/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/SqlType.java Thu Jul 12 15:23:13 2018 -0400
+++ b/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/SqlType.java Sat Oct 20 08:17:38 2018 -0400
@@ -49,5 +49,5 @@
*
* @return a Java type that best represents values of this SQL type
*/
- public Class getJavaType();
+ public Class> getJavaType();
}
diff -r 4f7713e6a308 -r c9cbac2979fb src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/Submission.java
--- a/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/Submission.java Thu Jul 12 15:23:13 2018 -0400
+++ b/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/Submission.java Sat Oct 20 08:17:38 2018 -0400
@@ -41,7 +41,7 @@
* cancel. Neither of these is trivial.
*
* @param The type of the result of the {@link Operation} that created this
- * {@link Submission}
+ * {@code Submission}
*/
public interface Submission {
diff -r 4f7713e6a308 -r c9cbac2979fb src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/TransactionCompletion.java
--- a/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/TransactionCompletion.java Thu Jul 12 15:23:13 2018 -0400
+++ b/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/TransactionCompletion.java Sat Oct 20 08:17:38 2018 -0400
@@ -25,48 +25,50 @@
package jdk.incubator.sql2;
/**
- * A mutable object that controls whether a transactionCompletion Operation sends
- * a database commit or a database rollback to the server. A transactionCompletion
- * Operation is created with a TransactionCompletion. By default a transactionCompletion
- * Operation requests that the database end the transaction with a commit.
- * If {@link TransactionCompletion#setRollbackOnly} is called on the TransactionCompletion used to create
- the Operation prior to the Operation being executed, the Operation will
- request that the database end the transaction with a rollback.
-
- Example:
-
-
+ * A mutable object that controls whether a transactionCompletion
+ * {@link Operation} sends a database commit or a database rollback to the
+ * server. A transactionCompletion {@link Operation} is created with a
+ * {@code TransactionCompletion}. By default a transactionCompletion
+ * {@link Operation} requests that the database end the transaction with a
+ * commit. If {@link TransactionCompletion#setRollbackOnly} is called on the
+ * {@code TransactionCompletion} used to create the Operation prior to the
+ * Operation being executed, the Operation will request that the database end
+ * the transaction with a rollback.
+ *
+ * Example:
+ *
+ *
* {@code
- TransactionCompletion t = session.transactionCompletion();
- session.countOperation(updateSql)
- .resultProcessor( count -> { if (count > 1) t.setRollbackOnly(); } )
- .submit();
- session.commitMaybeRollback(t);
- }
-
- A TransactionCompletion can not be used to create more than one endTransaction
- Operation.
-
- A TransactionCompletion is thread safe.
-
- ISSUE: The name is terrible. Please suggest a better alternative, TransactionLatch?
+ * TransactionCompletion t = session.transactionCompletion();
+ * session.countOperation(updateSql)
+ * .resultProcessor( count -> { if (count > 1) t.setRollbackOnly(); } )
+ * .submit();
+ * session.commitMaybeRollback(t);
+ * }
+ *
+ * A {@code TransactionCompletion} can not be used to create more than one
+ * endTransaction {@link Operation}.
+ *
+ * A {@code TransactionCompletion} is thread safe.
+ *
*/
public interface TransactionCompletion {
/**
- * Causes an endTransactionOperation created with this TransactionCompletion that is executed
- * subsequent to this call to perform a rollback. If this method is not called
- * prior to Operation execution the Operation will perform a commit.
+ * Causes an endTransaction {@link Operation} created with this
+ * {@code TransactionCompletion} that is executed subsequent to this call to
+ * perform a rollback. If this method is not called prior to {@link Operation}
+ * execution the {@link Operation} will perform a commit.
*
- * @return true if the call succeeded. False if the call did not succeed in
- setting the TransactionCompletion rollback only because the endTransaction
- Operation had already been executed.
+ * @return {@code true} if the call succeeded. {@code false} if the call did
+ * not succeed in setting the TransactionCompletion rollback only because the
+ * endTransaction Operation had already been executed.
*/
public boolean setRollbackOnly();
/**
* Returns {@code true} iff the {@link setRollbackOnly} method has been called
- on this TransactionCompletion
+ * on this TransactionCompletion
*
* @return {@code true} if {@link setRollbackOnly} has been called.
*/