Support Questions
Find answers, ask questions, and share your expertise

Hi Everyone, I just want to ask does the spring boot JPA work on apache phoenix?

Explorer

I am currently trying to build spring boot rest API to insert data into Apache Phoenix.

If I can use JPA to insert data into Phoenix that will be very convenient.

1 ACCEPTED SOLUTION

Phoenix works with JDBCTemplate and Spring, using the JDBC driver org.apache.phoenix.jdbc.PhoenixDriver. Here is an example spring implementationhttp://blog.csdn.net/eric_sunah/article/details/44494321 with connection pooling (the blog post is in Chinese but it translates well on chrome).

If you are specifically looking for ORM, then you can use https://phoenix.apache.org/phoenix_orm.html

View solution in original post

2 REPLIES 2

Phoenix works with JDBCTemplate and Spring, using the JDBC driver org.apache.phoenix.jdbc.PhoenixDriver. Here is an example spring implementationhttp://blog.csdn.net/eric_sunah/article/details/44494321 with connection pooling (the blog post is in Chinese but it translates well on chrome).

If you are specifically looking for ORM, then you can use https://phoenix.apache.org/phoenix_orm.html

Explorer

Thanks for your information.

I just have a look of the Phoenix ORM PHO, but I don't understand it very clearly.

Could you make an example for me?

For example, let says we have an entity class

class Person{

int id;

int name;

int age;

int sex;

}

And a RestController to accept a http post request. how could I use the PHO to receive the data and insert into Phoenix?

Thank you very much for your help

Bin Ye

; ;