EMMA Coverage Report (generated Sun Mar 01 22:06:14 CET 2015)
[all classes][org.h2.expression]

COVERAGE SUMMARY FOR SOURCE FILE [Wildcard.java]

nameclass, %method, %block, %line, %
Wildcard.java100% (1/1)38%  (6/16)41%  (28/69)40%  (10/25)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Wildcard100% (1/1)38%  (6/16)41%  (28/69)40%  (10/25)
getCost (): int 0%   (0/1)0%   (0/2)0%   (0/1)
getDisplaySize (): int 0%   (0/1)0%   (0/2)0%   (0/1)
getPrecision (): long 0%   (0/1)0%   (0/2)0%   (0/1)
getSQL (): String 0%   (0/1)0%   (0/16)0%   (0/3)
getScale (): int 0%   (0/1)0%   (0/2)0%   (0/1)
getType (): int 0%   (0/1)0%   (0/2)0%   (0/1)
getValue (Session): Value 0%   (0/1)0%   (0/2)0%   (0/1)
optimize (Session): Expression 0%   (0/1)0%   (0/5)0%   (0/1)
setEvaluatable (TableFilter, boolean): void 0%   (0/1)0%   (0/3)0%   (0/2)
updateAggregate (Session): void 0%   (0/1)0%   (0/3)0%   (0/2)
isEverything (ExpressionVisitor): boolean 100% (1/1)75%  (6/8)67%  (2/3)
Wildcard (String, String): void 100% (1/1)100% (9/9)100% (4/4)
getSchemaName (): String 100% (1/1)100% (3/3)100% (1/1)
getTableAlias (): String 100% (1/1)100% (3/3)100% (1/1)
isWildcard (): boolean 100% (1/1)100% (2/2)100% (1/1)
mapColumns (ColumnResolver, int): void 100% (1/1)100% (5/5)100% (1/1)

1/*
2 * Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
3 * and the EPL 1.0 (http://h2database.com/html/license.html).
4 * Initial Developer: H2 Group
5 */
6package org.h2.expression;
7 
8import org.h2.api.ErrorCode;
9import org.h2.engine.Session;
10import org.h2.message.DbException;
11import org.h2.table.ColumnResolver;
12import org.h2.table.TableFilter;
13import org.h2.util.StringUtils;
14import org.h2.value.Value;
15 
16/**
17 * A wildcard expression as in SELECT * FROM TEST.
18 * This object is only used temporarily during the parsing phase, and later
19 * replaced by column expressions.
20 */
21public class Wildcard extends Expression {
22    private final String schema;
23    private final String table;
24 
25    public Wildcard(String schema, String table) {
26        this.schema = schema;
27        this.table = table;
28    }
29 
30    @Override
31    public boolean isWildcard() {
32        return true;
33    }
34 
35    @Override
36    public Value getValue(Session session) {
37        throw DbException.throwInternalError();
38    }
39 
40    @Override
41    public int getType() {
42        throw DbException.throwInternalError();
43    }
44 
45    @Override
46    public void mapColumns(ColumnResolver resolver, int level) {
47        throw DbException.get(ErrorCode.SYNTAX_ERROR_1, table);
48    }
49 
50    @Override
51    public Expression optimize(Session session) {
52        throw DbException.get(ErrorCode.SYNTAX_ERROR_1, table);
53    }
54 
55    @Override
56    public void setEvaluatable(TableFilter tableFilter, boolean b) {
57        DbException.throwInternalError();
58    }
59 
60    @Override
61    public int getScale() {
62        throw DbException.throwInternalError();
63    }
64 
65    @Override
66    public long getPrecision() {
67        throw DbException.throwInternalError();
68    }
69 
70    @Override
71    public int getDisplaySize() {
72        throw DbException.throwInternalError();
73    }
74 
75    @Override
76    public String getTableAlias() {
77        return table;
78    }
79 
80    @Override
81    public String getSchemaName() {
82        return schema;
83    }
84 
85    @Override
86    public String getSQL() {
87        if (table == null) {
88            return "*";
89        }
90        return StringUtils.quoteIdentifier(table) + ".*";
91    }
92 
93    @Override
94    public void updateAggregate(Session session) {
95        DbException.throwInternalError();
96    }
97 
98    @Override
99    public boolean isEverything(ExpressionVisitor visitor) {
100        if (visitor.getType() == ExpressionVisitor.QUERY_COMPARABLE) {
101            return true;
102        }
103        throw DbException.throwInternalError();
104    }
105 
106    @Override
107    public int getCost() {
108        throw DbException.throwInternalError();
109    }
110 
111}

[all classes][org.h2.expression]
EMMA 2.0.5312 (C) Vladimir Roubtsov