views:

137

answers:

2

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
+1  A: 

Have you tried:

@Column( columnDefinition="cidr" )
public String getAddress()
{
    return address;
}
mtpettyp
The thing is I haven't tried anything, just asked the question. This was the first thing that came to my mind too.
Vasil