Skip to content

Commit 8f4bf15

Browse files
committed
docs: fix cassandra javadoc api
Signed-off-by: Otavio Santana <[email protected]>
1 parent e111f85 commit 8f4bf15

File tree

10 files changed

+103
-41
lines changed

10 files changed

+103
-41
lines changed

jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/mapping/DefaultArangoDBTemplate.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.eclipse.jnosql.communication.semistructured.DatabaseManager;
2323
import org.eclipse.jnosql.databases.arangodb.communication.ArangoDBDocumentManager;
2424
import org.eclipse.jnosql.mapping.core.Converters;
25-
import org.eclipse.jnosql.mapping.document.DocumentTemplate;
2625
import org.eclipse.jnosql.mapping.metadata.EntitiesMetadata;
2726
import org.eclipse.jnosql.mapping.semistructured.AbstractSemistructuredTemplate;
2827
import org.eclipse.jnosql.mapping.semistructured.EntityConverter;

jnosql-cassandra/src/main/java/org/eclipse/jnosql/databases/cassandra/communication/CassandraConfiguration.java

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,35 +22,45 @@
2222
import java.util.HashMap;
2323
import java.util.List;
2424
import java.util.Map;
25-
import java.util.stream.Collectors;
26-
27-
import static java.util.Objects.requireNonNull;
25+
import java.util.Objects;
2826

