6

i would like to write an hibernate dialect for Apache Phoenix. The huge problem is that the keyword of an insert statement is "Upsert" instead of "Insert". This keyword is declared at org.hibernate.sql.Insert. Is there a possibility to write an dialect for Apache Phoenix ?

Source http://phoenix.apache.org/language/index.html#upsert_values

Kind regards

nickel671
  • 61
  • 2

2 Answers2

0

I found a theoretical solution. The easiest way is to override the jdbc created by apache phoenix. You have to override exceuteQuery() and updateQuery() functions.There you have to replace "insert" and "update" with "upsert". What do you think? I didn't test it yet.

nickel671
  • 61
  • 2
  • Hey, I have just been thinking about this same issue and found your post - did you manage to successfully build a hibernate dialect? – Matt Mar 02 '15 at 17:06
0

this seems to work pretty well if you are ok with using the "fat" phoenix client: https://github.com/jruesga/phoenix-hibernate-dialect

tony_k
  • 1,983
  • 2
  • 20
  • 27