Examples of mapBack()


Examples of models.dto.UserDto.mapBack()

    public static Result addNew() {
        try {
            Logger.debug("add req body: " + request().body().asJson().toString());
            UserDto userDto = new ObjectMapper().readValue(request().body().asJson().toString(), UserDto.class);
            User newUser = new User();
            userDto.mapBack(newUser);
            ConstraintViolation[] violations = Utilities.validateEntity(newUser);
            if (violations.length > 0) {
                return badRequest(Utilities.violationsToJson(violations));
            }
            DaoManager.getUserDao().persist(newUser);
View Full Code Here

Examples of models.dto.UserDto.mapBack()

            if (user == null) {
                return notFound(Utilities.getJsonErrorNode("Can't find user with id " + userId));
            }
            Logger.debug("update req body: " + request().body().asJson().toString());
            UserDto userDto = new ObjectMapper().readValue(request().body().asJson().toString(), UserDto.class);
            userDto.mapBack(user);
            ConstraintViolation[] violations = Utilities.validateEntity(user);
            if (violations.length > 0) {
                return badRequest(Utilities.violationsToJson(violations));
            }
            DaoManager.getUserDao().persist(user);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.