<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><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;}
@font-face
{font-family:Aptos;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 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;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
mso-ligatures:standardcontextual;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Aptos",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Aptos",sans-serif">Found a solution by adding a helper bean to the context and calling an external method in it, but I would prefer an API or native solution you might say for the reason you said.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Aptos",sans-serif">Our use case is that one of the AD managers at a university in our system will move employees and students to an ou=”To Be Deleted” before midpoint is told about it. This is our attempt to find
the matching records in the shadows so that midpoint doesn’t try to insert the record again on a reconcile. Unfortunately it does not work all the time.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Aptos",sans-serif"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="mso-ligatures:none">From:</span></b><span style="mso-ligatures:none"> Tony Tkacik <tony.tkacik@evolveum.com>
<br>
<b>Sent:</b> Thursday, February 29, 2024 2:29 AM<br>
<b>To:</b> midPoint General Discussion <midpoint@lists.evolveum.com><br>
<b>Cc:</b> midPoint General Discussion <midPoint@lists.evolveum.com>; Ashwill, Steven L <sashwill@uillinois.edu><br>
<b>Subject:</b> Re: [midPoint] switching from SQL server to Postgres<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:black">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. </span><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:black;mso-ligatures:none"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:black"><br>
<br>
<o:p></o:p></span></p>
<pre style="background:white"><span style="font-size:12.0pt;color:black">-- <o:p></o:p></span></pre>
<pre style="background:white"><span style="font-size:12.0pt;color:black">Anton Tkáčik<o:p></o:p></span></pre>
<pre style="background:white"><span style="font-size:12.0pt;color:black">Software Developer<o:p></o:p></span></pre>
<pre style="background:white"><span style="font-size:12.0pt;color:black">evolveum.com <o:p></o:p></span></pre>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-family:"Arial",sans-serif;color:black">
<hr size="2" width="100%" align="center" id="zwchr">
</span></div>
<div>
<p class="MsoNormal"><b><span style="font-family:"Arial",sans-serif;color:black">From:
</span></b><span style="font-family:"Arial",sans-serif;color:black">"midPoint General Discussion" <<a href="mailto:midpoint@lists.evolveum.com">midpoint@lists.evolveum.com</a>><br>
<b>To: </b>"midPoint General Discussion" <<a href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>><br>
<b>Cc: </b>"Ashwill, Steven L" <<a href="mailto:sashwill@uillinois.edu">sashwill@uillinois.edu</a>><br>
<b>Sent: </b>Tuesday, February 27, 2024 9:54:58 PM<br>
<b>Subject: </b>[midPoint] switching from SQL server to Postgres<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:black;mso-ligatures:none"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black">This works when using SQL server. We have this code in one of our resources to query shadow records:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">SessionFactory sqlService = (SessionFactory) SpringApplicationContextHolder.getApplicationContext().getBean("sessionFactory");<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">Session session = sqlService.openSession();<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> try{<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> Transaction tx = session.beginTransaction();<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> Query dnQuery = session.createSQLQuery(query).addScalar("<span style="background:yellow">name_orig</span>",StandardBasicTypes.STRING);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">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?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">As always, any help is appreciated.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="color:#13294B;text-transform:uppercase">STEVEN L ASHWILL</span></b><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:black;mso-ligatures:none"><br>
_______________________________________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br>
<a href="https://urldefense.com/v3/__https:/lists.evolveum.com/mailman/listinfo/midpoint__;!!DZ3fjg!_V_g3XFQ5JEpV4oDAluCNPdoxZbPp-ThwPrB9xN0ybAxVYLbNsKrKq9wm33lhbe8hr8CtNK4aH3j0qT2y5-xosLK6P0$">https://lists.evolveum.com/mailman/listinfo/midpoint</a><o:p></o:p></span></p>
</div>
</div>
</div>
</body>
</html>