/**
* {@inheritDoc }
*/
public Account createAccount(Account account) throws PersistenceViolationException {
(new PersonEJB(em)).createPerson(account.getPerson());
(new UserAuthService(em)).createUser(account.getUser());
account.getUser().setEmail(account.getPerson().getEmail());
LOGGER.debug("Create an account for user: {}", account.getUser().getUsername());
try {
em.persist(account);
em.flush();