// Get content browse custom targeting key ID.
long contentBrowseCustomTargetingKeyId =
networkService.getCurrentNetwork().getContentBrowseCustomTargetingKeyId();
// Create a statement to select the categories matching the name comedy.
Statement categoryFilterStatement = new StatementBuilder(
"WHERE customTargetingKeyId = :contentBrowseCustomTargetingKeyId " +
" and name = :category LIMIT 1")
.putValue("contentBrowseCustomTargetingKeyId", contentBrowseCustomTargetingKeyId)
.putValue("category", "comedy").toStatement();