T - The data type stored in the repository.@Deprecated public abstract class AbstractQueryContainerProvider<T> extends Object implements ContainerProvider
Provides functionality to generate a specific MethodInvokerContainer object that
supports generating SQL statements based on specified conditions and invoking the repository to execute the SQL,
thereby retrieving data from the database.
The implementing class must provide a repository information object
that implements the AbstractQueryContainerProvider.Repository interface (typically as an inner class).
It should also implement the createRepository(java.lang.String, T) method to create this object when registering the repository.
This object will provide necessary functionality during SQL statement generation, including:
The registered AbstractQueryContainerProvider.Repository (t) and generated MethodInvokerContainer will be cached.
Therefore, duplicate registration of the same AbstractQueryContainerProvider.Repository is not supported,
and duplicate creation of the same MethodInvokerContainer will be avoided.
This cache is typically released only during JVM garbage collection.
If necessary, you can manually invoke destroy() to clear all caches.
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
AbstractQueryContainerProvider.QueryInfo
已过时。
An interface for query information.
|
static interface |
AbstractQueryContainerProvider.Repository<T>
已过时。
An interface for a generic repository that provides access to data storage.
|
| 限定符和类型 | 字段和说明 |
|---|---|
protected MethodInvokerContainerCreator |
methodInvokerContainerCreator
已过时。
|
protected Map<String,AbstractQueryContainerProvider.Repository<T>> |
registeredRepositories
已过时。
|
| 构造器和说明 |
|---|
AbstractQueryContainerProvider()
已过时。
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected abstract @NonNull MethodInvoker |
createMethodInvoker(String namespace,
AbstractQueryContainerProvider.Repository<T> repository,
Set<String> queryColumns,
String keyColumn,
String keyProperty)
已过时。
Creates a
MethodInvoker object. |
protected abstract AbstractQueryContainerProvider.Repository<T> |
createRepository(String name,
T target)
已过时。
Creates a repository object.
|
void |
destroy()
已过时。
Clear all caches
|
abstract String |
determineNamespace(String name,
@Nullable String keyProperty,
@Nullable List<String> properties)
已过时。
Determines the namespace of container.
|
<K> @Nullable Container<K> |
getContainer(String namespace)
已过时。
Get container instance by given namespace
|
<K> Container<K> |
getQueryContainer(String name,
@Nullable String keyProperty,
@Nullable List<String> properties)
已过时。
Get a container based on repository object
T. |
void |
registerRepository(String name,
T target)
已过时。
Registers a repository object.
|
protected abstract AbstractQueryContainerProvider.QueryInfo |
resolveQueryInfo(String namespace)
已过时。
Resolves the query information for the specified namespace which generated by
determineNamespace(java.lang.String, java.lang.String, java.util.List<java.lang.String>). |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontainsContainerprotected final Map<String,AbstractQueryContainerProvider.Repository<T>> registeredRepositories
protected final MethodInvokerContainerCreator methodInvokerContainerCreator
public final void registerRepository(String name, T target)
name - name of the repository.target - repository object.protected abstract AbstractQueryContainerProvider.Repository<T> createRepository(String name, T target)
name - name of the repository.target - repository object.AbstractQueryContainerProvider.Repository instance.public <K> @Nullable Container<K> getContainer(String namespace)
getContainer 在接口中 ContainerProviderK - key typenamespace - namespace of containerpublic <K> Container<K> getQueryContainer(String name, @Nullable String keyProperty, @Nullable List<String> properties)
Get a container based on repository object T.
When querying, the attribute name of the input parameter will be converted to
the table columns specified in the corresponding property.
name - mapper namekeyProperty - key field name for a query, if it is empty, it defaults to the specified key fieldproperties - fields to query, if it is empty, all table columns will be queried by default.public abstract String determineNamespace(String name, @Nullable String keyProperty, @Nullable List<String> properties)
name - mapper namekeyProperty - key field name for a query, if it is empty, it defaults to the specified key fieldproperties - fields to query, if it is empty, all table columns will be queried by default.resolveQueryInfo(String)protected abstract AbstractQueryContainerProvider.QueryInfo resolveQueryInfo(String namespace)
determineNamespace(java.lang.String, java.lang.String, java.util.List<java.lang.String>).namespace - namespace.AbstractQueryContainerProvider.QueryInfo instance.protected abstract @NonNull MethodInvoker createMethodInvoker(String namespace, AbstractQueryContainerProvider.Repository<T> repository, Set<String> queryColumns, String keyColumn, String keyProperty)
MethodInvoker object.namespace - The namespace.repository - The repository object.queryColumns - The columns to query.keyColumn - The key column.keyProperty - The key property.public void destroy()
Copyright © 2024. All rights reserved.