2

Is there any java library to build sql queries based on pojos, Like something similar to hibernate hql queries.

Object sql queries than translated to elastic search sql queries.

Current requirement is to send sql queries through rest apis.

There is jooq library whic can generate for many databases using dialects but currently it doesnt support for EsDriver which is elastic search jdbc driver.

Regards Rajesh Giriyappa

1 Answers1

2

I find your question a bit confusing. however, I'm gonna mention some facts that might help you. First of all, elasticsearch is far away from a relational database system. It is a search engine implemented on top of Apache Lucene and stores semi-structured documents in its own data structure called index and it is used for Information Retrieval purposes. having said that, it is impossible to run SQL queries against elasticsearch because obviously it is not an RDBMS. Furthermore, JPA is targeted only for providing solutions for working with RDBMSs so you can not connect to elasticsearch with JDBC, Hibernate etc. If you want to connect to elasticsearch in a java application, you should use standard clients provided by elasticsearch itself. https://www.elastic.co/guide/en/elasticsearch/client/java-rest/7.13/index.html

mammad
  • 175
  • 8