Skip to content

Commit

Permalink
Merge branch 'hotfix/support-custom-repository' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
shouwn committed Mar 7, 2024
2 parents c59b4c3 + 51b662e commit 9b44946
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import org.springframework.beans.factory.annotation.Autowired
import org.springframework.beans.factory.config.BeanPostProcessor
import org.springframework.context.annotation.Lazy
import org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean
import org.springframework.data.repository.core.support.RepositoryComposition.RepositoryFragments
import org.springframework.stereotype.Component

@Component
Expand All @@ -18,7 +17,7 @@ open class KotlinJdslJpaRepositoryFactoryBeanPostProcessor : BeanPostProcessor {

override fun postProcessBeforeInitialization(bean: Any, beanName: String): Any? {
if (bean is JpaRepositoryFactoryBean<*, *, *>) {
bean.setRepositoryFragments(RepositoryFragments.just(kotlinJdslJpqlExecutor))
bean.setCustomImplementation(kotlinJdslJpqlExecutor)
}

return super.postProcessAfterInitialization(bean, beanName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import org.springframework.beans.factory.annotation.Autowired
import org.springframework.beans.factory.config.BeanPostProcessor
import org.springframework.context.annotation.Lazy
import org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean
import org.springframework.data.repository.core.support.RepositoryComposition.RepositoryFragments
import org.springframework.stereotype.Component

@Component
Expand All @@ -18,7 +17,7 @@ open class KotlinJdslJpaRepositoryFactoryBeanPostProcessor : BeanPostProcessor {

override fun postProcessBeforeInitialization(bean: Any, beanName: String): Any? {
if (bean is JpaRepositoryFactoryBean<*, *, *>) {
bean.setRepositoryFragments(RepositoryFragments.just(kotlinJdslJpqlExecutor))
bean.setCustomImplementation(kotlinJdslJpqlExecutor)
}

return super.postProcessAfterInitialization(bean, beanName)
Expand Down

0 comments on commit 9b44946

Please sign in to comment.