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:
Elaine Tan 2013-07-24 10:49:30 +08:00
parent bc37aab2e4
commit ea8b457a51
4 changed files with 9 additions and 8 deletions

View File

@ -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());
// //

View File

@ -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;

View File

@ -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;

View File

@ -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);