EMMA Coverage Report (generated Mon Apr 21 23:56:41 GMT 2008) |
---|
[all classes][org.sqlorm.querybuilder] |
name | class, % | method, % | block, % | line, % |
---|---|---|---|---|
OrderByExpr.java | 100% (3/3) | 70% (7/10) | 87% (104/120) | 78% (14,8/19) |
name | class, % | method, % | block, % | line, % |
---|---|---|---|---|
class OrderByExpr | 100% (1/1) | 60% (3/5) | 83% (44/53) | 76% (13/17) |
OrderByExpr (String, OrderByExpr$Ordering): void | 100% (1/1) | 100% (9/9) | 100% (4/4) | |
equals (Object): boolean | 100% (1/1) | 88% (14/16) | 75% (3/4) | |
getTableName (): String | 0% (0/1) | 0% (0/3) | 0% (0/1) | |
setTableName (String): void | 0% (0/1) | 0% (0/4) | 0% (0/2) | |
toSql (StringBuilder, String): void | 100% (1/1) | 100% (21/21) | 100% (6/6) | |
class OrderByExpr$1 | 100% (1/1) | 100% (1/1) | 89% (17/19) | 89% (0,9/1) |
<static initializer> | 100% (1/1) | 89% (17/19) | 89% (0,9/1) | |
class OrderByExpr$Ordering | 100% (1/1) | 75% (3/4) | 90% (43/48) | 94% (1,9/2) |
<static initializer> | 100% (1/1) | 100% (34/34) | 100% (2/2) | |
OrderByExpr$Ordering (String, int): void | 100% (1/1) | 100% (5/5) | 100% (1/1) | |
valueOf (String): OrderByExpr$Ordering | 0% (0/1) | 0% (0/5) | 0% (0/1) | |
values (): OrderByExpr$Ordering [] | 100% (1/1) | 100% (4/4) | 100% (1/1) |
1 | package org.sqlorm.querybuilder; |
2 | |
3 | class OrderByExpr implements IExpr { |
4 | enum Ordering { |
5 | NOTHING, ASCENDING, DESCENDING; |
6 | } |
7 | |
8 | String tableName; |
9 | Ordering ordering; |
10 | |
11 | OrderByExpr(final String tableName, final Ordering ordering) { |
12 | this.tableName = tableName; |
13 | this.ordering = ordering; |
14 | } |
15 | |
16 | @Override |
17 | public boolean equals(final Object o) { |
18 | if(o == null || o instanceof OrderByExpr == false) |
19 | return false; |
20 | |
21 | final OrderByExpr other = (OrderByExpr) o; |
22 | return tableName.equals(other.tableName); |
23 | } |
24 | |
25 | public String getTableName() { |
26 | return tableName; |
27 | } |
28 | |
29 | public void setTableName(final String tableName) { |
30 | this.tableName = tableName; |
31 | } |
32 | |
33 | public void toSql(final StringBuilder sb, final String indent) { |
34 | sb.append(tableName); |
35 | |
36 | switch(ordering) { |
37 | case ASCENDING: |
38 | sb.append(" ASC"); |
39 | break; |
40 | case DESCENDING: |
41 | sb.append(" DESC"); |
42 | break; |
43 | } |
44 | } |
45 | } |
[all classes][org.sqlorm.querybuilder] |
EMMA 2.0.5312 (C) Vladimir Roubtsov |