IDEMPIERE-1132 Improve AD_Index; AD_View; foreign keys management - Enhance 2pack to make use of AD_TableIndex and AD_ViewComponent
This commit is contained in:
parent
bc37aab2e4
commit
ea8b457a51
|
@ -85,7 +85,6 @@ public class DatabaseViewValidate extends SvrProcess {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rs.close();
|
rs.close();
|
||||||
trx.close();
|
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder("CREATE OR REPLACE VIEW ").append(table.getTableName());
|
StringBuilder sb = new StringBuilder("CREATE OR REPLACE VIEW ").append(table.getTableName());
|
||||||
//
|
//
|
||||||
|
|
|
@ -86,7 +86,6 @@ public class TableIndexValidate extends SvrProcess {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rs.close();
|
rs.close();
|
||||||
trx.close();
|
|
||||||
|
|
||||||
MIndexColumn[] indexCols = index.getColumns(true);
|
MIndexColumn[] indexCols = index.getColumns(true);
|
||||||
boolean modified = false;
|
boolean modified = false;
|
||||||
|
|
|
@ -156,9 +156,6 @@ public class TableElementHandler extends AbstractElementHandler {
|
||||||
log.log(Level.SEVERE, e.getLocalizedMessage(), e);
|
log.log(Level.SEVERE, e.getLocalizedMessage(), e);
|
||||||
trx.rollback();
|
trx.rollback();
|
||||||
return 0;
|
return 0;
|
||||||
} finally {
|
|
||||||
if (trx != null)
|
|
||||||
trx.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -15,6 +15,7 @@ import org.adempiere.pipo2.PoFiller;
|
||||||
import org.adempiere.pipo2.exception.DatabaseAccessException;
|
import org.adempiere.pipo2.exception.DatabaseAccessException;
|
||||||
import org.adempiere.pipo2.exception.POSaveFailedException;
|
import org.adempiere.pipo2.exception.POSaveFailedException;
|
||||||
import org.compiere.model.MIndexColumn;
|
import org.compiere.model.MIndexColumn;
|
||||||
|
import org.compiere.model.MMessage;
|
||||||
import org.compiere.model.MTableIndex;
|
import org.compiere.model.MTableIndex;
|
||||||
import org.compiere.model.X_AD_Package_Imp_Detail;
|
import org.compiere.model.X_AD_Package_Imp_Detail;
|
||||||
import org.compiere.process.TableIndexValidate;
|
import org.compiere.process.TableIndexValidate;
|
||||||
|
@ -100,9 +101,6 @@ public class TableIndexElementHandler extends AbstractElementHandler {
|
||||||
log.log(Level.SEVERE, e.getLocalizedMessage(), e);
|
log.log(Level.SEVERE, e.getLocalizedMessage(), e);
|
||||||
trx.rollback();
|
trx.rollback();
|
||||||
return 0;
|
return 0;
|
||||||
} finally {
|
|
||||||
if (trx != null)
|
|
||||||
trx.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -126,6 +124,14 @@ public class TableIndexElementHandler extends AbstractElementHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (createElement) {
|
if (createElement) {
|
||||||
|
if (m_TableIndex.getAD_Message_ID() > 0) {
|
||||||
|
try {
|
||||||
|
ctx.packOut.getHandler(MMessage.Table_Name).packOut(ctx.packOut, document, ctx.logDocument, m_TableIndex.getAD_Message_ID());
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new SAXException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
addTypeName(atts, "table");
|
addTypeName(atts, "table");
|
||||||
document.startElement("", "", MTableIndex.Table_Name, atts);
|
document.startElement("", "", MTableIndex.Table_Name, atts);
|
||||||
createTableIndexBinding(ctx, document, m_TableIndex);
|
createTableIndexBinding(ctx, document, m_TableIndex);
|
||||||
|
|
Loading…
Reference in New Issue