Class PropertiesBasedNamedQueriesFactoryBean
java.lang.Object
org.springframework.core.io.support.PropertiesLoaderSupport
org.springframework.data.repository.config.PropertiesBasedNamedQueriesFactoryBean
- All Implemented Interfaces:
org.springframework.beans.factory.FactoryBean<PropertiesBasedNamedQueries>
,org.springframework.beans.factory.InitializingBean
public class PropertiesBasedNamedQueriesFactoryBean
extends org.springframework.core.io.support.PropertiesLoaderSupport
implements org.springframework.beans.factory.FactoryBean<PropertiesBasedNamedQueries>, org.springframework.beans.factory.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 interfaceorg.springframework.beans.factory.FactoryBean<PropertiesBasedNamedQueries>
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
IOException
-
getObject
- Specified by:
getObject
in interfaceorg.springframework.beans.factory.FactoryBean<PropertiesBasedNamedQueries>
- Throws:
IOException
-
getObjectType
- Specified by:
getObjectType
in interfaceorg.springframework.beans.factory.FactoryBean<PropertiesBasedNamedQueries>
-
createProperties
- Throws:
IOException
-