Search in sources :

Example 1 with TckRepositoryException

use of org.eclipse.che.commons.test.tck.repository.TckRepositoryException in project che by eclipse.

the class UserJpaTckRepository method createAll.

@Override
public void createAll(Collection<? extends UserImpl> entities) throws TckRepositoryException {
    final EntityManager manager = managerProvider.get();
    entities.stream().map(user -> new UserImpl(user.getId(), user.getEmail(), user.getName(), encryptor.encrypt(user.getPassword()), user.getAliases())).forEach(manager::persist);
}
Also used : Inject(javax.inject.Inject) TckRepository(org.eclipse.che.commons.test.tck.repository.TckRepository) Provider(javax.inject.Provider) EntityManagerFactory(javax.persistence.EntityManagerFactory) UserImpl(org.eclipse.che.api.user.server.model.impl.UserImpl) Collection(java.util.Collection) PasswordEncryptor(org.eclipse.che.security.PasswordEncryptor) EntityManager(javax.persistence.EntityManager) TckRepositoryException(org.eclipse.che.commons.test.tck.repository.TckRepositoryException) Transactional(com.google.inject.persist.Transactional) EntityManager(javax.persistence.EntityManager) UserImpl(org.eclipse.che.api.user.server.model.impl.UserImpl)

Aggregations

Transactional (com.google.inject.persist.Transactional)1 Collection (java.util.Collection)1 Inject (javax.inject.Inject)1 Provider (javax.inject.Provider)1 EntityManager (javax.persistence.EntityManager)1 EntityManagerFactory (javax.persistence.EntityManagerFactory)1 UserImpl (org.eclipse.che.api.user.server.model.impl.UserImpl)1 TckRepository (org.eclipse.che.commons.test.tck.repository.TckRepository)1 TckRepositoryException (org.eclipse.che.commons.test.tck.repository.TckRepositoryException)1 PasswordEncryptor (org.eclipse.che.security.PasswordEncryptor)1