<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div>Hi,<br>what is your use case for these queries? Maybe there is better supported API for your use case instead of relying on implementation details which may change between releases. <br></div><div><br><pre style="white-space: pre-wrap; overflow-wrap: break-word !important; color: #000000; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-mce-style="white-space: pre-wrap; overflow-wrap: break-word !important; color: #000000; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">--
Anton Tkáčik
Software Developer
evolveum.com </pre><br><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><b>From: </b>"midPoint General Discussion" <midpoint@lists.evolveum.com><br><b>To: </b>"midPoint General Discussion" <midPoint@lists.evolveum.com><br><b>Cc: </b>"Ashwill, Steven L" <sashwill@uillinois.edu><br><b>Sent: </b>Tuesday, February 27, 2024 9:54:58 PM<br><b>Subject: </b>[midPoint] switching from SQL server to Postgres<br></div><div><br><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style></div><div data-marker="__QUOTED_TEXT__">
<div class="WordSection1">
<p class="MsoNormal">This works when using SQL server. We have this code in one of our resources to query shadow records:</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">SessionFactory sqlService = (SessionFactory) SpringApplicationContextHolder.getApplicationContext().getBean("sessionFactory");</p>
<p class="MsoNormal">Session session = sqlService.openSession();</p>
<p class="MsoNormal"> try{<!-- --></p>
<p class="MsoNormal"> Transaction tx = session.beginTransaction();</p>
<p class="MsoNormal"> Query dnQuery = session.createSQLQuery(query).addScalar("<span style="background:yellow">name_orig</span>",StandardBasicTypes.STRING);</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">When we switch to the postgres(native) version I get an error that the session is not found(column name changes to
<span style="background:yellow">nameorig</span> ). Should this work in native mode or how do I get a session?</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">As always, any help is appreciated. </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><b><span style="color:#13294b;text-transform:uppercase">STEVEN L ASHWILL</span></b><span style="color:black"><br>
<br>
</span></p>
<p class="MsoNormal"> </p>
</div>
<br>_______________________________________________<br>midPoint mailing list<br>midPoint@lists.evolveum.com<br>https://lists.evolveum.com/mailman/listinfo/midpoint<br></div></div></body></html>