Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for discovering JPA 2.1 @Converter during scanning [SPR-10799] #15425

spring-projects-issues opened this issue Jul 31, 2013 · 0 comments


Copy link

@spring-projects-issues spring-projects-issues commented Jul 31, 2013

Sinuhé opened SPR-10799 and commented

JPA 2.1 spec permits registering of converters using @Converter annotation. This works ok, at least in EclipseLink's last version. But it doesn't work with XML-free configuration using Spring. This is due to DefaultPersistenceUnitManager class, which scans specified packages looking for classes annotated with @Entity, @Embeddable and @MappedSuperclass, but not @Converter.

Just adding new AnnotationTypeFilter(Converter.class, false) to entityTypeFilters field worked for me.

private static final TypeFilter[] entityTypeFilters = new TypeFilter[] {
    new AnnotationTypeFilter(Entity.class, false),
    new AnnotationTypeFilter(Embeddable.class, false),
    new AnnotationTypeFilter(MappedSuperclass.class, false),
    new AnnotationTypeFilter(Converter.class, false)};

Affects: 3.2.3

Reference URL:

Issue Links:

  • #16849 LocalSessionFactoryBean doesn't support JPA 2.1 auto-apply @Converter on Hibernate 4.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants