|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.orm.hibernate3.AbstractSessionFactoryBean
org.springframework.orm.hibernate3.LocalSessionFactoryBean
org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean
ch.elca.el4j.services.persistence.hibernate.entityfinder.EntityDetectorAnnotationSessionFactoryBean
public class EntityDetectorAnnotationSessionFactoryBean
Extends AnnotationSessionFactoryBean.
Detects all classes that have a \@Entity annotation under a given parent package
(indicated with the property autoDetectEntityPackage
).
Source of the idea: secutix project
Field Summary |
---|
Fields inherited from class org.springframework.orm.hibernate3.AbstractSessionFactoryBean |
---|
logger |
Constructor Summary | |
---|---|
EntityDetectorAnnotationSessionFactoryBean()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
really do the searching. |
Class<?>[] |
getAnnotatedClasses()
Just to have them available for tests |
protected String[] |
getAutoDetectEntityPackage()
|
boolean |
isJpaFullSupportEnabled()
|
protected SessionFactory |
newSessionFactory(Configuration config)
|
void |
setAnnotatedClasses(Class[] annotatedClasses)
Explicitly specify annotated entity classes. |
void |
setAutoDetectAnnotatedPackages(String[] annotatedPackages)
Specify the names of annotated packages, for which (including all sub packages) package-level JDK 1.5+ annotation metadata will be read. |
void |
setAutoDetectEntityPackage(String... pack)
Sets the 1 or n packages in which the entities are defined Sample package: "org.hibernate.tests.entities" |
void |
setJpaFullSupportEnabled(boolean enabled)
Set the enabled flag for the full JPA support. |
Methods inherited from class org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean |
---|
postProcessAnnotationConfiguration, postProcessConfiguration, postProcessMappings, scanPackages, setAnnotatedPackages, setConfigurationClass, setEntityTypeFilters, setPackagesToScan, setResourceLoader |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EntityDetectorAnnotationSessionFactoryBean()
Method Detail |
---|
public void setAutoDetectEntityPackage(String... pack)
pack
- The parent package name that contains the target entities
(as strings)protected String[] getAutoDetectEntityPackage()
public void setAutoDetectAnnotatedPackages(String[] annotatedPackages)
annotatedPackages
- a list of annotated packagespublic void setAnnotatedClasses(Class[] annotatedClasses)
setAnnotatedClasses
in class AnnotationSessionFactoryBean
public Class<?>[] getAnnotatedClasses()
public void setJpaFullSupportEnabled(boolean enabled)
enabled
- public boolean isJpaFullSupportEnabled()
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
afterPropertiesSet
in class AbstractSessionFactoryBean
Exception
protected SessionFactory newSessionFactory(Configuration config) throws HibernateException
newSessionFactory
in class LocalSessionFactoryBean
HibernateException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |