You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
In AnnotationSessionFactoryBean, be able to specify annotatedPackages and packagesToScan in one property [SPR-10288] #14922
I tend to have package-level annotations on all of my packages that contain Hibernate-annotated classes. The biggest one is a @TypeDef to persist joda-time DateTimes and LocalTimes. It would be nice to have a single property through which I can set both annotatedPackages and packagesToScan, rather than passing the same list to both.
As of 3.2.2, "packagesToScan" detects package-info classes as well and passes them to Hibernate's addPackage method. This means that specifying "packagesToScan" should be sufficient for your use case now.
Are there any plans to bring the same functionality to the org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean class which also has the packagesToScan property but doesn't offer the same flexibility (I just looked in version 3.2.4)? Unless there's another way to achieve the same behavior that I'm not aware of.
Thank you. I'll be watching that issue then. It will be very useful for testing. When you have a big system with hundreds of entities, it's nice to have a separate config to bootstrap your entity manager with only a subset of entities (using the packagesToScan property). Makes for faster startup times of test cases that only need to deal with a specific part of the system. The problem is that I have @TypeDefs and @GenericGenerator defined in a package-info.
Activity
spring-projects-issues commentedon Feb 13, 2013
Juergen Hoeller commented
As of 3.2.2, "packagesToScan" detects package-info classes as well and passes them to Hibernate's addPackage method. This means that specifying "packagesToScan" should be sufficient for your use case now.
Juergen
spring-projects-issues commentedon Feb 13, 2013
Sanjay Deshmukh commented
Beautiful - thank you!
spring-projects-issues commentedon Oct 7, 2013
Yannick Lazzari commented
Hi,
Are there any plans to bring the same functionality to the org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean class which also has the packagesToScan property but doesn't offer the same flexibility (I just looked in version 3.2.4)? Unless there's another way to achieve the same behavior that I'm not aware of.
Thanks.
spring-projects-issues commentedon Nov 20, 2013
Peter Cooper Jr. commented
See also #13233
spring-projects-issues commentedon Jan 17, 2014
Juergen Hoeller commented
Yannick, related to my comment on #13233: Check out #15538 for JPA support there, scheduled for Spring Framework 4.1 at this point.
Juergen
spring-projects-issues commentedon Jan 17, 2014
Yannick Lazzari commented
Thank you. I'll be watching that issue then. It will be very useful for testing. When you have a big system with hundreds of entities, it's nice to have a separate config to bootstrap your entity manager with only a subset of entities (using the packagesToScan property). Makes for faster startup times of test cases that only need to deal with a specific part of the system. The problem is that I have
@TypeDefsand@GenericGeneratordefined in a package-info.