Is there a standard way to define a JPA entity that has columns with PostgreSQL network address data types? Im using OpenJPA
+2
A:
I can't say for certain, but section 2.2 of JSR-317 (3-13-2009 Proposed Final Draft) says:
The persistent fields or properties of an entity may be of the following types: Java primitive types; java.lang.String; .... and user-defined types that implement the Serializable interface); ...
I read that to mean that any types that implement Serializable and are annotated with the @Basic annotation should work. (I assume you already tried this...?) If that doesn't work, I'd suggest posting the question to the OpenJPA mailing list.
-Rick
Rick
2009-07-01 13:52:46
+1
A:
Have you tried:
@Column( columnDefinition="cidr" )
public String getAddress()
{
return address;
}
mtpettyp
2009-07-01 21:10:00
The thing is I haven't tried anything, just asked the question. This was the first thing that came to my mind too.
Vasil
2009-07-02 13:17:13