Package model.DAO

Class UtenteDAO

java.lang.Object
model.DAO.UtenteDAO
All Implemented Interfaces:
DAO<Utente>

public final class UtenteDAO
extends java.lang.Object
implements DAO<Utente>
  • Constructor Summary

    Constructors
    Constructor Description
    UtenteDAO()  
  • Method Summary

    Modifier and Type Method Description
    boolean delete​(Utente entity)  
    Utente doLogin​(Utente utente)
    Metodo che permette il login.
    Utente extract​(java.sql.ResultSet resultSet)  
    int fillPreparedStatement​(java.sql.PreparedStatement preparedStatement, Utente entity)
    Riempe il preparedStatement.
    java.util.List<Utente> getAll()  
    Utente getById​(int id)  
    boolean save​(Utente entity)  
    boolean update​(Utente entity)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • UtenteDAO

      public UtenteDAO()
  • Method Details

    • getById

      public Utente getById​(int id)
      Specified by:
      getById in interface DAO<Utente>
      Parameters:
      id - rappresenta l'identificativo dell'entity
      Returns:
      null se non viene trovato nessun risultato, un'istanza di T nel caso in cui viene trovato un risultato
    • doLogin

      public Utente doLogin​(Utente utente)
      Metodo che permette il login.
      Parameters:
      utente - Il bean contenete alcune informazioni sull'utente che intende effettuare il login
      Returns:
      Il bean dell'utente presente nel database
    • getAll

      public java.util.List<Utente> getAll()
      Specified by:
      getAll in interface DAO<Utente>
      Returns:
      una lista di entity T
    • update

      public boolean update​(Utente entity)
      Specified by:
      update in interface DAO<Utente>
      Parameters:
      entity - l'istanza da aggiornare
      Returns:
      false --> se l'operazione non va a buon fine, true --> se l'operazione va a buon fine
    • save

      public boolean save​(Utente entity)
      Specified by:
      save in interface DAO<Utente>
      Parameters:
      entity - l'istanza da salvare
      Returns:
      false --> se l'operazione non va a buon fine, true --> se l'operazione va a buon fine
    • delete

      public boolean delete​(Utente entity)
      Specified by:
      delete in interface DAO<Utente>
      Parameters:
      entity - l'istanza da eliminare
      Returns:
      false --> se l'operazione non va a buon fine, true --> se l'operazione va a buon fine
    • extract

      public Utente extract​(java.sql.ResultSet resultSet) throws java.sql.SQLException
      Specified by:
      extract in interface DAO<Utente>
      Parameters:
      resultSet - resultSet della query eseguita
      Returns:
      l'istanza della della classe T popolata con le informazioni presenti nel resultSet
      Throws:
      java.sql.SQLException - eccezione lanciata in caso di problemi
    • fillPreparedStatement

      public int fillPreparedStatement​(java.sql.PreparedStatement preparedStatement, Utente entity) throws java.sql.SQLException
      Riempe il preparedStatement.
      Parameters:
      preparedStatement - il preparedStatement da riempire
      entity - l'entità da dove prelevare le informazioni
      Returns:
      l'indice del prossimo campo da riempire
      Throws:
      java.sql.SQLException - l'eccezione