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
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)};
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.
Affects: 3.2.3
Reference URL: http://eclipse.1072660.n5.nabble.com/Converter-not-being-picked-up-despite-having-autoApply-true-td161166.html
Issue Links:
@Converter
on Hibernate 4.3The text was updated successfully, but these errors were encountered: