You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Krzysztof <ya...@gmail.com> on 2009/12/17 19:09:53 UTC
SQL_ARRAY support, primitive arrays native mapping.
Hello,
I am inclined to add full support of mapping primitive arrays onto native DB
arrays (Postgres first, then maybe for Oracle).
We would like to run SQL aggregations on a lot of double[] arrays and
mapping onto @Lob or @ElementCollection does not really work here.
It is a general question how to support new DB types. I know I will have to
implement either ValueHandler or a Strategy but I am unable to locate any
example how actually do this for normally non-supported native DB type...
Since primitive arrays are mapped to blobs, I'd think BlobValueHandler could
be an example, could you confirm this? SQL_ARRAY appears in a few places in
the code (i.e. DBDictionary), so it seems there is some infrastructure to
support SQL arrays but how to use it?
Should
org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
be extended too if I'd like to add schema synchronisation?
Some generic example in the documentation would be a real helper.
Best regards,
Krzysztof
--
View this message in context: http://n2.nabble.com/SQL-ARRAY-support-primitive-arrays-native-mapping-tp4182645p4182645.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
Re: SQL_ARRAY support, primitive arrays native mapping.
Posted by Krzysztof <ya...@gmail.com>.
In JDBC4 there are functions to create and set SQL arrays so this should not
be that complicated.
In Hibernate it's quite straightforward, have a look at:
https://www.hibernate.org/393.html
Could you please point me to a valid example for OpenJpa? This looks like a
perfect point for using advertised OpenJpa extensibility, does not it?
Best regards,
Krzysztof
Krzysztof wrote:
>
> Hello,
> I am inclined to add full support of mapping primitive arrays onto native
> DB arrays (Postgres first, then maybe for Oracle).
>
> We would like to run SQL aggregations on a lot of double[] arrays and
> mapping onto @Lob or @ElementCollection does not really work here.
>
> It is a general question how to support new DB types. I know I will have
> to implement either ValueHandler or a Strategy but I am unable to locate
> any example how actually do this for normally non-supported native DB
> type...
>
> Since primitive arrays are mapped to blobs, I'd think BlobValueHandler
> could be an example, could you confirm this? SQL_ARRAY appears in a few
> places in the code (i.e. DBDictionary), so it seems there is some
> infrastructure to support SQL arrays but how to use it?
>
> Should
> org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
> be extended too if I'd like to add schema synchronisation?
>
>
> Some generic example in the documentation would be a real helper.
>
> Best regards,
> Krzysztof
>
>
>
--
View this message in context: http://n2.nabble.com/SQL-ARRAY-support-primitive-arrays-native-mapping-tp4182645p4197345.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.