Package com.inspiresoftware.lib.dto.geda.examples.blog.domain

Examples of com.inspiresoftware.lib.dto.geda.examples.blog.domain.User


public class UserDAOImpl implements UserDAO {

    private final Map<Long, User> db = new HashMap<Long, User>();

    public User create(final String username) {
        final User user = new UserImpl();
        user.setUsername(username);
        db.put(user.getUserId(), user);
        return user;
    }
View Full Code Here


        }
        return dtos;
    }

    public UserDTO findUser(final Long userId) {
        final User user = dao.findUser(userId);
        final UserDTO dto = (UserDTO) bf.get("UserDTO");
        DTOAssembler.newAssembler(dto.getClass(), bf.getClazz("User"))
                .assembleDto(dto, user, converters, bf);
        return dto;
    }
View Full Code Here

    /*
     * Setup some dummy users with interlinked data.
     */
    public void setupUsers() {

        final User bob = dao.create("Bob");

        final UserEntry entry = bob.createEntry();
        entry.setTitle("GeDA");
        entry.setBody("Hey all, This GeDA stuff really works!!!");

        final User john = dao.create("John");
        final UserEntryReply reply = entry.createReply(john);
        reply.getReplyEntry().setBody("Awesome!");

    }
View Full Code Here

TOP

Related Classes of com.inspiresoftware.lib.dto.geda.examples.blog.domain.User

Copyright © 2018 www.massapicom. 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.