Package br.com.procempa.modus.entity

Examples of br.com.procempa.modus.entity.Curso


    return CursoActionFactory.makeNew();
  }

  @Override
  public void buildTabs() {
    Curso curso = (Curso) getSelectedData();
    try {
      addTab("Turmas", IconFactory.createVerTurmaCurso16(), TurmaSearch.getInstance(curso));
      addTab("Conte�dos", IconFactory.createVerConteudoCurso16(), ConteudoSearch.getInstance(curso));
      addTab("Inscritos", IconFactory.createInscreverCurso16(), InscritosView.getInstance(curso));
      addTab("Fila de Inscri��o", IconFactory.createFilaEspera16(), InscritosListaView.getInstance(curso));
View Full Code Here


      sinc.create();
      sinc.start();
      Thread.sleep(12000);
     
      Curso c = (Curso) pa.search("FROM Curso").get(0);
      c.setEmenta("atualizado pelo local: " + System.currentTimeMillis());
      pa.persist(c);
     
      Thread.sleep(10000);
      sinc.stop();
     
View Full Code Here

      sinc.create();
      sinc.start();
      Thread.sleep(12000);
     
      Curso c = (Curso) mainPa.search("FROM Curso").get(0);
      c.setEmenta("atualizado pelo main: " + System.currentTimeMillis());
      mainPa.persist(c);
     
      Thread.sleep(10000);
      sinc.stop();
     
View Full Code Here

import br.com.procempa.modus.session.PersistentAccess;

public class CursoDataServices implements DataServices {

  public static Curso getCurso(Long id) {
    Curso curso = null;
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      curso = (Curso) pa.find(Curso.class, id);
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

 
  private void insertLocal(){
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
     
      Curso c = new Curso();
      c.setNome("Curso de Sincroniza��o");
      c.setLocal("Procempa");
      c.setEmenta("Inserido no local");

      pa.persist(c);
    } catch (NamingException e1) {
      e1.printStackTrace();
    }   
View Full Code Here

  }

  public static void remove(Long id) throws Exception {
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      Curso curso = (Curso) pa.find(Curso.class, id);
   
      List<Conteudo> conteudos = ConteudoDataServices.getList(curso);
      for (Conteudo conteudo : conteudos) {
        ConteudoDataServices.remove(conteudo.getId());
      }
View Full Code Here

    try {
     
      PersistentAccess mainPa = PersistentAccessFactory.getInstanceMain();
     
      Curso c = new Curso();
      c.setNome("Curso de Sincroniza��o");
      c.setLocal("Procempa");
      c.setEmenta("Inserido no main");

      mainPa.persist(c);
    } catch (Exception e){
      e.printStackTrace();
    }
View Full Code Here

    super(connSource, connDestination);
  }

  public PreparedStatement prepareStatement(ResultSet rs,
      PreparedStatement statement, List<String> messages) throws Exception {
    Curso cur = (Curso) getObject(rs);
 
    statement.setLong(1, cur.getId());
    statement.setDate(2, new java.sql.Date(cur.getTimestamp().getTime()));
    statement.setString(3, cur.getLocal());
    statement.setString(4, cur.getNome());
    statement.setInt(5, cur.getAssiduidade());
    statement.setInt(6, cur.getCargaHorario());
    statement.setString(7, cur.getEmenta());
    statement.setNull(8, Types.NULL);
   
    if (!(cur.getTelecentro() == null)){
      statement.setLong(9, cur.getTelecentro().getId());
    } else {
      statement.setNull(9, Types.NULL);
    }
   
    return statement;
View Full Code Here

   
    return statement;
  }

  public Persistent getObject(ResultSet rs) throws Exception {
    Curso cur = new Curso();

    cur.setId(rs.getLong(1));
    cur.setTimestamp(new Timestamp(rs.getDate(2).getTime()));
    cur.setLocal(StringUtils.defaultIfEmpty(rs.getString(3), ""));
    cur.setNome(StringUtils.defaultIfEmpty(rs.getString(4), ""));
    cur.setAssiduidade(rs.getInt(5));
    cur.setCargaHorario(rs.getInt(6));
   
    if(rs.getString(7) == null){
      cur.setTelecentro(null);
    } else {
      Telecentro t = new Telecentro();
      cur.setTelecentro(t);
      cur.getTelecentro().setId(rs.getLong(7));
    }   
    cur.setEmenta(StringUtils.defaultIfEmpty(rs.getString(8), ""));

    return cur;
  }
View Full Code Here

    con.setNome(rs.getString(4));
   
    if(rs.getString(5) == null){
      con.setCurso(null);
    } else {
      Curso c = new Curso();
      con.setCurso(c);
      con.getCurso().setId(rs.getLong(5));
    }
   
    con.setDescricao(rs.getString(6));
View Full Code Here

TOP

Related Classes of br.com.procempa.modus.entity.Curso

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.