public DataColumnConstraints queryByUnique ( String constraintName , DataColumnConstraintType constraintType , String value ) throws SQLException { DataColumnConstraints constraint = null ; QueryBuilder < DataColumnConstraints , Void > qb = queryBuilder ( ) ; setUniqueWhere ( qb . where ( ) , constraintName , constraintType , value ) ; List < DataColumnConstraints > constraints = qb . query ( ) ; if ( ! constraints . isEmpty ( ) ) { if ( constraints . size ( ) > 1 ) { throw new GeoPackageException ( "More than one " + DataColumnConstraints . class . getSimpleName ( ) + " was found for unique constraint. Name: " + constraintName + ", Type: " + constraintType + ", Value: " + value ) ; } constraint = constraints . get ( 0 ) ; } return constraint ; }
Query by the unique column values