π£ Method Breakdown
π£ Method Breakdown
Letβs break down each method in RaveRepository, ensuring you know how to keep your data rave lit!
Query Methods
Purpose: Retrieve lists of objects from the database based on your SQL queries.
query(Class<T> type, Object... keyValues)
-
Description: Executes a SQL query linked via
@SqlPath
, using key-value pairs as parameters. -
Example:
query(Class<T> type, Object params)
-
Description: Executes a SQL query with a parameter object.
-
Example:
query(Class<T> type)
-
Description: Executes a SQL query without any parameters.
-
Example:
Raw Query Methods
Purpose: Execute raw SQL queries by specifying the SQL path directly, giving you full control over the data flow.
rawQuery(String sqlPath, Class<T> type, Object... keyValues)
-
Description: Executes a raw SQL query with key-value pairs.
-
Example:
rawQuery(String sqlPath, Class<T> type, Object params)
-
Description: Executes a raw SQL query with a parameter object.
-
Example:
rawQuery(String sqlPath, Class<T> type)
-
Description: Executes a raw SQL query without any parameters.
-
Example:
Query for Single Object
Purpose: Retrieve a single object from the database that matches the query parameters.
queryForObject(Class<T> type, Object... keyValues)
-
Description: Executes a SQL query to fetch a single object using key-value pairs.
-
Example:
queryForObject(Class<T> type, Object params)
-
Description: Executes a SQL query to fetch a single object with a parameter object.
-
Example:
queryForObject(Class<T> type)
-
Description: Executes a SQL query to fetch a single object without any parameters.
-
Example:
Raw Query for Single Object
Purpose: Execute raw SQL queries to retrieve a single object, offering precise control over data selection.
rawQueryForObject(String sqlPath, Class<T> type, Object... keyValues)
-
Description: Executes a raw SQL query to fetch a single object using key-value pairs.
-
Example:
rawQueryForObject(String sqlPath, Class<T> type, Object params)
-
Description: Executes a raw SQL query to fetch a single object with a parameter object.
-
Example:
rawQueryForObject(String sqlPath, Class<T> type)
-
Description: Executes a raw SQL query to fetch a single object without any parameters.
-
Example:
Update Methods
Purpose: Perform update operations on the database, modifying records to keep your data rave synchronized.
update(Object... keyValues)
-
Description: Executes an update operation using key-value pairs.
-
Example:
update(Object params)
-
Description: Executes an update operation with a parameter object.
-
Example:
update()
-
Description: Executes an update operation without any parameters.
-
Example:
Raw Update Methods
Purpose: Execute raw update operations by specifying the SQL path directly, offering full control over data modifications.
rawUpdate(String sqlPath, Object... keyValues)
-
Description: Executes a raw update operation using key-value pairs.
-
Example:
rawUpdate(String sqlPath, Object params)
-
Description: Executes a raw update operation with a parameter object.
-
Example:
rawUpdate(String sqlPath)
-
Description: Executes a raw update operation without any parameters.
-
Example:
Batch Update
Purpose: Perform batch updates to modify multiple records in one synchronized drop, keeping the rave energy high.
batchUpdate(List<?> paramObjects)
-
Description: Executes a batch update using a list of parameter objects.
-
Example:
Raw Batch Update
Purpose: Execute raw batch updates with precise control over each data modification.
rawBatchUpdate(String sqlPath, List<?> paramObjects)
-
Description: Executes a raw batch update using a list of parameter objects.
-
Example:
Preload SQL Queries
Purpose: Preload a list of SQL queries into the cache, ensuring your favorite tracks are always ready to drop without delay.
preloadSqlQueries(List<String> sqlPaths)
-
Description: Loads multiple SQL scripts into the cache.
-
Example:
Clear SQL Cache
Purpose: Clears the SQL cache, allowing you to refresh your playlist and ensure the latest queries are always in sync with your applicationβs needs.
clearSqlCache()
-
Description: Empties the SQL cache.
-
Example: