File D:\maven-qcr-plugin-testsunitaires\qcr4java\h2-1.3.170-sources\target\site\qc\lecode\expression\Wildcard.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.expression;
8
9 import org.h2.constant.ErrorCode;
10 import org.h2.engine.Session;
11 import org.h2.message.DbException;
12 import org.h2.table.ColumnResolver;
13 import org.h2.table.TableFilter;
14 import org.h2.util.StringUtils;
15 import org.h2.value.Value;
16
17 /**
18 * A wildcard expression as in SELECT * FROM TEST.
19 * This object is only used temporarily during the parsing phase, and later
20 * replaced by column expressions.
21 */
22 public class Wildcard extends Expression {
23 private final String schema;
24 private final String table;
25
26 public Wildcard(String schema, String table) {
27 this.schema = schema;
28 this.table = table;
29 }
30
31 public boolean isWildcard() {
32 return true;
33 }
34
35 public Value getValue(Session session) {
36 throw DbException.throwInternalError();
37 }
38
39 public int getType() {
40 throw DbException.throwInternalError();
41 }
42
43 public void mapColumns(ColumnResolver resolver, int level) {
44 throw DbException.get(ErrorCode.SYNTAX_ERROR_1, table);
45 }
46
47 public Expression optimize(Session session) {
48 throw DbException.get(ErrorCode.SYNTAX_ERROR_1, table);
49 }
50
51 public void setEvaluatable(TableFilter tableFilter, boolean b) {
52 DbException.throwInternalError();
53 }
54
55 public int getScale() {
56 throw DbException.throwInternalError();
57 }
58
59 public long getPrecision() {
60 throw DbException.throwInternalError();
61 }
62
63 public int getDisplaySize() {
64 throw DbException.throwInternalError();
65 }
66
67 public String getTableAlias() {
68 return table;
69 }
70
71 public String getSchemaName() {
72 return schema;
73 }
74
75 public String getSQL() {
76 if (table == null) {
77 return "*";
78 }
79 return StringUtils.quoteIdentifier(table) + ".*";
80 }
81
82 public void updateAggregate(Session session) {
83 DbException.throwInternalError();
84 }
85
86 public boolean isEverything(ExpressionVisitor visitor) {
87 throw DbException.throwInternalError();
88 }
89
90 public int getCost() {
91 throw DbException.throwInternalError();
92 }
93
94 }
95