Package org.spw.model

Examples of org.spw.model.Document


        }
    }
   
    public Document read(Long key) {
        EntityManager em = emf.createEntityManager();
        Document retValue = null;
        try {
            retValue = em.find(Document.class, key);
        } catch (Exception e) {
            Logger.getLogger(DocumentController.class.getName()).log(Level.SEVERE, "Error reading " + key, e);
            if (em.getTransaction().isActive())
View Full Code Here


        }
        return retValue;
    }
   
    public Document update(Document object) {
        Document result = null;
        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        try {
            result = em.merge(object);
            em.getTransaction().commit();
View Full Code Here

   
    public void delete(Document object) {
        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        try {
            Document entity = em.find(Document.class, object.getIdDocument());
            em.remove(entity);
            em.getTransaction().commit();
        } catch (Exception e) {
            Logger.getLogger(DocumentController.class.getName()).log(Level.SEVERE, "Error deleting " + object, e);
            if (em.getTransaction().isActive())
View Full Code Here

    public Document parse(String documentString) {
        int begin = documentString.lastIndexOf('[') + 1;
        int last  = documentString.lastIndexOf(']');
        if (begin < 0 || last < 0 || begin > last) return null;

        Document retValue = null;
        String number = documentString.substring(begin, last);
        try {
            retValue = read(Long.parseLong(number));
        } catch (NumberFormatException ex) {
            //incorrect number, could not happen
View Full Code Here

TOP

Related Classes of org.spw.model.Document

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.