com.gisgraphy.dao

## Interface UniversalDao

- All Known Subinterfaces:
    LookupDao
  All Known Implementing Classes:
    LookupDaoHibernate, UniversalDaoHibernate

      public interface UniversalDao

  Data Access Object (DAO) interface.
  Author:
    Matt Raible Modifications and comments by Bryan Noll This thing used to be named simply 'GenericDao' in versions of appfuse prior to 2.0. It was renamed in an attempt to distinguish and describe it as something different than GenericDao. GenericDao is intended for subclassing, and was named Generic because 1) it has very general functionality and 2) is 'generic' in the Java 5 sense of the word... aka... it uses Generics. Implementations of this class are not intended for subclassing. You most likely would want to subclass GenericDao. The only real difference is that instances of java.lang.Class are passed into the methods in this class, and they are part of the constructor in the GenericDao, hence you'll have to do some casting if you use this one.
  See Also:
    `GenericDao`

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `get(Class<?> clazz, Serializable id)` Generic method to get an object based on class and identifier.
    `List<?>` | `getAll(Class<?> clazz)` Generic method used to get all objects of a particular type.
    `void` | `remove(Class<?> clazz, Serializable id)` Generic method to delete an object based on class and id
    `Object` | `save(Object o)` Generic method to save an object - handles both update and insert.

- - ### Method Detail

    - #### getAll

          List<?> getAll(Class<?> clazz)

      Generic method used to get all objects of a particular type. This is the same as lookup up all rows in a table.
      Parameters:
        `clazz` - the type of objects (a.k.a. while table) to get data from
      Returns:
        List of populated objects

    - #### get

          Object get(Class<?> clazz,
                   Serializable id)

      Generic method to get an object based on class and identifier. An ObjectRetrievalFailureException Runtime Exception is thrown if nothing is found.
      Parameters:
        `clazz` - model class to lookup
        `id` - the identifier (primary key) of the class
      Returns:
        a populated object
      See Also:
        `ObjectRetrievalFailureException`

    - #### save

          Object save(Object o)

      Generic method to save an object - handles both update and insert.
      Parameters:
        `o` - the object to save
      Returns:
        a populated object

    - #### remove

          void remove(Class<?> clazz,
                    Serializable id)

      Generic method to delete an object based on class and id
      Parameters:
        `clazz` - model class to lookup
        `id` - the identifier (primary key) of the class

Copyright © 2015. All rights reserved.