public class DatabaseMatcher
extends java.lang.Object
Example 1: Match any Oracle database
DatabaseMatcher dm = new DatabaseMatcher( OracleDatabase.ORACLE_DATABASE_TYPE );
Example 2: Match Oracle databases 10gR1 and above
DatabaseMatcher dm =
new DatabaseMatcher( OracleDatabase.ORACLE_DATABASE_TYPE,
OracleDatabase.ORACLE10g_TYPE,
DatabaseMatcher.Comparison.MINIMUM );
Example 3: Match only Oracle 11gR2
DatabaseMatcher dm =
new DatabaseMatcher( OracleDatabase.ORACLE_DATABASE_TYPE,
OracleDatabase.ORACLE11gR2_TYPE,
DatabaseMatcher.Comparison.EXACT );
| Modifier and Type | Class and Description |
|---|---|
static class |
DatabaseMatcher.Comparison
Used to indicate how the version should be matched.
|
| Constructor and Description |
|---|
DatabaseMatcher(java.lang.String dbType)
Matches all database of the given database type.
|
DatabaseMatcher(java.lang.String dbType,
int version,
DatabaseMatcher.Comparison comparison)
Matches database of the given database type, by comparing the
version number using the given comparison type.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Tests that the other object is a DatabaseMatcher with exactly the same
criteria as this matcher.
|
java.lang.String |
getDatabaseType()
Gets the type of database this will match.
|
int |
hashCode() |
boolean |
matches(java.lang.String databaseType,
int databaseVersion)
Tests whether this matcher matches the given database type and version.
|
protected boolean |
matchesType(java.lang.String dbType) |
protected boolean |
matchesVersion(int version) |
void |
setTestSystemProperty(java.lang.String testSystemProperty)
This is intended for internal/test use only.
|
public DatabaseMatcher(java.lang.String dbType)
public DatabaseMatcher(java.lang.String dbType,
int version,
DatabaseMatcher.Comparison comparison)
public java.lang.String getDatabaseType()
protected boolean matchesType(java.lang.String dbType)
protected boolean matchesVersion(int version)
public boolean matches(java.lang.String databaseType,
int databaseVersion)
databaseType - the database type to matchdatabaseVersion - the database version to matchpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic void setTestSystemProperty(java.lang.String testSystemProperty)