Postgres inet type [message #980721] |
Sun, 11 November 2012 18:05  |
Eclipse User |
|
|
|
So, using eclipselink and inet type is nicely cast to string when reading.
But on insert something is wrong:
Caused by: org.postgresql.util.PSQLException: ERROR: column "..." is of type inet but expression is of type character varying
Hint: You will need to rewrite or cast the expression.
So I must override using descriptor customizer? Is kinda strange since I can insert into that column the IP as normal string.
This gets generated, nothing special (And it dies):
Call: INSERT INTO "table" (columns ...) VALUES (?, ?, ?, ?, ?, ?, ?)
bind => [7 parameters bound]
And this WORKS:
INSERT INTO "table" (columns ...)
VALUES (... '127.0.0.1' ...);
So when I call an ordinary query I can pass inet field as standard string and it all works. When a prepared statement it called via eclipselink and inet is bound as a string everything dies. A bug certiainly, but is there any workaround or a trick to make it work? Converter doesn't seem to work.
|
|
|
|
|
|
|
|
Re: Postgres inet type [message #985744 is a reply to message #985698] |
Thu, 15 November 2012 17:14  |
Eclipse User |
|
|
|
Query hints apply only to the query they are added to, while if the propertiy is set in the persistence.xml it will apply to every query. So the @QueryHint neededs to be added within a named query annotation, not an entity. Example 4-27 needs improvement but I don't have an example handy at the moment, I'll try fixing the example tomorrow.
|
|
|
Powered by
FUDForum. Page generated in 0.04302 seconds