Skip to content

Commit

Permalink
docs: update javadoc at template
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <[email protected]>
  • Loading branch information
otaviojava committed Feb 20, 2024
1 parent c909859 commit d9b7daa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
5 changes: 3 additions & 2 deletions api/src/main/java/jakarta/nosql/Convert.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
*
* <p>The dot notation may also be used with map entries:
* <p>Convert a basic attribute
* {@snippet :
* <pre>
* {@code
* @Converter
* public class BooleanToIntegerConverter
* implements AttributeConverter<Boolean, Integer> { ... }
Expand All @@ -43,7 +44,7 @@
* boolean fullTime;
* }
* }
*
*</pre>
* @since 1.0.0
*/
@Retention(RetentionPolicy.RUNTIME)
Expand Down
4 changes: 3 additions & 1 deletion api/src/main/java/jakarta/nosql/Id.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@
* </p>
*
* <p>Example:
* {@snippet :
* <pre>
* {@code
* @Id
* public Long id;
* }
* </pre>
* An insertion with an ID value might vary from the vendor, where vendors can throw a NullPointerException,
* for example, a Key-value database, or apply a strategy of generating value, for example, UUID.
* </p>
Expand Down
13 changes: 8 additions & 5 deletions api/src/main/java/jakarta/nosql/Template.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ public interface Template {
*
* @param entity the entity to insert. Must not be {@code null}.
* @param ttl time to live
* @param <T> the entity type
* @param <T> the entity type
* @return the inserted entity, which may or may not be a different instance depending on whether the insert caused
* values to be generated or automatically incremented.
* @throws NullPointerException if the entity is null.
* @throws NullPointerException if the entity is null.
* @throws UnsupportedOperationException when the database does not provide TTL
*/
<T> T insert(T entity, Duration ttl);
Expand All @@ -156,7 +156,7 @@ public interface Template {
* position of entities in the parameter based on the unique identifier of the entity.</p>
*
* @param entities entities to insert.
* @param <T> the entity type
* @param <T> the entity type
* @return an iterable containing the inserted entities, which may or may not be different instances depending
* on whether the insert caused values to be generated or automatically incremented.
* @throws NullPointerException if the iterable is null or any element is null.
Expand All @@ -179,7 +179,8 @@ public interface Template {
* position of entities in the parameter based on the unique identifier of the entity.</p>
*
* @param entities entities to insert.
* @param <T> the entity type
* @param <T> the entity type
* @param ttl time to live
* @return an iterable containing the inserted entities, which may or may not be different instances depending
* on whether the insert caused values to be generated or automatically incremented.
* @throws NullPointerException if the iterable is null or any element is null.
Expand All @@ -199,7 +200,8 @@ public interface Template {
* the update.</p>
*
* <p>Non-matching entities are ignored and do not cause an error to be raised.</p>
*@param <T> the entity type
*
* @param <T> the entity type
* @param entity the entity to update. Must not be {@code null}.
* @return the updated entity, which may or may not be a different instance depending on whether the update caused
* values to be generated or automatically incremented.
Expand All @@ -222,6 +224,7 @@ public interface Template {
* <p>Non-matching entities are ignored and do not cause an error to be raised.</p>
*
* @param entities entities to update.
* @param <T> the entity class type
* @return the number of matching entities that were found in the database to update.
* @throws NullPointerException if either the iterable is null or any element is null.
*/
Expand Down

0 comments on commit d9b7daa

Please sign in to comment.