6

Question is quite simple: is there any JDO/JPA/anything else "object-to-DB" mapping tools that can handle PG arrays? Multi-dimensional arrays? Mostly of strings and integers/longs.

Second one: can it handle hstore column types?

I'm trying to implement something to handle these types in DataNucleus JDO, but still no result. The most impressive and simple to implement support I've seen so far is python's SQLAlchemy.

Igore Vitaller
  • 163
  • 2
  • 8

1 Answers1

2

First of, SQLAlchemy is awesome... All the stuff that others can't do out-of-the-box works like a charm in this ORM.

The solution that you might want involves Hibernate:

mapping a postgres array with hibernate might be interessting for you. Basically, all the suggestions you will see involve the writing of a UserType extension. This would also apply to Postgres Enums types (and probably hstore, but that would only be a guess). An example for such a userType could be found on the Hibernate forums. This in-depth article explains the interface fairly detailed. After writing the UserType, you only need to annotate the property and Hibernate will be able to do the mapping. In newer versions (I've used it with Hibernate 4.x) the interface has changed slightly, but nothing you can't figure out.

Community
  • 1
  • 1
DrColossos
  • 12,656
  • 3
  • 46
  • 67