Re: Plans to implement ResultSet.getObject(String columnLabel, java.util.Map<String,Class<?>> map) ?

Andreas Joseph Krogh <[email protected]> Fri, 10 Jan 2020 18:36:06 +0100 (CET)
Newsgroups gmane.comp.db.postgresql.jdbc
Message-ID <VisenaEmail.48.ccc6455d1aab5d49.16f90827a7c@tc7-visena>
------=_Part_320_240052270.1578677766364
Content-Type: multipart/related; 
	boundary="----=_Part_321_1147090640.1578677766365"

------=_Part_321_1147090640.1578677766365
Content-Type: multipart/alternative; 
	boundary="----=_Part_322_518373485.1578677766383"

------=_Part_322_518373485.1578677766383
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable


P=C3=A5 fredag 10. januar 2020 kl. 18:27:55, skrev Dave Cramer <pg@fastcryp=
t.com=20
<mailto:[email protected]>>:=20



On Fri, 10 Jan 2020 at 12:27, Andreas Joseph Krogh <[email protected]=20
<mailto:[email protected]>> wrote:=20
P=C3=A5 fredag 10. januar 2020 kl. 16:02:39, skrev Dave Cramer <pg@fastcryp=
t.com=20
<mailto:[email protected]>>:=20
There is a patch buried in the myriad of pull requests that is looking at t=
his.

What would be your MVP here ?=20

MVP?=20

Minimal Viable Product=20



Well, that it "works" so that when I specify:=20

 rs.getObject("requirement_cell", SQLUtils.typeMap)=20

and ProcessRequirementTaskCellJdbcData is in typeMap:=20

 h.put("processrequirementtaskcellinfo", classOf[
ProcessRequirementTaskCellJdbcData])=20

Which maps to the PG-type:=20

create type ProcessRequirementTaskCellInfo as (task_id bigint, task_version=
=20
bigint, task_status_id integer , task_resolution_id integer, task_descripti=
on=20
varchar, task_last_modified timestamp, phase_closed_status_id bigint,=20
requirement_template_idbigint);=20

And in the query:=20

select ROW(...)::ProcessRequirementTaskCellInfo=20

FWIW; his works in pgjdbc-ng, also with nesting, having types used as field=
s=20
in types...=20

Hope this helps...=20

--=20
Andreas Joseph Krogh=20
CTO / Partner - Visena AS=20
Mobile: +47 909 56 963=20
[email protected] <mailto:[email protected]>=20
www.visena.com <https://www.visena.com>=20
 <https://www.visena.com>=20

------=_Part_322_518373485.1578677766383
Content-Type: text/html;charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div>P=C3=A5 fredag 10. januar 2020 kl. 18:27:55, skrev Dave Cramer &lt;<a =
href=3D"mailto:[email protected]">[email protected]</a>&gt;:</div>

<blockquote style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt=
 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir=3D"ltr">
<div dir=3D"ltr">=C2=A0</div>
=C2=A0

<div class=3D"gmail_quote">
<div class=3D"gmail_attr" dir=3D"ltr">On Fri, 10 Jan 2020 at 12:27, Andreas=
 Joseph Krogh &lt;<a href=3D"mailto:[email protected]">[email protected]<=
/a>&gt; wrote:</div>

<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex">
<div>P=C3=A5 fredag 10. januar 2020 kl. 16:02:39, skrev Dave Cramer &lt;<a =
href=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a>&gt;=
:</div>

<blockquote style=3D"border-left:1px solid rgb(204,204,204);margin:0pt 0pt =
0pt 0.8ex;padding-left:1ex">
<div dir=3D"ltr">There is a patch buried in the myriad of pull requests tha=
t is looking at this.
<div>=C2=A0</div>

<div>What would be your MVP here ?</div>
</div>
</blockquote>

<div>=C2=A0</div>

<div>MVP?</div>
</blockquote>

<div>=C2=A0</div>

<div>Minimal Viable Product</div>
</div>
</div>
</blockquote>

<div class=3D"visena-email-signature" data-visena-message-id=3D"&lt;VisenaE=
mail.48.ccc6455d1aab5d49.16f90827a7c@tc7-visena>">
<div>
<div>=C2=A0</div>

<div>Well, that it &quot;works&quot; so that when I specify:</div>

<div>=C2=A0</div>

