public class ModelRepositoryRegistry extends AbstractComponentRegistry<RepositoryOperations> implements org.springframework.context.ApplicationContextAware
RepositoryOperations beans and associates them with their respective
Model classes. Maps both the bean names and
class references of the repositories.| Constructor and Description |
|---|
ModelRepositoryRegistry() |
ModelRepositoryRegistry(org.springframework.context.ApplicationContext applicationContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Class<? extends RepositoryOperations> type)
Searches the
ApplicationContext for RecordProcessor beans and attempts to
register them. |
void |
add(RepositoryOperations repository)
Adds a new model repository mapping.
|
void |
add(String name,
RepositoryOperations repository)
Adds a new mapping in theregistry, with the given keyword and object value.
|
void |
configure()
Configures the registry object and builds the object mappings.
|
boolean |
exists(Class<? extends Model> type)
Tests to see if a
Model has an RepositoryOperations bean registered. |
List<RepositoryOperations> |
findByModel(Class<? extends Model> type)
Returns all instances of
RepositoryOperations beans that are associated with a
particular Model class. |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
exists, exists, find, getRegisteredComponents, getRegistry, setRegistrypublic ModelRepositoryRegistry()
public ModelRepositoryRegistry(org.springframework.context.ApplicationContext applicationContext)
@PostConstruct public void configure()
public void add(RepositoryOperations repository)
add in interface ComponentRegistry<RepositoryOperations>repository - RepositoryOperations bean instance.public void add(String name, RepositoryOperations repository)
ComponentRegistryadd in interface ComponentRegistry<RepositoryOperations>add in class AbstractComponentRegistry<RepositoryOperations>name - String alias for the object.repository - The object to be registered.public void add(Class<? extends RepositoryOperations> type)
ApplicationContext for RecordProcessor beans and attempts to
register them.type - class of RepositoryOperations bean.public List<RepositoryOperations> findByModel(Class<? extends Model> type)
RepositoryOperations beans that are associated with a
particular Model class.type - Model class.public boolean exists(Class<? extends Model> type)
Model has an RepositoryOperations bean registered.type - Model class.@Autowired
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionCopyright © 2016. All rights reserved.