Skip to content
Advertisement

Can I use custom criteria (from a database extension) with spring JPA specifications?

I really found of Spring Data’s JpaSpecificationExecutor, it allows me to dynamically build queries, depending on the filters applied by user.

However, I’ve installed a ZomboDB plugin, and now I need to support a new syntax:

SELECT * FROM table WHERE table ==> 'cats AND dogs';

Is it possible to extend CriteriaBuilder to use this new syntax?

Advertisement

Answer

This won’t work.

The JpaSpecificationExecutor is built on JPA. But what you want to do is highly database specific.

Since ZomboDB seems to offer its own API, it is probably best to use that in a custom method implementation.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement