Package com.tadamski.jsdemo.entity

Examples of com.tadamski.jsdemo.entity.TodoElement


        return todoStore.getElements();
    }

    @POST
    public TodoElement createNewTodo(TodoElement element) {
        TodoElement createdElement = new TodoElement(UUID.randomUUID().toString(), element.getName(), element.isDone());
        todoStore.addElement(createdElement);
        return createdElement;
    }
View Full Code Here


        elementsMap.put(element.getId(), element);
    }

    @Override
    public void removeElementWithId(String id) {
        TodoElement elementToDelete = getElementWithId(id);
        if (elementToDelete != null) {
            elementsMap.remove(id);
        }
    }
View Full Code Here

        return em.createQuery("SELECT todo FROM TodoElement todo", TodoElement.class).getResultList();
    }

    @Override
    public void updateElement(TodoElement element) {
        TodoElement elementInDB = em.find(TodoElement.class, element.getId());
        if (elementInDB != null) {
            elementInDB.setDone(element.isDone());
            elementInDB.setName(element.getName());
        }
    }
View Full Code Here

        }
    }

    @Override
    public void removeElementWithId(String id) {
        TodoElement element = em.find(TodoElement.class, id);
        if (element != null) {
            em.remove(element);
        }
    }
View Full Code Here

TOP

Related Classes of com.tadamski.jsdemo.entity.TodoElement

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.