@Override
@Transactional
public void save() throws DuplicateName {
if (snippet.getId() == null && snippetDAO.exists(snippet)) {
throw new DuplicateName();
}
// Both title and description are required
if (!snippet.getTitle().isEmpty()
&& !snippet.getDescription().isEmpty()) {
snippetDAO.save(snippet);