liquibase.statement.DatabaseFunction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of liquibase-core Show documentation
Show all versions of liquibase-core Show documentation
Liquibase is a tool for managing and executing database changes.
The newest version!
package liquibase.statement;
public class DatabaseFunction {
/**
* String value used for comparison. If a function matches this value then it should be replaced by the
* real current timestamp function.
*/
public static final String CURRENT_DATE_TIME_PLACE_HOLDER = "current_datetime";
private String schemaName;
private final String value;
public DatabaseFunction(String value) {
this.value = value;
}
public DatabaseFunction(String schemaName, String value) {
this.schemaName = schemaName;
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return (getSchemaName() == null ? "" : getSchemaName() + ".") + getValue();
}
public String getSchemaName() {
return schemaName;
}
public void setSchemaName(String schemaName) {
this.schemaName = schemaName;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof DatabaseFunction) {
return this.toString().equals(obj.toString());
} else {
return super.equals(obj);
}
}
@Override
public int hashCode() {
return this.toString().hashCode();
}
}