// "
protected void addClaimMapping(Connection dbConnection, ClaimMapping claimMapping)
throws UserStoreException {
PreparedStatement prepStmt = null;
try {
Claim claim = claimMapping.getClaim();
int dialectId = getDialect(dbConnection, claim.getDialectURI());
if (dialectId == -1) {
dialectId = addDialect(dbConnection, claim.getDialectURI());
}
short isSupported = 0;
if (claim.isSupportedByDefault()) {
isSupported = 1;
}
;
short isRequired = 0;
if (claim.isRequired()) {
isRequired = 1;
}
;
prepStmt = dbConnection.prepareStatement(ClaimDBConstants.ADD_CLAIM_SQL);
prepStmt.setInt(1, dialectId);
prepStmt.setString(2, claim.getClaimUri());
prepStmt.setString(3, claim.getDisplayTag());
prepStmt.setString(4, claim.getDescription());
prepStmt.setString(5, claimMapping.getMappedAttribute());
prepStmt.setString(6, claim.getRegEx());
prepStmt.setShort(7, isSupported);
prepStmt.setShort(8, isRequired);
prepStmt.setInt(9, claim.getDisplayOrder());
prepStmt.setInt(10, tenantId);
prepStmt.executeUpdate();
prepStmt.close();
} catch (SQLException e) {
log.error("Database Error - " + e.getMessage(), e);