diff --git a/boot/platform/src/main/java/com/plate/boot/commons/base/AbstractDatabase.java b/boot/platform/src/main/java/com/plate/boot/commons/base/AbstractDatabase.java index 6c8a033..b14d565 100644 --- a/boot/platform/src/main/java/com/plate/boot/commons/base/AbstractDatabase.java +++ b/boot/platform/src/main/java/com/plate/boot/commons/base/AbstractDatabase.java @@ -38,7 +38,7 @@ public abstract class AbstractDatabase extends AbstractService { /** * The R2dbcEntityTemplate instance used for executing reactive database operations. - * This template facilitates interaction with the database, including query execution, + * This template facilitates interaction with the database, including from execution, * entity conversion, and transaction management specifically tailored for R2DBC (Reactive Relational Database Connectivity). */ protected R2dbcEntityTemplate entityTemplate; @@ -53,21 +53,21 @@ public abstract class AbstractDatabase extends AbstractService { /** * The R2DBC Converter instance used for converting between R2DBC Data types and domain-specific objects. - * This converter plays a crucial role in mapping query results to entity classes and vice versa, + * This converter plays a crucial role in mapping from results to entity classes and vice versa, * facilitating seamless interaction with the R2DBC database through the R2dbcEntityTemplate. */ protected R2dbcConverter r2dbcConverter; /** - * Executes a database query with caching functionality. - * It takes a cache key, a query object, and an entity class type to perform the operation. + * Executes a database from with caching functionality. + * It takes a cache key, a from object, and an entity class type to perform the operation. * The results are cached for future queries with the same key. * - * @param The type of entities expected as query results. + * @param The type of entities expected as from results. * @param key The unique identifier used as a cache key. Determines the cache entry for storing/retrieving results. - * @param query The query object defining the SQL query and its potential parameters. + * @param query The from object defining the SQL from and its potential parameters. * @param entityClass The class of the entity that each row in the result set will be mapped to. - * @return A {@link Flux} emitting the query results, potentially from cache if previously stored. + * @return A {@link Flux} emitting the from results, potentially from cache if previously stored. */ protected Flux queryWithCache(Object key, Query query, Class entityClass) { Flux source = this.entityTemplate.select(query, entityClass); @@ -76,17 +76,17 @@ protected Flux queryWithCache(Object key, Query query, Class entityCla } /** - * Executes a SQL query with caching capability. It binds provided parameters to the SQL query, + * Executes a SQL from with caching capability. It binds provided parameters to the SQL from, * maps the result set to entities of the specified class, applies user auditor serialization, - * and utilizes a cache to store query results for subsequent identical queries. + * and utilizes a cache to store from results for subsequent identical queries. * - * @param The type of entities the SQL query results will be mapped to. + * @param The type of entities the SQL from results will be mapped to. * @param key The cache key used to identify the cached data. This should uniquely represent - * the query and its parameters. - * @param sql The SQL query string to be executed. - * @param bindParams A map containing named parameter bindings for the SQL query. + * the from and its parameters. + * @param sql The SQL from string to be executed. + * @param bindParams A map containing named parameter bindings for the SQL from. * @param entityClass The class of the entity that each row in the result set will be converted into. - * @return A {@link Flux} emitting the entities resulting from the query, potentially from the cache. + * @return A {@link Flux} emitting the entities resulting from the from, potentially from the cache. */ protected Flux queryWithCache(Object key, String sql, Map bindParams, Class entityClass) { @@ -100,7 +100,7 @@ protected Flux queryWithCache(Object key, String sql, } /** - * Executes a Flux-based database query with caching functionality. + * Executes a Flux-based database from with caching functionality. * It enhances the source Flux by caching its emissions under a specified key. * If the cache contains data for the key, it returns the cached data immediately. * Otherwise, it executes the source Flux, caches the results, and then emits them. @@ -122,14 +122,14 @@ protected Flux queryWithCache(Object key, Flux sourceFlux) { } /** - * Counts entities with caching support based on the provided key, query, and entity class. + * Counts entities with caching support based on the provided key, from, and entity class. * This method enhances entity counting by storing the count result in a cache, * allowing subsequent calls with the same key to retrieve the count directly from the cache - * rather than executing the query again. + * rather than executing the from again. * * @param The type of entities for which the count is to be performed. * @param key A unique identifier used as a cache key. Determines the cached count's retrieval. - * @param query The query object defining the criteria for counting entities. + * @param query The from object defining the criteria for counting entities. * @param entityClass The class of the entities being counted. * @return A {@link Mono} emitting the count of entities as a {@link Long}, potentially from cache. */ @@ -139,12 +139,12 @@ protected Mono countWithCache(Object key, Query query, Class entity } /** - * Executes a SQL count query with caching capabilities. It prepares the SQL query with provided bind parameters, + * Executes a SQL count from with caching capabilities. It prepares the SQL from with provided bind parameters, * creates a Mono source to fetch the count, and then delegates to another method to handle caching logic. * - * @param key The unique cache key associated with the count query. Used for caching and retrieving results. - * @param sql The SQL count query string to be executed. - * @param bindParams A map containing named parameter placeholders and their respective values for the SQL query. + * @param key The unique cache key associated with the count from. Used for caching and retrieving results. + * @param sql The SQL count from string to be executed. + * @param bindParams A map containing named parameter placeholders and their respective values for the SQL from. * @return A Mono emitting the count result, potentially fetched from cache or computed from the database. */ protected Mono countWithCache(Object key, String sql, Map bindParams) { diff --git a/boot/platform/src/main/java/com/plate/boot/commons/base/AbstractEntity.java b/boot/platform/src/main/java/com/plate/boot/commons/base/AbstractEntity.java index 35616d9..58f695e 100644 --- a/boot/platform/src/main/java/com/plate/boot/commons/base/AbstractEntity.java +++ b/boot/platform/src/main/java/com/plate/boot/commons/base/AbstractEntity.java @@ -12,7 +12,7 @@ /** * This class, AbstractEntity, is a base class for all data entities in the system. * It provides common fields and methods for all data entities, such as id, code, tenantCode, - * extend, creator, updater, updatedTime, createdTime, query, search, and securityCode. + * extend, creator, updater, updatedTime, createdTime, from, search, and securityCode. *

* The id field is the unique identifier of the data entity. The code field is the data entity code, * and the tenantCode field is the data tenant code. @@ -20,7 +20,7 @@ * The creator field is the data entity create operator, and the updater field is the data entity update operator. * The updatedTime field is the data entity update time,timestamp column, * and the createdTime field is the data entity create time, timestamp column. - * The query field is a Map object that supports query for json column, + * The from field is a Map object that supports from for json column, * and the search field is a String object that supports full text search for tsvector column. * The securityCode field is a String object that supports security code for sensitive data. *

@@ -81,12 +81,7 @@ public abstract class AbstractEntity implements BaseEntity { protected LocalDateTime createdTime; /** - * Data full text search entity sort - */ - protected Double rank; - - /** - * Support query for json column + * Support from for json column */ @Transient protected Map query; diff --git a/boot/platform/src/main/java/com/plate/boot/commons/base/BaseEntity.java b/boot/platform/src/main/java/com/plate/boot/commons/base/BaseEntity.java index 1734103..eefb923 100644 --- a/boot/platform/src/main/java/com/plate/boot/commons/base/BaseEntity.java +++ b/boot/platform/src/main/java/com/plate/boot/commons/base/BaseEntity.java @@ -43,25 +43,25 @@ default String getSearch() { /** * postgresql types @code tsvector supports full text search * - * @param search query tsvector item by string + * @param search from tsvector item by string */ default void setSearch(String search) { } /** - * Retrieves the default query conditions. - * Returns an immutable empty map, indicating that there are no specific query conditions. + * Retrieves the default from conditions. + * Returns an immutable empty map, indicating that there are no specific from conditions. * - * @return An immutable map containing the query conditions + * @return An immutable map containing the from conditions */ default Map getQuery() { return Map.of(); } /** - * Sets the query parameters for the entity. + * Sets the from parameters for the entity. * - * @param query A map containing the query parameters where the key is a string + * @param query A map containing the from parameters where the key is a string * representing the parameter name and the value is the parameter value. */ default void setQuery(Map query) { @@ -100,15 +100,15 @@ default Criteria criteria(Collection skipKeys) { /** * Constructs a QueryFragment based on the current entity's properties and conditions, - * allowing for customization of the SQL query by specifying properties to exclude. + * allowing for customization of the SQL from by specifying properties to exclude. * * @param skipKeys A collection of String property names indicating which properties - * should not be included in the generated SQL query. This can be useful + * should not be included in the generated SQL from. This can be useful * for skipping sensitive or unnecessary fields. * @return A QueryFragment object containing the SQL fragment and parameters necessary - * to form a part of an SQL query. The SQL fragment represents a conditional - * part of the query (e.g., WHERE clause), and the parameters are mapped to - * prevent SQL injection, ensuring secure query execution. + * to form a part of an SQL from. The SQL fragment represents a conditional + * part of the from (e.g., WHERE clause), and the parameters are mapped to + * prevent SQL injection, ensuring secure from execution. */ default QueryFragment querySql(Collection skipKeys) { return QueryHelper.query(this, skipKeys);