File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
src/main/java/org/apache/ibatis/metadata Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 6
6
7
7
public class Database {
8
8
9
- private String catalog ;
10
- private String schema ;
9
+ private final String catalog ;
10
+ private final String schema ;
11
11
12
- private Map tables = new HashMap ();
12
+ private final Map < String , Table > tables = new HashMap < String , Table > ();
13
13
14
14
public Database (String catalog , String schema ) {
15
15
this .catalog = catalog ;
@@ -29,11 +29,11 @@ public void addTable(Table table) {
29
29
}
30
30
31
31
public Table getTable (String name ) {
32
- return ( Table ) tables .get (name .toUpperCase (Locale .ENGLISH ));
32
+ return tables .get (name .toUpperCase (Locale .ENGLISH ));
33
33
}
34
34
35
35
public String [] getTableNames () {
36
- return ( String []) tables .keySet ().toArray (new String [tables .size ()]);
36
+ return tables .keySet ().toArray (new String [tables .size ()]);
37
37
}
38
38
39
39
public boolean equals (Object o ) {
Original file line number Diff line number Diff line change 5
5
import java .util .Map ;
6
6
7
7
public class Table {
8
- private String name ;
8
+ private final String name ;
9
9
private String catalog ;
10
10
private String schema ;
11
- private Map columns = new HashMap ();
11
+ private final Map < String , Column > columns = new HashMap < String , Column > ();
12
12
private Column primaryKey ;
13
13
14
14
public Table (String name ) {
@@ -40,11 +40,11 @@ public void addColumn(Column col) {
40
40
}
41
41
42
42
public Column getColumn (String name ) {
43
- return ( Column ) columns .get (name .toUpperCase (Locale .ENGLISH ));
43
+ return columns .get (name .toUpperCase (Locale .ENGLISH ));
44
44
}
45
45
46
46
public String [] getColumnNames () {
47
- return ( String []) columns .keySet ().toArray (new String [columns .size ()]);
47
+ return columns .keySet ().toArray (new String [columns .size ()]);
48
48
}
49
49
50
50
public void setPrimaryKey (Column column ) {
You can’t perform that action at this time.
0 commit comments