6

is it possible integration eclipse collections with spring data jpa + hibernate?

for example:

import org.springframework.data.jpa.repository.JpaRepository;
import org.eclipse.collections.api.list.ImmutableList;

public interface UserRepository extends JpaRepository<User, Long> {

    ImmutableList<User> findByActiveTrue();

}
  • 3
    Anything is possible, but I'm not sure if this is easy or a lot of work. Have you tried looking to see if JPA supports extensions for custom collections? I haven't used Spring Data JPA. A long time ago I looked at the possibility of implementing custom collections for Hibernate for Eclipse Collections. It looked possible, but this would likely be a full project on its own. I never had a need to implement it myself, so I haven't spent any time trying to code it. I'd be happy if someone wanted to build out the support for it . – Donald Raab Apr 16 '20 at 18:00

1 Answers1

2

I don't believe this is possible today. Providing support for Immutable Collection types from different libraries has been discussed in an issue on the spring-data-commons project.

https://github.com/spring-projects/spring-data-commons/issues/1817

The issue was assigned in Dec. 2020.

Update (May 4th): There have been some updates in the past couple of days on the GitHub issue:

https://github.com/spring-projects/spring-data-commons/issues/1817#issuecomment-1117257169

It sounds like perhaps this question will eventually have a positive answer.

Donald Raab
  • 6,458
  • 2
  • 36
  • 44