
package de.ivu.elect.presentation.email.form;

import de.ivu.elect.business.email.boundary.EmailLayoutExtendedDAO;
import de.ivu.elect.business.email.entity.EmailLayout;
import de.ivu.elect.business.email.entity.EmailLayoutPK;
import de.ivu.elect.business.email.entity.EmailLayoutUK;
import de.ivu.elect.jee.entity.DAO;
import de.ivu.elect.jee.faces.AbstractEntityUniqueUKFacesValidator;

import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;

@RequestScoped
public class EmailLayoutUniqueUKFacesValidator extends AbstractEntityUniqueUKFacesValidator<EmailLayout, EmailLayoutPK, EmailLayoutUK> {

  private static final long serialVersionUID = 1L;

  @Inject
  private EmailLayoutExtendedDAO emailLayoutDao;

  public EmailLayoutUniqueUKFacesValidator() {
    super();
  }

  @Override
  protected EmailLayoutUK createUK(Object value) {
    return new EmailLayoutUK((String) value);
  }

  @Override
  protected DAO<EmailLayout, EmailLayoutPK, EmailLayoutUK> getDao() {
    return emailLayoutDao;
  }
}
