Package enterprise.web.tookit.evento.test

Source Code of enterprise.web.tookit.evento.test.EventoTest

package enterprise.web.tookit.evento.test;

import javax.naming.InitialContext;

import enterprise.web.tookit.evento.Evento;
import enterprise.web.tookit.evento.EventoEJBRemote;

public class EventoTest {

  static EventoEJBRemote eventoEJBRemote;

  public static void main(String[] args) {
    // createEvent();
    pesquisaEventoPorId();
    // inativar();
    // remove();
  }

  // CRIAR NOVAMENTE AS TABELAS

  // NA TABELA ATTACHMENT ADICIONAR CAMPO REFERENCIA ID_EMAIL

  // E NAS REFERENCIAS DE FK, ADICIONAR CASCADE ON DELETE

  public static void remove() {
    try {
      InitialContext context = new InitialContext();
      Object ref = context.lookup("Evento");

      eventoEJBRemote = (EventoEJBRemote) ref;

      Evento evento = new Evento();
      evento.setId(1);

      eventoEJBRemote.excluirEvento(evento);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  public static void inativar() {
    try {
      InitialContext context = new InitialContext();
      Object ref = context.lookup("Evento");

      eventoEJBRemote = (EventoEJBRemote) ref;

      Evento evento = new Evento();
      evento.setId(1);

      eventoEJBRemote.inativarEvento(evento);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  public static void pesquisaEventoPorId() {
    try {
      InitialContext context = new InitialContext();
      Object ref = context.lookup("Evento");

      eventoEJBRemote = (EventoEJBRemote) ref;

      Evento evento = new Evento();

      evento.setId(2);

      System.out.println(eventoEJBRemote.pesquisarEventoPorId(2));

    } catch (Exception e) {
      e.printStackTrace();
    }

  }

}
TOP

Related Classes of enterprise.web.tookit.evento.test.EventoTest

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.