All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.devocative.demeter.DBConstraintViolationException Maven / Gradle / Ivy

The newest version!
package org.devocative.demeter;

public class DBConstraintViolationException extends DemeterException {
	private static final long serialVersionUID = -7910277878181703760L;

	public DBConstraintViolationException(String constraintName) {
		super(DemeterErrorCode.DBConstraintViolation, constraintName);
	}

	public boolean isConstraint(String name) {
		name = name.toLowerCase();
		String constraint = getErrorParameter().toLowerCase();

		return name.equals(constraint) || // HSQLDB
			constraint.contains(name) || // Oracle DB: .
			name.contains(constraint); // For more precaution :D
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy