Package br.com.procempa.modus.session

Examples of br.com.procempa.modus.session.PersistentAccess.find()


public class UsuarioDataServices implements DataServices {

  public static Usuario getUsuario(Long id) throws Exception {
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    Usuario u = (Usuario) pa.find(Usuario.class, id);
    return u;
  }

  public static Usuario getUsuarioByRg(String rg) throws UsuarioException {
    Usuario u = null;
View Full Code Here


   * @throws Exception
   */
  public static void remove(Long id) throws Exception {
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      Equipamento eq = (Equipamento) pa.find(Equipamento.class, id);
      if (!EquipamentoDataServices.temVisita(eq)){
        pa.remove(eq);
      }
    } catch (Exception e) {
      throw new Exception(e.getClass().getName() + ": " + e.getMessage());
View Full Code Here

     */
    public static Equipamento getEquipamento(Long id) {
        Equipamento eq = null;
        try {
            PersistentAccess pa = PersistentAccessFactory.getInstance();
            eq = (Equipamento) pa.find(Equipamento.class, id);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return eq;
    }
View Full Code Here

     * @throws Exception
     */
    public static void remove(Long id) throws Exception {
        try {
            PersistentAccess pa = PersistentAccessFactory.getInstance();
            Equipamento eq = (Equipamento) pa.find(Equipamento.class, id);
            pa.remove(eq);
        } catch (Exception e) {
            throw new Exception(e.getClass().getName() + ": " + e.getMessage());
        }
    }
View Full Code Here

public class UsuarioDataServices implements DataServices {

  public static Usuario getUsuario(Long id) throws Exception {
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    Usuario u = (Usuario) pa.find(Usuario.class, id);
    return u;
  }

  public static Usuario getUsuarioByRg(String rg) throws UsuarioException {
    Usuario u = null;
View Full Code Here

  public static ExceptionLog updateUserDescription(ExceptionLog log, String userDesc) {
    PersistentAccess pa;
    try {
      pa = PersistentAccessFactory.getInstance();
      log = (ExceptionLog) pa.find(ExceptionLog.class, log.getId());
      log.setUserDescription(userDesc);
      log = (ExceptionLog) pa.persist(log);
    } catch (NamingException e) {
      e.printStackTrace();
    }
View Full Code Here

public class UsuarioDataServices implements DataServices {

  public static Usuario getUsuario(String id) throws Exception {
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    Usuario u = (Usuario) pa.find(Usuario.class, id);
    return u;
  }

  public static Usuario getUsuarioByRg(String rg) throws UsuarioException {
    Usuario u = null;
View Full Code Here

  public static Presenca getPresenca(String id) {
    Presenca presenca = null;
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      presenca = (Presenca) pa.find(Presenca.class, id);
    } catch (Exception e) {
      e.printStackTrace();
    }
    return presenca;
  }
View Full Code Here

  }

  public static void remove(String id) throws Exception {
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      Presenca presenca = (Presenca) pa.find(Presenca.class, id);
      presenca.setStatus(Status.EXCLUIDO);
      pa.persist(presenca);
    } catch (Exception e) {
      throw new Exception(e.getClass().getName() + ": " + e.getMessage());
    }
View Full Code Here

  public static Curso getCurso(String id) {
    Curso curso = null;
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      curso = (Curso) pa.find(Curso.class, id);
    } catch (Exception e) {
      e.printStackTrace();
    }
    return curso;
  }
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.