Package br.com.colibri.modelo

Examples of br.com.colibri.modelo.Filme


    PreparedStatement statement = con.prepareStatement("select id, nome, dataLancamento , sinopse, urltrailer from TBFILME where id = ?");
    statement.setLong(1, id);
   
    ResultSet result = statement.executeQuery();
   
    Filme filme = null;
   
    while (result.next()) {
      filme = new Filme();
      filme.setId(result.getLong(1));
      filme.setNome(result.getString(2));
      filme.setDataLancamento(new Date(result.getDate(3).getTime()));
      filme.setSinopse(result.getString(4));
      filme.setUrlTrailer(result.getString(5));
   
   
    return filme;
  }
View Full Code Here


    ResultSet result = statement.executeQuery();
   
    List<Filme> listaFilmes = new ArrayList<Filme>();

    while (result.next()) {
      Filme filme = new Filme();
      filme.setId(result.getLong(1));
      filme.setNome(result.getString(2));
      filme.setDataLancamento(new Date(result.getDate(3).getTime()));
      filme.setSinopse(result.getString(4));
      filme.setUrlTrailer(result.getString(5));
     
      listaFilmes.add(filme);
    }
   
    return listaFilmes;
View Full Code Here

    this.hibTemplate.delete(filme);
  }

  @Transactional
  public Filme obterPorId(Long id) throws Exception {
    Filme filme = this.hibTemplate.get(Filme.class, id);
    return filme;
  }
View Full Code Here

  public void cadastrarFilme() {
    try {
      if (this.filme.getId() == null) {
        this.filme.setImagem(this.imagemFilme.getContents());
        this.filmeDAO.inserir(this.filme);
        this.filme = new Filme();
        obterListagemFilmes();
        FacesMessage message =
            new FacesMessage(FacesMessage.SEVERITY_INFO,
                "Filme cadastrado com sucesso.", null);
        FacesContext.getCurrentInstance().addMessage(null, message);
View Full Code Here

  protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    String nome = request.getParameter("nome");
    String sinopse = request.getParameter("sinopse");
    String dataLancamento = request.getParameter("dataLancamento");
   
    Filme filme = new Filme();
    filme.setNome(nome);
    filme.setSinopse(sinopse);
    SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
    try {
      filme.setDataLancamento(sdf.parse(dataLancamento));
    } catch (ParseException e) {
      e.printStackTrace();
    }
   
    this.listaFilmes.add(filme);
View Full Code Here

TOP

Related Classes of br.com.colibri.modelo.Filme

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.