Hiber.commit();
s.doWork(new Work() {
public void execute(Connection con) throws SQLException {
try {
CopyManager cm = new CopyManager(con
.unwrap(BaseConnection.class));
String[][] mddArray = {
{ "gsp_group", "GSP_Group" },
{ "pc", "Profile_Class" },
{ "market_role", "Market_Role" },
{ "participant", "Market_Participant" },
{ "party", "Market_Participant_Role-party" },
{ "provider", "Market_Participant_Role-provider" },
{ "dno", "Market_Participant_Role-dno" },
{ "llfc", "Line_Loss_Factor_Class" },
{ "meter_type", "MTC_Meter_Type" },
{ "meter_payment_type", "MTC_Payment_Type" },
{ "mtc", "Meter_Timeswitch_Class" },
{ "tpr", "Time_Pattern_Regime" },
{ "clock_interval", "Clock_Interval" },
{ "ssc", "Standard_Settlement_Configuration" },
{ "measurement_requirement",
"Measurement_Requirement" } };
for (String[] impArray : mddArray) {
cm.copyIn(
"COPY " + impArray[0]
+ " FROM STDIN CSV HEADER",
context.getResource(
"/WEB-INF/mdd/" + impArray[1] + ".csv")
.openStream());