File D:\maven-qcr-plugin-testsunitaires\qcr4java\h2-1.3.170-sources\target\site\qc\lecode\table\SingleColumnResolver.java.html

1 /*
2 * Copyright 2004-2011 H2 Group. Multiple-Licensed under the H2 License,
3 * Version 1.0, and under the Eclipse Public License, Version 1.0
4 * (http://h2database.com/html/license.html).
5 * Initial Developer: H2 Group
6 */
7 package org.h2.table;
8
9 import org.h2.command.dml.Select;
10 import org.h2.expression.Expression;
11 import org.h2.expression.ExpressionColumn;
12 import org.h2.value.Value;
13
14 /**
15 * The single column resolver is like a table with exactly one row.
16 * It is used to parse a simple one-column check constraint.
17 */
18 public class SingleColumnResolver implements ColumnResolver {
19
20 private final Column column;
21 private Value value;
22
23 SingleColumnResolver(Column column) {
24 this.column = column;
25 }
26
27 public String getTableAlias() {
28 return null;
29 }
30
31 void setValue(Value value) {
32 this.value = value;
33 }
34
35 public Value getValue(Column col) {
36 return value;
37 }
38
39 public Column[] getColumns() {
40 return new Column[] { column };
41 }
42
43 public String getSchemaName() {
44 return null;
45 }
46
47 public TableFilter getTableFilter() {
48 return null;
49 }
50
51 public Select getSelect() {
52 return null;
53 }
54
55 public Column[] getSystemColumns() {
56 return null;
57 }
58
59 public Column getRowIdColumn() {
60 return null;
61 }
62
63 public Expression optimize(ExpressionColumn expressionColumn, Column col) {
64 return expressionColumn;
65 }
66
67 }
68