author | František Kučera <franta-hg@frantovo.cz> |
Wed, 24 Sep 2014 22:53:30 +0200 | |
branch | v_0 |
changeset 178 | 5a5fc66f11b1 |
parent 155 | eb3676c6929b |
permissions | -rw-r--r-- |
16 | 1 |
/** |
2 |
* SQL-DK |
|
3 |
* Copyright © 2013 František Kučera (frantovo.cz) |
|
4 |
* |
|
5 |
* This program is free software: you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation, either version 3 of the License, or |
|
8 |
* (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
17 |
*/ |
|
1
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
18 |
package info.globalcode.sql.dk; |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
19 |
|
4
f5c3350f3d78
data/types CLI options parsing
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
20 |
import java.sql.Types; |
f5c3350f3d78
data/types CLI options parsing
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
21 |
|
1
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
22 |
/** |
155 | 23 |
* Parameter for {@linkplain SQLCommand} |
1
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
24 |
* |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
25 |
* @author Ing. František Kučera (frantovo.cz) |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
26 |
*/ |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
27 |
public class Parameter { |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
28 |
|
4
f5c3350f3d78
data/types CLI options parsing
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
29 |
/** |
f5c3350f3d78
data/types CLI options parsing
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
30 |
* @see Types |
f5c3350f3d78
data/types CLI options parsing
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
31 |
*/ |
68
574cd7fbb5b2
SQLType enum wrapper for java.sql.Types
František Kučera <franta-hg@frantovo.cz>
parents:
16
diff
changeset
|
32 |
public static final SQLType DEFAULT_TYPE = SQLType.VARCHAR; |
1
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
33 |
private Object value; |
68
574cd7fbb5b2
SQLType enum wrapper for java.sql.Types
František Kučera <franta-hg@frantovo.cz>
parents:
16
diff
changeset
|
34 |
private SQLType type; |
1
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
35 |
|
4
f5c3350f3d78
data/types CLI options parsing
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
36 |
public Parameter() { |
f5c3350f3d78
data/types CLI options parsing
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
37 |
} |
f5c3350f3d78
data/types CLI options parsing
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
38 |
|
68
574cd7fbb5b2
SQLType enum wrapper for java.sql.Types
František Kučera <franta-hg@frantovo.cz>
parents:
16
diff
changeset
|
39 |
public Parameter(Object value, SQLType type) { |
4
f5c3350f3d78
data/types CLI options parsing
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
40 |
this.value = value; |
f5c3350f3d78
data/types CLI options parsing
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
41 |
if (type == null) { |
f5c3350f3d78
data/types CLI options parsing
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
42 |
this.type = DEFAULT_TYPE; |
f5c3350f3d78
data/types CLI options parsing
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
43 |
} else { |
f5c3350f3d78
data/types CLI options parsing
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
44 |
this.type = type; |
f5c3350f3d78
data/types CLI options parsing
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
45 |
} |
f5c3350f3d78
data/types CLI options parsing
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
46 |
} |
f5c3350f3d78
data/types CLI options parsing
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
47 |
|
1
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
48 |
public Object getValue() { |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
49 |
return value; |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
50 |
} |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
51 |
|
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
52 |
public void setValue(Object value) { |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
53 |
this.value = value; |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
54 |
} |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
55 |
|
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
56 |
/** |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
57 |
* @see java.sql.Types |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
58 |
*/ |
68
574cd7fbb5b2
SQLType enum wrapper for java.sql.Types
František Kučera <franta-hg@frantovo.cz>
parents:
16
diff
changeset
|
59 |
public SQLType getType() { |
1
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
60 |
return type; |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
61 |
} |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
62 |
|
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
63 |
/** |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
64 |
* @see java.sql.Types |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
65 |
*/ |
68
574cd7fbb5b2
SQLType enum wrapper for java.sql.Types
František Kučera <franta-hg@frantovo.cz>
parents:
16
diff
changeset
|
66 |
public void setType(SQLType type) { |
1
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
67 |
this.type = type; |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
68 |
} |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
69 |
} |