<div>
<pre style=3D"color: rgb(0, 0, 0); font-family: &quot;DejaVu Sans Mono&quot=
;;">
rs.getObject(<span style=3D"color:#008000;font-weight:bold;">&quot;requirem=
ent_cell</span><span style=3D"color:#008000;font-weight:bold;">&quot;</span=
>, <span style=3D"color:#7f0000;">SQLUtils</span>.<span style=3D"color:#660=
e7a;font-style:italic;">typeMap</span>)</pre>

<div>=C2=A0</div>

<div>and=C2=A0ProcessRequirementTaskCellJdbcData is in typeMap:</div>

<div>=C2=A0</div>

<div>
<pre style=3D"color: rgb(0, 0, 0); font-family: &quot;DejaVu Sans Mono&quot=
;;">
h.put(<span style=3D"color:#008000;font-weight:bold;">&quot;processrequirem=
enttaskcellinfo&quot;</span>, <span style=3D"font-style:italic;">classOf</s=
pan>[<span style=3D"color:#7f0000;font-weight:bold;">ProcessRequirementTask=
CellJdbcData</span>])
</pre>
</div>
</div>

<div>=C2=A0</div>

<div>Which maps to the PG-type:</div>

<div>=C2=A0</div>

<div>
<pre style=3D"color: rgb(0, 0, 0); font-family: &quot;DejaVu Sans Mono&quot=
;;">
<span style=3D"color:#000080;font-weight:bold;">create type </span>ProcessR=
equirementTaskCellInfo <span style=3D"color:#000080;font-weight:bold;">as <=
/span>(task_id <span style=3D"color:#000080;font-weight:bold;">bigint</span=
>, task_version <span style=3D"color:#000080;font-weight:bold;">bigint</spa=
n>, task_status_id <span style=3D"color:#000080;font-weight:bold;">integer
</span><span style=3D"color:#000080;font-weight:bold;">    </span>, task_re=
solution_id <span style=3D"color:#000080;font-weight:bold;">integer</span>,=
 task_description <span style=3D"color:#000080;font-weight:bold;">varchar</=
span>, task_last_modified <span style=3D"color:#000080;font-weight:bold;">t=
imestamp</span>, phase_closed_status_id <span style=3D"color:#000080;font-w=
eight:bold;">bigint</span>, requirement_template_id <span style=3D"color:#0=
00080;font-weight:bold;">bigint</span>);
</pre>

<div>=C2=A0</div>

<div>And in the query:</div>

<div>=C2=A0</div>

<div>select ROW(...)::ProcessRequirementTaskCellInfo</div>

<div>=C2=A0</div>

<div>FWIW; his works in pgjdbc-ng, also with nesting, having types used as =
fields in types...</div>
</div>

<div>=C2=A0</div>

<div>Hope this helps...</div>

<div>=C2=A0</div>

<div>--</div>

<div><span style=3D"font-family:arial,helvetica,sans-serif;"><strong>Andrea=
s Joseph Krogh</strong></span></div>

<div><span style=3D"font-family:arial,helvetica,sans-serif;">CTO / Partner<=
/span> - Visena AS</div>

<div><span style=3D"font-family:arial,helvetica,sans-serif;">Mobile: +47 90=
9 56 963</span></div>

<div><a href=3D"mailto:[email protected]">[email protected]</a></div>

<div><a href=3D"https://www.visena.com">www.visena.com</a></div>

<div style=3D"padding-top: 5px"><a href=3D"https://www.visena.com"><img alt=
=3D"" src=3D"cid:part_F889667436576CR2KCA"></a></div>
</div>
</div>

<div>=C2=A0</div>
------=_Part_322_518373485.1578677766383--

------=_Part_321_1147090640.1578677766365
Content-Type: image/png
Content-Transfer-Encoding: base64
Content-Disposition: inline
Content-ID: <part_F889667436576CR2KCA>

iVBORw0KGgoAAAANSUhEUgAAAIUAAAAYCAYAAADUIj6hAAAABHNCSVQICAgIfAhkiAAABzBJREFU
aEPtmNFxHDcMhmVP3i1VECpvnjzkVIHWFfhcgVcVRKrAUgWRK/C6Al8H3lTgy0PGbzFdQc4VJP/H
ADs43q6kROeJNbOYgQACIAgCWJKng4MZ5gxUGXh0U0b+SIuF9G+EWXj2Q15vbrE/NPtk9uub7Gfd
t5mBx1NhqSEo8HshjbEUtlO2yIM9tsx5dZP9rPt2MzDZFAqZE4LGcFjdsg3saQaHt7fY70X949On
aS+OZidDBkavD33157L4xaw2os+Mp/DAC10l2XhOCeStj0W5ajrJL8WfCi80Xgf9vVlrhg9yRONe
/f7xI2vNsIcM7JwU9o6oGyJrLT8JOA1aX9sKP4wl94bAniukEbo/n7YPmuTETzIab4Y9ZWCrKexd
8M58lxPCvvD6aihfvexbEQoPYO8NQRO0JnddGO6FJYaVsBde7cXj7KRk4LsqDxQzCYeGsJNgaXZe
+JXkyGgWINq3Gp+bHNILz+wEYs5qH1eJrouNrpDXtk4O6x1IvtD40GWyJYYdkF0jIbYZlN16xygI
gl9smbMDsmFdfAKb23xGB8H/mv3tOJfArs1kukk79DEPdQ5u0g1vCvvqKXIW8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