Skip to content

Commit

Permalink
docs: update documentation to SemistructuredTemplate
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
  • Loading branch information
otaviojava committed Mar 2, 2024
1 parent 8a16c25 commit 60f5cb4
Showing 1 changed file with 63 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

import jakarta.nosql.PreparedStatement;
import jakarta.nosql.Template;
import org.eclipse.jnosql.communication.column.ColumnDeleteQuery;
import org.eclipse.jnosql.communication.column.ColumnQuery;

import java.util.Optional;
import java.util.stream.Stream;
Expand Down Expand Up @@ -91,4 +93,65 @@ public interface SemistructuredTemplate extends Template {
* @throws UnsupportedOperationException if the provider does not support query by text
*/
PreparedStatement prepare(String query);

/**
* Deletes an entity
*
* @param query query to delete an entity
* @throws NullPointerException when query is null
*/
void delete(ColumnDeleteQuery query);

/**
* Finds entities from query
*
* @param query - query to figure out entities
* @param <T> the instance type
* @return entities found by query
* @throws NullPointerException when query is null
*/
<T> Stream<T> select(ColumnQuery query);

/**
* Returns the number of items in the column family that match a specified query.
* @param query the query
* @return the number of documents from query
* @throws NullPointerException when query is null
*/
long count(ColumnQuery query);

/**
* Returns whether an entity that match a specified query.
* @param query the query
* @return true if an entity with the given query exists, false otherwise.
* @throws NullPointerException when query it null
*/
boolean exists(ColumnQuery query);

/**
* Returns a single entity from query
*
* @param query - query to figure out entities
* @param <T> the instance type
* @return an entity on {@link Optional} or {@link Optional#empty()} when the result is not found.
* @throws NullPointerException when query is null
*/
<T> Optional<T> singleResult(ColumnQuery query);

/**
* Returns all entities on the database
* @param type the entity type filter
* @return the {@link Stream}
* @param <T> the entity type
* @throws NullPointerException when type is null
*/
<T> Stream<T> findAll(Class<T> type);

/**
* delete all entities from the database
* @param type the entity type filter
* @param <T> the entity type
* @throws NullPointerException when type is null
*/
<T> void deleteAll(Class<T> type);
}

0 comments on commit 60f5cb4

Please sign in to comment.