author | František Kučera <franta-hg@frantovo.cz> |
Thu, 26 Dec 2013 00:18:03 +0100 | |
branch | v_0 |
changeset 62 | 7a88ac6ba40c |
parent 49 | b4c74461d0f9 |
child 68 | 574cd7fbb5b2 |
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 |
|
49
b4c74461d0f9
support named parameters
František Kučera <franta-hg@frantovo.cz>
parents:
16
diff
changeset
|
20 |
import info.globalcode.sql.dk.configuration.NameIdentified; |
b4c74461d0f9
support named parameters
František Kučera <franta-hg@frantovo.cz>
parents:
16
diff
changeset
|
21 |
|
1
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
22 |
/** |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
23 |
* |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
24 |
* @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
|
25 |
*/ |
49
b4c74461d0f9
support named parameters
František Kučera <franta-hg@frantovo.cz>
parents:
16
diff
changeset
|
26 |
public class NamedParameter extends Parameter implements NameIdentified { |
1
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
27 |
|
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
28 |
private String name; |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
29 |
|
4
f5c3350f3d78
data/types CLI options parsing
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
30 |
public NamedParameter(String name, Object value, Integer type) { |
f5c3350f3d78
data/types CLI options parsing
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
31 |
super(value, type); |
f5c3350f3d78
data/types CLI options parsing
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
32 |
this.name = name; |
f5c3350f3d78
data/types CLI options parsing
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
33 |
} |
f5c3350f3d78
data/types CLI options parsing
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
34 |
|
1
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
35 |
public String getName() { |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
36 |
return name; |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
37 |
} |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
38 |
|
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
39 |
public void setName(String name) { |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
40 |
this.name = name; |
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
41 |
} |
49
b4c74461d0f9
support named parameters
František Kučera <franta-hg@frantovo.cz>
parents:
16
diff
changeset
|
42 |
|
b4c74461d0f9
support named parameters
František Kučera <franta-hg@frantovo.cz>
parents:
16
diff
changeset
|
43 |
@Override |
b4c74461d0f9
support named parameters
František Kučera <franta-hg@frantovo.cz>
parents:
16
diff
changeset
|
44 |
public String toString() { |
b4c74461d0f9
support named parameters
František Kučera <franta-hg@frantovo.cz>
parents:
16
diff
changeset
|
45 |
return "NamedParameter {" + name + " = " + getValue() + "; " + getType() + "}"; |
b4c74461d0f9
support named parameters
František Kučera <franta-hg@frantovo.cz>
parents:
16
diff
changeset
|
46 |
} |
1
f32dac78d13a
WOW some classes LOL; TODO: refactor
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
47 |
} |