From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-jdbc@lists.postgresql.org
Subject: Re: (How to) Make SQLData of UUID?
Date: Mon, 22 Jul 2019 08:22:16 +0200
Message-ID: <bc8fde4a-2bbf-e8a3-a542-bb9f71520593@gmx.net> (raw)
In-Reply-To: <CAHF95JwePa0h38KsWRm-jTbQAdKcbjRrGAQuzHK1JSG8u9guOQ@mail.gmail.com>
References: <CAHF95JzG9dAJnmjR000VQMeyLb1+4JsyffDQcSQ5h2LrNTaqHA@mail.gmail.com>
<C9651950-4F9D-47FF-80CA-631ECAC02A65@gmail.com>
<CAHF95JwePa0h38KsWRm-jTbQAdKcbjRrGAQuzHK1JSG8u9guOQ@mail.gmail.com>
Alexander Myodov schrieb am 22.07.2019 um 01:43:
> The problem is not in making a PL/PgSQL function returning an UUID.
> Or even returning a custom type containing an UUID (like
> MYFUNC_RETURN_TYPE in my case). The problem is on Java level, when I
> need to make a Java handler/mapping of PostgreSQL custom type (which
> contains an UUID internally).
You don't need a wrapper.
ResultSet.getObject(1, UUID.class)
and
PreparedStatement.setObject(1, someUUID);
will work just fine.
Thomas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: spam_eater@gmx.net
Subject: Re: (How to) Make SQLData of UUID?
In-Reply-To: <bc8fde4a-2bbf-e8a3-a542-bb9f71520593@gmx.net>
References: <CAHF95JzG9dAJnmjR000VQMeyLb1+4JsyffDQcSQ5h2LrNTaqHA@mail.gmail.com> <C9651950-4F9D-47FF-80CA-631ECAC02A65@gmail.com> <CAHF95JwePa0h38KsWRm-jTbQAdKcbjRrGAQuzHK1JSG8u9guOQ@mail.gmail.com> <bc8fde4a-2bbf-e8a3-a542-bb9f71520593@gmx.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox