For the record, I've created a related issue about that inconsistency in cb.literal() handling: https://hibernate.atlassian.net/browse/HHH-11778