java - How to solve compile errors in custom JpaRepositoryFactory after upgrade from Spring Data JPA 1.4 to 1.8? -


basically situation when want upgrade 1.8.0.release 1.4.5.release. i've noticed far this:

  • lockmoderepositorypostprocessor has become crudmethodmetadatapostprocessor
  • lockmetadataprovider has become crudmethodmetadata

now, have custom jpa repository factories , extend jparepositoryfactory this:

class customjparepositoryfactory extends jparepositoryfactory {    protected <t, id extends serializable> jparepository<?, ?> gettargetrepository{      simplejparepository<?, ?> repo;      // custom code      lockmoderepositorypostprocessor lockmodepostprocessor = lockmoderepositorypostprocessor.instance;     repo.setlockmetadataprovider(lockmodepostprocessor.getlockmetadataprovider());    } } 

this possible because lockmoderepositorypostprocessor enum public. now, new crudmethodmetadatapostprocessor package protected , same trick not work. realized can this:

 super.gettargetrepository(metadata); 

and in back-end happen:

repository.setrepositorymethodmetadata(lockmodepostprocessor.getlockmetadataprovider()); 

but seems way misleading. spring data jpa project?

prefer overriding jparepositoryfactory.gettargetrepository(repositorymetadata, entitymanager). method called jparepositoryfactory.gettargetrepository(repositorymetadata) take care of populating repository instance created necessary crudmethodmetadata.


Comments

Popular posts from this blog

c# - SharpSsh Command Execution -

python - Specify path of savefig with pylab or matplotlib -

How to run C# code using mono without Xamarin in Android? -