diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ColumnElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ColumnElementHandler.java index 5a77931450..8a0b8da4be 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ColumnElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ColumnElementHandler.java @@ -312,7 +312,7 @@ public class ColumnElementHandler extends AbstractElementHandler { filler.add("AD_Column_ID", new AttributesImpl()); filler.addString("IsSyncDatabase", "Y", new AttributesImpl()); - filler.addTableReference("AD_Table", "TableName", new AttributesImpl()); + filler.addTableReference("AD_Table_ID", "TableName", new AttributesImpl()); filler.addTableReference("AD_Reference_Value_ID", "AD_Reference", new AttributesImpl()); excludes.add("IsSyncDatabase"); diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/PoExporter.java b/org.adempiere.pipo/src/org/adempiere/pipo2/PoExporter.java index 558b689d0e..0c147f733c 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/PoExporter.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/PoExporter.java @@ -159,7 +159,7 @@ public class PoExporter { } public void addTableReference(String columnName, String tableName, AttributesImpl atts) { - int id = po.get_Value(columnName) != null ? (Integer)po.get_Value(columnName) : 0; + int id = po.get_Value(columnName) != null ? (Integer)po.get_Value(columnName) : -1; addTableReference(columnName, tableName, id, atts); } diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/ReferenceUtils.java b/org.adempiere.pipo/src/org/adempiere/pipo2/ReferenceUtils.java index b520b02284..6fe91a5dc9 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/ReferenceUtils.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/ReferenceUtils.java @@ -72,9 +72,9 @@ public class ReferenceUtils { String value = Integer.toString(id); return value; } - else if (id == 0) + else if (id <= 0) { - //no id, should never happen + //no id, -1 indicates it was read a null atts.addAttribute("", "", "reference", "CDATA", "id"); return ""; }