&
生成的文件如下:
如果系统对这个patch文件有识别的话是一个带有问号的icon文件.
diff --git a/main/plugins/org.talend.designer.core/src/main/java/org/talend/designer/core/model/metadata/MetadataEmfFactory.java b/main/plugins/org.talend.designer.core/src/main/java/org/talend/designer/core/model/metadata/MetadataEmfFactory.java
index a5f97fd..8e7cb2f 100644
--- a/main/plugins/org.talend.designer.core/src/main/java/org/talend/designer/core/model/metadata/MetadataEmfFactory.java
+++ b/main/plugins/org.talend.designer.core/src/main/java/org/talend/designer/core/model/metadata/MetadataEmfFactory.java
@@ -73,9 +73,9 @@ public class MetadataEmfFactory {
colType.setComment(metaCol.getComment());
colType.setKey(metaCol.isKey());
colType.setNullable(metaCol.isNullable());
- if (metaCol.getLength() == null) {
- // colType.setLength(-1);
- colType.unsetLength();
+ if (metaCol.getLength() == null || metaCol.getLength().intValue() < 0) {
+ colType.setLength(-1);
+ // colType.unsetLength();
} else {
colType.setLength(metaCol.getLength());
}
@@ -90,9 +90,9 @@ public class MetadataEmfFactory {
} colType.setName(metaCol.getLabel());
- if (metaCol.getPrecision() == null) {
- // colType.setPrecision(-1);
- colType.unsetPrecision();
+ if (metaCol.getPrecision() == null || metaCol.getPrecision().intValue() < 0) {
+ colType.setPrecision(-1);
+ // colType.unsetPrecision();
} else {
colType.setPrecision(metaCol.getPrecision());
}
@@ -144,12 +144,8 @@ public class MetadataEmfFactory {
metaCol.setComment(colType.getComment());
metaCol.setKey(colType.isKey());
metaCol.setNullable(colType.isNullable());
- if (colType.isSetLength()) {
- if (colType.getLength() >= 0) {
- metaCol.setLength(new Integer(colType.getLength()));
- } else {
- metaCol.setLength(null);
- }
+ if (colType.getLength() >= 0) {
+ metaCol.setLength(new Integer(colType.getLength()));
} else {
metaCol.setLength(null);
}
@@ -168,12 +164,8 @@ public class MetadataEmfFactory {
}
}
metaCol.setLabel(colType.getName());
- if (colType.isSetPrecision()) {
- if (colType.getPrecision() >= 0) {
- metaCol.setPrecision(new Integer(colType.getPrecision()));
- } else {
- metaCol.setPrecision(null);
- }
+ if (colType.getPrecision() >= 0) {
+ metaCol.setPrecision(new Integer(colType.getPrecision()));
} else {
metaCol.setPrecision(null);
}