Skip to content

In AnnotationSessionFactoryBean, be able to specify annotatedPackages and packagesToScan in one property [SPR-10288] #14922

Closed

Description

@spring-projects-issues

Sanjay Deshmukh opened SPR-10288 and commented

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.


Affects: 3.2.1

Attachments:

Issue Links:

Referenced from: commits 5334ac5

Activity

  1. spring-projects-issues commented on Feb 13, 2013

    @spring-projects-issues
    CollaboratorAuthor

    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

  2. spring-projects-issues commented on Feb 13, 2013

    @spring-projects-issues
    CollaboratorAuthor

    Sanjay Deshmukh commented

    Beautiful - thank you!

  3. spring-projects-issues commented on Oct 7, 2013

    @spring-projects-issues
    CollaboratorAuthor

    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.

  4. spring-projects-issues commented on Nov 20, 2013

    @spring-projects-issues
    CollaboratorAuthor

    Peter Cooper Jr. commented

    See also #13233

  5. spring-projects-issues commented on Jan 17, 2014

    @spring-projects-issues
    CollaboratorAuthor

    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

  6. spring-projects-issues commented on Jan 17, 2014

    @spring-projects-issues
    CollaboratorAuthor

    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 @TypeDefs and @GenericGenerator defined in a package-info.

  7. added
    in: data
    type: enhancement
    on Jan 11, 2019
  8. added this to the 3.2.2 milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: datatype: enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions