Use the Convert.* methods in the hibernate-querydsl archetype.