Browse Source

added default column value

tags/v1.1.0
Robin Thoni 8 years ago
parent
commit
a4783c942c

+ 2
- 0
.gitignore View File

1
+*.zip
2
+
1
 # Created by .ignore support plugin (hsz.mobi)
3
 # Created by .ignore support plugin (hsz.mobi)
2
 ### Java template
4
 ### Java template
3
 *.class
5
 *.class

+ 1
- 0
src/com/rthoni/intellij/codefromds/business/Generator.java View File

112
         dbo.setNotNull(columnSelection.getColumn().isNotNull());
112
         dbo.setNotNull(columnSelection.getColumn().isNotNull());
113
         dbo.setType(convertSqlType(columnSelection.getColumn().getDataType(), options));
113
         dbo.setType(convertSqlType(columnSelection.getColumn().getDataType(), options));
114
         dbo.setTypeNotNull(options.getNonNullableTypes().contains(dbo.getType()));
114
         dbo.setTypeNotNull(options.getNonNullableTypes().contains(dbo.getType()));
115
+        dbo.setDefaultValue(columnSelection.getColumn().getDefault());
115
 
116
 
116
         return dbo;
117
         return dbo;
117
     }
118
     }

+ 21
- 0
src/com/rthoni/intellij/codefromds/dbo/template/ColumnDataSourceDbo.java View File

1
 package com.rthoni.intellij.codefromds.dbo.template;
1
 package com.rthoni.intellij.codefromds.dbo.template;
2
 
2
 
3
+import org.apache.commons.lang.StringEscapeUtils;
4
+
3
 /**
5
 /**
4
  * Created by robin on 11/18/16.
6
  * Created by robin on 11/18/16.
5
  */
7
  */
17
 
19
 
18
     private boolean _typeNotNull;
20
     private boolean _typeNotNull;
19
 
21
 
22
+    private String _defaultValue;
23
+
20
     public String getName() {
24
     public String getName() {
21
         return _name;
25
         return _name;
22
     }
26
     }
64
     public void setTypeNotNull(boolean typeNotNull) {
68
     public void setTypeNotNull(boolean typeNotNull) {
65
         _typeNotNull = typeNotNull;
69
         _typeNotNull = typeNotNull;
66
     }
70
     }
71
+
72
+    public String getDefaultValue() {
73
+        return _defaultValue;
74
+    }
75
+
76
+    public String getDefaultValueEscaped() {
77
+        return StringEscapeUtils.escapeJava(_defaultValue);
78
+    }
79
+
80
+    public boolean hasDefaultValue()
81
+    {
82
+        return _defaultValue != null && !_defaultValue.equals("");
83
+    }
84
+
85
+    public void setDefaultValue(String defaultValue) {
86
+        _defaultValue = defaultValue;
87
+    }
67
 }
88
 }

Loading…
Cancel
Save