java/sql-dk/src/info/globalcode/sql/dk/NamedParameter.java
author František Kučera <franta-hg@frantovo.cz>
Thu, 26 Dec 2013 11:58:14 +0100
branchv_0
changeset 68 574cd7fbb5b2
parent 49 b4c74461d0f9
permissions -rw-r--r--
SQLType enum wrapper for java.sql.Types
franta-hg@16
     1
/**
franta-hg@16
     2
 * SQL-DK
franta-hg@16
     3
 * Copyright © 2013 František Kučera (frantovo.cz)
franta-hg@16
     4
 *
franta-hg@16
     5
 * This program is free software: you can redistribute it and/or modify
franta-hg@16
     6
 * it under the terms of the GNU General Public License as published by
franta-hg@16
     7
 * the Free Software Foundation, either version 3 of the License, or
franta-hg@16
     8
 * (at your option) any later version.
franta-hg@16
     9
 *
franta-hg@16
    10
 * This program is distributed in the hope that it will be useful,
franta-hg@16
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
franta-hg@16
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
franta-hg@16
    13
 * GNU General Public License for more details.
franta-hg@16
    14
 *
franta-hg@16
    15
 * You should have received a copy of the GNU General Public License
franta-hg@16
    16
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
franta-hg@16
    17
 */
franta-hg@1
    18
package info.globalcode.sql.dk;
franta-hg@1
    19
franta-hg@49
    20
import info.globalcode.sql.dk.configuration.NameIdentified;
franta-hg@49
    21
franta-hg@1
    22
/**
franta-hg@1
    23
 *
franta-hg@1
    24
 * @author Ing. František Kučera (frantovo.cz)
franta-hg@1
    25
 */
franta-hg@49
    26
public class NamedParameter extends Parameter implements NameIdentified {
franta-hg@1
    27
franta-hg@1
    28
	private String name;
franta-hg@1
    29
franta-hg@68
    30
	public NamedParameter(String name, Object value, SQLType type) {
franta-hg@4
    31
		super(value, type);
franta-hg@4
    32
		this.name = name;
franta-hg@4
    33
	}
franta-hg@4
    34
franta-hg@68
    35
	@Override
franta-hg@1
    36
	public String getName() {
franta-hg@1
    37
		return name;
franta-hg@1
    38
	}
franta-hg@1
    39
franta-hg@1
    40
	public void setName(String name) {
franta-hg@1
    41
		this.name = name;
franta-hg@1
    42
	}
franta-hg@49
    43
franta-hg@49
    44
	@Override
franta-hg@49
    45
	public String toString() {
franta-hg@49
    46
		return "NamedParameter {" + name + " = " + getValue() + "; " + getType() + "}";
franta-hg@49
    47
	}
franta-hg@1
    48
}