/
IPlatform.java
63 lines (47 loc) · 2.1 KB
/
IPlatform.java
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
package org.jumpmind.symmetric.core.db;
import java.util.List;
import org.jumpmind.symmetric.core.common.BinaryEncoding;
import org.jumpmind.symmetric.core.model.Column;
import org.jumpmind.symmetric.core.model.Database;
import org.jumpmind.symmetric.core.model.Parameters;
import org.jumpmind.symmetric.core.model.Table;
public interface IPlatform {
public PlatformInfo getPlatformInfo();
public String getAlterScriptFor(Table... tables);
public Database findDatabase(String catalogName, String schemaName);
public Table findTable(String tableName, Parameters parameters);
public Table findTable(String catalogName, String schemaName, String tableName, boolean useCached, Parameters parameters);
public List<Table> findTables(String catalogName, String schemaName, Parameters parameters);
public Object[] getObjectValues(BinaryEncoding encoding, String[] values,
Column[] orderedMetaData);
public String getDefaultCatalog();
public String getDefaultSchema();
public SqlBuilder getSqlBuilder();
/**
* Returns the constraint name. This method takes care of length limitations
* imposed by some databases.
*
* @param prefix
* The constraint prefix, can be <code>null</code>
* @param table
* The table that the constraint belongs to
* @param secondPart
* The second name part, e.g. the name of the constraint column
* @param suffix
* The constraint suffix, e.g. a counter (can be
* <code>null</code>)
* @return The constraint name
*/
public String getConstraintName(String prefix, Table table, String secondPart, String suffix);
/**
* Generates a version of the name that has at most the specified length.
*
* @param name
* The original name
* @param desiredLength
* The desired maximum length
* @return The shortened version
*/
public String shortenName(String name, int desiredLength);
public boolean isDataIntegrityException(Exception ex);
}