Class PropertiesBasedNamedQueriesFactoryBean
java.lang.Object
org.springframework.core.io.support.PropertiesLoaderSupport
org.springframework.data.repository.config.PropertiesBasedNamedQueriesFactoryBean
- All Implemented Interfaces:
FactoryBean<PropertiesBasedNamedQueries>
,InitializingBean
public class PropertiesBasedNamedQueriesFactoryBean
extends PropertiesLoaderSupport
implements FactoryBean<PropertiesBasedNamedQueries>, InitializingBean
Factory bean to create
PropertiesBasedNamedQueries
.
Supports loading from a properties file and/or setting local properties on this FactoryBean. The created Properties instance will be merged from loaded and local values. If neither a location nor local properties are set, an exception will be thrown on initialization.
Can create a singleton or a new object on each request. Default is a singleton.
- Since:
- 3.0
- Author:
- Mark Paluch
-
Field Summary
Fields inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
localOverride, localProperties, logger
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
protected Properties
boolean
void
setSingleton
(boolean singleton) Set whether a shared singletonPropertiesBasedNamedQueries
instance should be created, or rather a newPropertiesBasedNamedQueries
instance on each request.Methods inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
loadProperties, mergeProperties, setFileEncoding, setIgnoreResourceNotFound, setLocalOverride, setLocation, setLocations, setProperties, setPropertiesArray, setPropertiesPersister
-
Constructor Details
-
PropertiesBasedNamedQueriesFactoryBean
public PropertiesBasedNamedQueriesFactoryBean()
-
-
Method Details
-
setSingleton
public void setSingleton(boolean singleton) Set whether a shared singletonPropertiesBasedNamedQueries
instance should be created, or rather a newPropertiesBasedNamedQueries
instance on each request.Default is
true
(a shared singleton). -
isSingleton
public boolean isSingleton()- Specified by:
isSingleton
in interfaceFactoryBean<PropertiesBasedNamedQueries>
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceInitializingBean
- Throws:
IOException
-
getObject
- Specified by:
getObject
in interfaceFactoryBean<PropertiesBasedNamedQueries>
- Throws:
IOException
-
getObjectType
- Specified by:
getObjectType
in interfaceFactoryBean<PropertiesBasedNamedQueries>
-
createProperties
- Throws:
IOException
-