blob: fa316b82ef2b433911c96430ce07acad18617fd6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
/*******************************************************************************
* Copyright (c) 2006, 2007 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
*
* Contributors:
* Oracle - initial API and implementation
******************************************************************************/
package org.eclipse.jpt.db.internal;
import java.util.Collections;
import java.util.Set;
import org.eclipse.jpt.utility.internal.ClassTools;
/**
* NullDatabase
*/
public final class NullDatabase extends Database {
private static NullDatabase INSTANCE;
/**
* singleton support
*/
static synchronized Database instance() {
if( INSTANCE == null) {
INSTANCE = new NullDatabase();
}
return INSTANCE;
}
private NullDatabase() {
super();
}
// ********** behavior **********
@Override
void catalogChanged( Catalog catalog, int eventType) {
// do nothing
}
@Override
void schemaChanged( Schema schema, int eventType) {
// do nothing
}
@Override
void tableChanged( Table table, Schema schema,int eventType) {
// do nothing
}
@Override
void refresh() {
// do nothing
}
@Override
protected void dispose() {
// do nothing
}
@Override
protected boolean connectionIsOnline() {
return false;
}
// ********** queries **********
@Override
public String getName() {
return ClassTools.shortClassNameForObject( this);
}
@Override
public String getVendor() {
return this.getName();
}
@Override
public String getVersion() {
return "";
}
// ***** catalogs
@Override
public boolean supportsCatalogs() {
return false;
}
@Override
public String getDefaultCatalogName() {
return "";
}
@Override
Set<Catalog> getCatalogs() {
return Collections.emptySet();
}
// ***** schemata
@Override
Set<Schema> getSchemata() {
return Collections.emptySet();
}
}
|