Notes
![]() ![]() Notes - notes.io |
import com.informatica.mdm.api.put.ActionType;
import com.informatica.mdm.ue.persistid.PersistId;
import com.informatica.mdm.ue.persistid.PersistIdExceptions;
import com.informatica.mdm.userexit.PostLoadUserExit;
import com.informatica.mdm.userexit.UserExitContext;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
public class PostLoad implements PostLoadUserExit {
private static final Logger log = Logger.getLogger(PostLoad.class.getName());
private static final String _simpleClassName = PostLoad.class.getSimpleName();
private Connection conn = null;
public void processUserExit(UserExitContext userExitContext, ActionType actionType, Map<String, Object> boDataMap, Map<String, Object> xrefDataMap, List<Map<String, Object>> xrefDataMapList) throws Exception {
log.debug("Invoking " + PersistId.class.getSimpleName());
long startTime = System.currentTimeMillis();
PersistId persistId = new PersistId(PersistId.UserExitType.POST_LOAD, userExitContext, actionType,
boDataMap, xrefDataMap, xrefDataMapList);
String boTable = null;
Statement statement = null;
ResultSet rs = null;
boTable = userExitContext.getTableName().toString();
log.debug("Format EID:" + userExitContext.getTableName());
if (boTable.equalsIgnoreCase("C_BO_PRTY"))
try {
this.conn = userExitContext.getDBConnection();
String stQuery = "Update TCR_HUB.C_BO_PRTYrnset prty_id = CONCAT('MC',x_partyid_cal)rnwhere substr(last_update_date,1,9) = (select trunc (max(last_update_date)) from TCR_HUB.C_BO_PRTY )";
String stQuery1 = "Update TCR_HUB.C_BO_PRTY_XREFrnset prty_id = CONCAT('MC',x_partyid_cal)rnwhere substr(last_update_date,1,9) = (select trunc (max(last_update_date)) from TCR_HUB.C_BO_PRTY_XREF)";
statement = this.conn.createStatement();
statement.executeUpdate(stQuery);
statement.executeUpdate(stQuery1);
this.conn.commit();
} catch (Exception e) {
e.printStackTrace();
} finally {
if (statement != null)
try {
statement.close();
} catch (SQLException ex) {
statement = null;
}
}
if (boTable.equalsIgnoreCase("C_BO_PSTL_ADDR"))
try {
this.conn = userExitContext.getDBConnection();
String stQuery = "Update TCR_HUB.C_BO_PSTL_ADDRrnset X_ADDR_ID = CONCAT('ML',X_ADDR_ID_CAL )rnwhere substr(last_update_date,1,9) = (select trunc (max(last_update_date)) from TCR_HUB.C_BO_PSTL_ADDR)";
String stQuery1 = "Update TCR_HUB.C_BO_PSTL_ADDR_XREFrnset X_ADDR_ID = CONCAT('ML',X_ADDR_ID_CAL )rnwhere substr(last_update_date,1,9) = (select trunc (max(last_update_date)) from TCR_HUB.C_BO_PSTL_ADDR_XREF)";
statement = this.conn.createStatement();
statement.executeUpdate(stQuery);
statement.executeUpdate(stQuery1);
this.conn.commit();
} catch (Exception e) {
e.printStackTrace();
} finally {
if (statement != null)
try {
statement.close();
} catch (SQLException ex) {
statement = null;
}
}
if (boTable.equalsIgnoreCase("C_BR_PRTY_RLE_PSTL_ADDR"))
try {
this.conn = userExitContext.getDBConnection();
String stQuery = "Update TCR_HUB.C_BR_PRTY_RLE_PSTL_ADDRrnset X_PSTL_ADDR_ID = CONCAT('MCL',X_PSTL_ADDR_ID_CAL)rnwhere substr(last_update_date,1,9) = (select trunc (max(last_update_date)) from TCR_HUB.C_BR_PRTY_RLE_PSTL_ADDR)";
String stQuery1 = "Update TCR_HUB.C_BR_PRTY_RLE_PSTL_ADDR_xrefrnset X_PSTL_ADDR_ID = CONCAT('MCL',X_PSTL_ADDR_ID_CAL)rnwhere substr(last_update_date,1,9) = (select trunc (max(last_update_date)) from TCR_HUB.C_BR_PRTY_RLE_PSTL_ADDR_xref)";
statement = this.conn.createStatement();
statement.executeUpdate(stQuery);
statement.executeUpdate(stQuery1);
this.conn.commit();
} catch (Exception e) {
e.printStackTrace();
} finally {
if (statement != null)
try {
statement.close();
} catch (SQLException ex) {
statement = null;
}
}
try {
persistId.executePersistId();
} catch (PersistIdExceptions pidEx) {
log.warn(String.valueOf(PersistId.class.getSimpleName()) +
" Return Code: " + pidEx.getReturnCode() + " Error Message: " + pidEx.getMessage());
log.error("Aborting " + PersistId.class.getSimpleName());
long l = System.currentTimeMillis();
log.debug(String.valueOf(_simpleClassName) + " PersistId run for: " + (l - startTime) + " ms");
throw new Exception(pidEx.getMessage());
} catch (Exception ex) {
log.error("Aborting " + PersistId.class.getSimpleName() +
"; Return Code: " + persistId.getReturnCode() + "; Return Message: " + persistId.getReturnMessage());
long l = System.currentTimeMillis();
log.debug(String.valueOf(_simpleClassName) + " PersistId run for: " + (l - startTime) + " ms on rowidObject '" + boDataMap.get("ROWID_OBJECT") + "'");
throw new Exception(ex);
}
log.debug("Completed " + _simpleClassName +
" Return Code: " + persistId.getReturnCode() + " Error Message: " + persistId.getReturnMessage());
long endTime = System.currentTimeMillis();
log.debug(String.valueOf(_simpleClassName) + " PersistId Completed in: " + (endTime - startTime) + " ms on rowidObject '" + boDataMap.get("ROWID_OBJECT") + "'");
}
}
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team