alexkramer / grails-hibernate-filter

Hibernate Filters Support for Grails 3, Hibernate 5, and GORM 6
Apache License 2.0
4 stars 8 forks source link

#8 - Fix for mappedWith none being included #9

Closed phejl closed 6 years ago

phejl commented 6 years ago

Fix for issue #8

alexkramer commented 6 years ago

Thanks for opening this PR. Apologies for the delay in response as I was away on vacation.

A few things:

phejl commented 6 years ago
  • Please add an example to the example project that will validate this change.
  • Can you provide an example project that I can use to reproduce the original issue on my end?

I'll try. Just give me some time.

  • Would you mind pointing me in the direction of the Hibernate plugin source code where they apply this logic? (I have been searching for it but have had difficulty locating it for some reason).

It is in grails.plugin.hibernate.HibernateGrailsPlugin.doWithSpring line 73 of jar org.grails.plugins:hibernate5:6.0.10 in my case. From that point it is propagated (line 80) down to HibernateDatastoreSpringInitializer.getBeansDefinitions where hibernateConnectionSourceFactory bean is created with explicitly passed array of classes.

phejl commented 6 years ago

I have added test to the hibernate-filter-example project.

In the attached zip file there is the simplest possible project to reproduce the issue. Just unpack it and run it - it will fail. Comment out the hibernate-filter-plugin in build.gradle and run it again - it will run just fine.

hibernate-filter-map-with-none.zip