关于Eclipse生成和导入Patch文件.

简介:

&

生成的文件如下:

如果系统对这个patch文件有识别的话是一个带有问号的icon文件.

 

复制代码
 1 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
 2 index a5f97fd..8e7cb2f 100644
 3 --- a/main/plugins/org.talend.designer.core/src/main/java/org/talend/designer/core/model/metadata/MetadataEmfFactory.java
 4 +++ b/main/plugins/org.talend.designer.core/src/main/java/org/talend/designer/core/model/metadata/MetadataEmfFactory.java
 5 @@ -73,9 +73,9 @@ public class MetadataEmfFactory {
 6                  colType.setComment(metaCol.getComment());
 7                  colType.setKey(metaCol.isKey());
 8                  colType.setNullable(metaCol.isNullable());
 9 -                if (metaCol.getLength() == null) {
10 -                    // colType.setLength(-1);
11 -                    colType.unsetLength();
12 +                if (metaCol.getLength() == null || metaCol.getLength().intValue() < 0) {
13 +                    colType.setLength(-1);
14 +                    // colType.unsetLength();
15                  } else {
16                      colType.setLength(metaCol.getLength());
17                  }
18 @@ -90,9 +90,9 @@ public class MetadataEmfFactory {
19                  }
20  
21                  colType.setName(metaCol.getLabel());
22 -                if (metaCol.getPrecision() == null) {
23 -                    // colType.setPrecision(-1);
24 -                    colType.unsetPrecision();
25 +                if (metaCol.getPrecision() == null || metaCol.getPrecision().intValue() < 0) {
26 +                    colType.setPrecision(-1);
27 +                    // colType.unsetPrecision();
28                  } else {
29                      colType.setPrecision(metaCol.getPrecision());
30                  }
31 @@ -144,12 +144,8 @@ public class MetadataEmfFactory {
32              metaCol.setComment(colType.getComment());
33              metaCol.setKey(colType.isKey());
34              metaCol.setNullable(colType.isNullable());
35 -            if (colType.isSetLength()) {
36 -                if (colType.getLength() >= 0) {
37 -                    metaCol.setLength(new Integer(colType.getLength()));
38 -                } else {
39 -                    metaCol.setLength(null);
40 -                }
41 +            if (colType.getLength() >= 0) {
42 +                metaCol.setLength(new Integer(colType.getLength()));
43              } else {
44                  metaCol.setLength(null);
45              }
46 @@ -168,12 +164,8 @@ public class MetadataEmfFactory {
47                  }
48              }
49              metaCol.setLabel(colType.getName());
50 -            if (colType.isSetPrecision()) {
51 -                if (colType.getPrecision() >= 0) {
52 -                    metaCol.setPrecision(new Integer(colType.getPrecision()));
53 -                } else {
54 -                    metaCol.setPrecision(null);
55 -                }
56 +            if (colType.getPrecision() >= 0) {
57 +                metaCol.setPrecision(new Integer(colType.getPrecision()));
58              } else {
59                  metaCol.setPrecision(null);
60              }
复制代码

 


本文转自SummerChill博客园博客,原文链接:http://www.cnblogs.com/DreamDrive/p/4694200.html,如需转载请自行联系原作者

相关文章
|
5月前
|
SQL Java 应用服务中间件
Eclipse导入项目的配置步骤说明
Eclipse导入项目的配置步骤说明
137 0
Eclipse导入项目的配置步骤说明
|
7月前
|
Java 应用服务中间件 Android开发
eclipse项目导入到idea
eclipse项目导入到idea
202 0
|
8月前
|
Java Android开发
【Eclipse】eclipse中让Button选择的文件显示在文本框里
【Eclipse】eclipse中让Button选择的文件显示在文本框里
56 0
|
5月前
|
前端开发 数据库 Android开发
修改Eclipse文件连接数据库
修改Eclipse文件连接数据库
22 0
|
5月前
|
Java 应用服务中间件 Android开发
IDEA Eclipse项目如何导入tomcat里面的jar包
IDEA Eclipse项目如何导入tomcat里面的jar包
63 0
|
6月前
|
IDE Java Apache
Eclipse 安装了 Groovy 开发插件之后,双击打不开 .java 文件了
Eclipse 安装了 Groovy 开发插件之后,双击打不开 .java 文件了
42 0
|
7月前
|
Java Android开发
eclipse中Java文件生成jar包
eclipse中Java文件生成jar包
47 0
|
9月前
|
API Android开发 数据安全/隐私保护
Android(三) 基于 eclipse 的 Android配置 APK文件的导出
Android(三) 基于 eclipse 的 Android配置 APK文件的导出
|
9月前
|
开发工具 Android开发 git
|
10月前
|
应用服务中间件 Android开发
eclipse导入tomcat步骤
eclipse导入tomcat步骤
200 0