edu.uoc.tfc.exuoc.controladors
Class GestorGrups

java.lang.Object
  extended by edu.uoc.tfc.exuoc.controladors.GestorGrups

public class GestorGrups
extends java.lang.Object

classe que contindrà totes les funcionalitats dels objectes Grup, estableix la connexió amb l'objecte DAO per obtenir/enviar els objectes de tipus Grup. D'entrada aquest controlador només gestionarà les dades en forma de lectura ja que no s'implementarà cap funcionalitat per guardar grups. Actua com si fos una llista Enumeration.


Constructor Summary
GestorGrups()
           
 
Method Summary
 Grup llegir(java.lang.Long id)
           
 Grup llegir(java.lang.String nomGrup)
           
 java.util.Iterator<Grup> llistat()
           
 java.util.Iterator<Grup> llistat(int ini, int fi)
           
 java.util.Iterator<Grup> llistat(java.lang.String ordre, int quants)
           
static void main(java.lang.String[] args)
          MAIN
 java.lang.Long modificar(Grup grup)
          Modifica el grup indicat, actualment només es poden afegir/eliminar usuaris als grups.
 int numGrups()
           
 void obrir()
           
 void tancar()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GestorGrups

public GestorGrups()
Method Detail

obrir

public void obrir()
           throws org.hibernate.HibernateException
Throws:
org.hibernate.HibernateException

tancar

public void tancar()
            throws org.hibernate.HibernateException
Throws:
org.hibernate.HibernateException

modificar

public java.lang.Long modificar(Grup grup)
                         throws org.hibernate.HibernateException,
                                BuitException
Modifica el grup indicat, actualment només es poden afegir/eliminar usuaris als grups.

Parameters:
grup -
Returns:
Retorna un valor diferent de 0 si dóna un error
Throws:
org.hibernate.HibernateException
BuitException

llegir

public Grup llegir(java.lang.Long id)
            throws NoExisteixException,
                   org.hibernate.HibernateException,
                   BuitException
Throws:
NoExisteixException
org.hibernate.HibernateException
BuitException

llegir

public Grup llegir(java.lang.String nomGrup)
            throws NoExisteixException,
                   org.hibernate.HibernateException,
                   BuitException
Throws:
NoExisteixException
org.hibernate.HibernateException
BuitException

llistat

public java.util.Iterator<Grup> llistat()
                                 throws org.hibernate.HibernateException,
                                        BuitException
Throws:
org.hibernate.HibernateException
BuitException

llistat

public java.util.Iterator<Grup> llistat(int ini,
                                        int fi)
                                 throws org.hibernate.HibernateException,
                                        BuitException
Throws:
org.hibernate.HibernateException
BuitException

llistat

public java.util.Iterator<Grup> llistat(java.lang.String ordre,
                                        int quants)
                                 throws org.hibernate.HibernateException,
                                        BuitException
Parameters:
ordre -
quants -
Returns:
Throws:
org.hibernate.HibernateException
BuitException - Per futures implementacions de més funionalitats al gestor i per quan s'haig de fer un llistat paginat.

numGrups

public int numGrups()
             throws org.hibernate.HibernateException,
                    BuitException
Returns:
Nombre d'usuaris del sistema
Throws:
org.hibernate.HibernateException
BuitException

main

public static void main(java.lang.String[] args)
MAIN