Search in sources :

Example 61 with User

use of com.ncedu.fooddelivery.api.v1.entities.User in project tapestry-5 by apache.

the class PersistEntity method onCreateEntity.

@CommitAfter
@PersistenceContext(unitName = AppConstants.TEST_PERSISTENCE_UNIT)
void onCreateEntity() {
    final User user = new User();
    user.setFirstName("name");
    entityManager.persist(user);
    this.user = user;
}
Also used : User(org.example.app1.entities.User) PersistenceContext(javax.persistence.PersistenceContext) CommitAfter(org.apache.tapestry5.jpa.annotations.CommitAfter)

Example 62 with User

use of com.ncedu.fooddelivery.api.v1.entities.User in project tapestry-5 by apache.

the class SSOEntity method onPersistEntity.

void onPersistEntity() {
    final User user = new User();
    user.setFirstName("name");
    userDAO.add(user);
    this.user = user;
}
Also used : User(org.example.app6.entities.User)

Example 63 with User

use of com.ncedu.fooddelivery.api.v1.entities.User in project tapestry-5 by apache.

the class EncodeEntities method onCreate.

@CommitAfter
@PersistenceContext(unitName = AppConstants.TEST_PERSISTENCE_UNIT)
void onCreate() {
    final User user = new User();
    user.setFirstName("name");
    entityManager.persist(user);
}
Also used : User(org.example.app6.entities.User) PersistenceContext(javax.persistence.PersistenceContext) CommitAfter(org.apache.tapestry5.jpa.annotations.CommitAfter)

Example 64 with User

use of com.ncedu.fooddelivery.api.v1.entities.User in project tapestry-5 by apache.

the class GridDemo method onActionFromSetup.

@CommitAfter
@PersistenceContext(unitName = AppConstants.TEST_PERSISTENCE_UNIT)
void onActionFromSetup() {
    userDAO.deleteAll();
    for (int i = 1; i <= 20; i++) {
        final User user = new User();
        final String suffix = String.valueOf(i);
        user.setFirstName("Joe_" + suffix);
        user.setLastName("User");
        user.setEncodedPassword("####");
        user.setEmail("joe" + suffix + "@null.com");
        entityManager.persist(user);
    }
}
Also used : User(org.example.app6.entities.User) PersistenceContext(javax.persistence.PersistenceContext) CommitAfter(org.apache.tapestry5.jpa.annotations.CommitAfter)

Example 65 with User

use of com.ncedu.fooddelivery.api.v1.entities.User in project tapestry-5 by apache.

the class Index method onActionFromCommitAfter.

Object onActionFromCommitAfter() {
    final User user = new User();
    user.setFirstName("Diane");
    userDAO.add(user);
    commitAfterDemo.setUser(user);
    return commitAfterDemo;
}
Also used : User(org.example.app6.entities.User)

Aggregations

User (com.ncedu.fooddelivery.api.v1.entities.User)58 Test (org.junit.jupiter.api.Test)55 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)55 File (com.ncedu.fooddelivery.api.v1.entities.File)21 Path (java.nio.file.Path)19 MultipartFile (org.springframework.web.multipart.MultipartFile)19 CustomAccessDeniedException (com.ncedu.fooddelivery.api.v1.errors.security.CustomAccessDeniedException)18 MockMultipartFile (org.springframework.mock.web.MockMultipartFile)18 FileLinkDTO (com.ncedu.fooddelivery.api.v1.dto.file.FileLinkDTO)15 Order (com.ncedu.fooddelivery.api.v1.entities.order.Order)14 BufferedImage (java.awt.image.BufferedImage)10 UserInfoDTO (com.ncedu.fooddelivery.api.v1.dto.user.UserInfoDTO)9 Role (com.ncedu.fooddelivery.api.v1.entities.Role)7 NotFoundEx (com.ncedu.fooddelivery.api.v1.errors.notfound.NotFoundEx)7 IOException (java.io.IOException)7 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)7 ProductPosition (com.ncedu.fooddelivery.api.v1.entities.productPosition.ProductPosition)6 AlreadyExistsException (com.ncedu.fooddelivery.api.v1.errors.badrequest.AlreadyExistsException)6 PasswordsMismatchException (com.ncedu.fooddelivery.api.v1.errors.badrequest.PasswordsMismatchException)6 CommitAfter (org.apache.tapestry5.jpa.annotations.CommitAfter)6