2927
/**
30-
* The Cassandra implementation to {@link DatabaseConfiguration} that returns
31-
* {@link CassandraColumnManagerFactory}
28+
* A Cassandra-specific implementation of {@link DatabaseConfiguration}, which provides
29+
* {@link CassandraColumnManagerFactory} instances.
3230
*
3331
* @see CassandraConfigurations
3432
*/
3533
public final class CassandraConfiguration implements DatabaseConfiguration {
3634

37-
35+
/**
36+
* Retrieves the {@link CassandraColumnManagerFactory} based on the provided configurations.
37+
*
38+
* @param configurations the configurations for Cassandra
39+
* @return a {@link CassandraColumnManagerFactory} instance
40+
* @throws NullPointerException if configurations are null
41+
*/
3842
private CassandraColumnManagerFactory getManagerFactory(Map<String, String> configurations) {
39-
requireNonNull(configurations);
43+
Objects.requireNonNull(configurations);
4044
CassandraProperties properties = CassandraProperties.of(configurations);
4145
return new CassandraColumnManagerFactory(properties.createCluster(), properties.getQueries());
4246
}
4347

44-
48+
/**
49+
* Applies the settings to create a {@link CassandraColumnManagerFactory}.
50+
*
51+
* @param settings the settings to apply
52+
* @return a {@link CassandraColumnManagerFactory} instance
53+
* @throws NullPointerException if settings are null
54+
*/
4555
@Override
4656
public CassandraColumnManagerFactory apply(Settings settings) throws NullPointerException {
47-
requireNonNull(settings, "settings is required");
57+
Objects.requireNonNull(settings, "Settings is required");
4858
Map<String, String> configurations = new HashMap<>();
4959

5060
List<String> keys = settings.keySet()
5161
.stream()
5262
.filter(k -> k.startsWith("jnosql."))
53-
.collect(Collectors.toUnmodifiableList());
63+
.toList();
5464

5565
for (String key : keys) {
5666
settings.get(key, String.class).ifPresent(v -> configurations.put(key, v));

jnosql-cassandra/src/main/java/org/eclipse/jnosql/databases/cassandra/communication/CassandraPreparedStatement.java

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,33 +23,42 @@
2323
import java.util.stream.Stream;
2424

2525
/**
26-
* The Diana wrapper to {@link com.datastax.oss.driver.api.core.cql.PreparedStatement}
26+
* Wrapper class for {@link com.datastax.oss.driver.api.core.cql.PreparedStatement} in JNoSQL.
27+
* Allows execution of CQL queries and binding of parameters.
2728
*/
2829
public class CassandraPreparedStatement {
2930

3031
private final com.datastax.oss.driver.api.core.cql.PreparedStatement prepare;
31-
3232
private final CqlSession session;
33-
3433
private BoundStatement boundStatement;
3534

35+
/**
36+
* Constructs a new CassandraPreparedStatement.
37+
*
38+
* @param prepare the underlying Cassandra PreparedStatement
39+
* @param session the CQL session
40+
*/
3641
CassandraPreparedStatement(com.datastax.oss.driver.api.core.cql.PreparedStatement prepare, CqlSession session) {
3742
this.prepare = prepare;
3843
this.session = session;
3944
}
4045

46+
/**
47+
* Executes the prepared statement as a query and returns the results as a stream of CommunicationEntity.
48+
*
49+
* @return a stream of CommunicationEntity containing the results of the query
50+
*/
4151
public Stream<CommunicationEntity> executeQuery() {
4252
load();
4353
ResultSet resultSet = session.execute(boundStatement);
4454
return resultSet.all().stream().map(CassandraConverter::toDocumentEntity);
4555
}
4656

47-
4857
/**
49-
* Bind
58+
* Binds values to the prepared statement.
5059
*
51-
* @param values the values
52-
* @return this instance
60+
* @param values the values to bind
61+
* @return this CassandraPreparedStatement instance
5362
*/
5463
public CassandraPreparedStatement bind(Object... values) {
5564
boundStatement = prepare.bind(values);
@@ -62,7 +71,11 @@ private void load() {
6271
}
6372
}
6473

65-
74+
/**
75+
* Returns a string representation of this CassandraPreparedStatement.
76+
*
77+
* @return a string representation of this CassandraPreparedStatement
78+
*/
6679
@Override
6780
public String toString() {
6881
return "CassandraPreparedStatement{" +
@@ -71,4 +84,4 @@ public String toString() {
7184
", boundStatement=" + boundStatement +
7285
'}';
7386
}
74-
}
87+
}

jnosql-cassandra/src/main/java/org/eclipse/jnosql/databases/cassandra/communication/CassandraQuery.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public String toString() {
146146
/**
147147
* returns a new instance of {@link CassandraQuery}
148148
*
149-
* @param query the {@link ColumnQuery}
149+
* @param query the {@link SelectQuery}
150150
* @return a new instance
151151
* @throws NullPointerException when query is null
152152
*/

jnosql-cassandra/src/main/java/org/eclipse/jnosql/databases/cassandra/communication/UDTElementBuilder.java

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,33 @@
1717

1818
import org.eclipse.jnosql.communication.semistructured.Element;
1919

20+
/**
21+
* A builder interface for constructing Cassandra User-Defined Types (UDTs).
22+
*/
2023
public interface UDTElementBuilder {
2124

22-
2325
/**
24-
* Adds the udt when the type is just one element
26+
* Adds a single UDT element to the builder.
2527
*
26-
* @param udt the elements in a UDT to be added
28+
* @param udt the UDT element to be added
2729
* @return the builder instance
28-
* @throws NullPointerException when either the udt or there is a null element
30+
* @throws NullPointerException if the udt or any of its elements is null
2931
*/
3032
UDTFinisherBuilder addUDT(Iterable<Element> udt) throws NullPointerException;
33+
3134
/**
32-
* <p>On Cassandra, there is the option to a UDT be part of a list. This implementation holds this option.</p>
33-
* <p>eg: CREATE COLUMNFAMILY IF NOT EXISTS contacts ( user text PRIMARY KEY, names list&#60;frozen &#60;fullname&#62;&#62;);</p>
35+
* Adds multiple UDTs to the builder, typically used when a UDT is part of a list.
36+
* For example:
37+
* <pre>
38+
* CREATE COLUMNFAMILY IF NOT EXISTS contacts (
39+
* user text PRIMARY KEY,
40+
* names list&lt;frozen &lt;fullname&gt;&gt;
41+
* );
42+
* </pre>
3443
*
35-
* @param udts the UTDs to be added
44+
* @param udts the UDTs to be added
3645
* @return the builder instance
37-
* @throws NullPointerException when either the udt or there is a null element
46+
* @throws NullPointerException if any of the udts or their elements is null
3847
*/
3948
UDTFinisherBuilder addUDTs(Iterable<Iterable<Element>> udts) throws NullPointerException;
40-
}
49+
}

jnosql-cassandra/src/main/java/org/eclipse/jnosql/databases/cassandra/communication/UDTFinisherBuilder.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@
1414
*/
1515
package org.eclipse.jnosql.databases.cassandra.communication;
1616

17+
/**
18+
* A builder interface for finalizing the creation of a user-defined type (UDT).
19+
*/
1720
public interface UDTFinisherBuilder {
1821

1922
/**
20-
* Creates a udt instance
23+
* Creates a UDT instance based on the previously specified elements.
2124
*
22-
* @return a udt instance
23-
* @throws IllegalStateException when there is a null element
25+
* @return a new UDT instance
26+
* @throws IllegalStateException if any required element is missing
2427
*/
25-
UDT build();
26-
}
28+
UDT build() throws IllegalStateException;
29+
}

jnosql-cassandra/src/main/java/org/eclipse/jnosql/databases/cassandra/communication/UDTNameBuilder.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,17 @@
1414
*/
1515
package org.eclipse.jnosql.databases.cassandra.communication;
1616

17+
/**
18+
* A builder interface for creating a user-defined type (UDT) element with the specified name.
19+
*/
1720
public interface UDTNameBuilder {
1821

22+
/**
23+
* Specifies the name of the UDT element.
24+
*
25+
* @param name the name of the UDT element
26+
* @return the {@link UDTElementBuilder} instance to continue building the UDT
27+
* @throws NullPointerException if {@code name} is {@code null}
28+
*/
1929
UDTElementBuilder withName(String name) throws NullPointerException;
2030
}

jnosql-cassandra/src/main/java/org/eclipse/jnosql/databases/cassandra/mapping/CQL.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,16 @@
2020
import java.lang.annotation.Target;
2121

2222
/**
23-
* To a dynamic query on CassandraRepository and CassandraRepositoryAsync interfaces.
23+
* Annotation used to define a dynamic CQL query method in CassandraRepository and CassandraRepositoryAsync interfaces.
2424
*/
2525
@Retention(RetentionPolicy.RUNTIME)
2626
@Target(ElementType.METHOD)
2727
public @interface CQL {
2828

29+
/**
30+
* The CQL query string.
31+
*
32+
* @return the CQL query string
33+
*/
2934
String value();
30-
}
35+
}

jnosql-cassandra/src/main/java/org/eclipse/jnosql/databases/cassandra/mapping/CassandraExtension.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,19 @@
2323
import java.util.Set;
2424
import java.util.logging.Logger;
2525

26+
/**
27+
* CDI extension for Cassandra integration.
28+
*/
2629
public class CassandraExtension implements Extension {
2730

2831
private static final Logger LOGGER = Logger.getLogger(CassandraExtension.class.getName());
2932

33+
/**
34+
* Observes the AfterBeanDiscovery event to add Cassandra repository beans.
35+
*
36+
* @param afterBeanDiscovery the AfterBeanDiscovery event
37+
*/
3038
void onAfterBeanDiscovery(@Observes final AfterBeanDiscovery afterBeanDiscovery) {
31-
3239
ClassScanner scanner = ClassScanner.load();
3340
Set<Class<?>> crudTypes = scanner.repositories(CassandraRepository.class);
3441

@@ -38,4 +45,4 @@ void onAfterBeanDiscovery(@Observes final AfterBeanDiscovery afterBeanDiscovery)
3845

3946
LOGGER.info("Finished the onAfterBeanDiscovery");
4047
}
41-
}
48+
}

jnosql-cassandra/src/main/java/org/eclipse/jnosql/databases/cassandra/mapping/Param.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,17 @@
2121

2222

2323
/**
24-
* Defines a param to a CQL query.
24+
* An annotation used to define a parameter in a CQL query.
25+
* This annotation is used to specify the name of the parameter.
2526
*/
2627
@Retention(RetentionPolicy.RUNTIME)
2728
@Target(ElementType.PARAMETER)
2829
public @interface Param {
2930

31+
/**
32+
* Specifies the name of the parameter.
33+
*
34+
* @return the name of the parameter
35+
*/
3036
String value();
31-
}
37+
}

0 commit comments

Comments
 (0)