AbstractPersistence (gCube Species Discovery 3.3.0-SNAPSHOT API)
Date: 2013-07-19

org.gcube.portlets.user.speciesdiscovery.server.persistence.dao

## Class AbstractPersistence<T>

- java.lang.Object
- - org.gcube.portlets.user.speciesdiscovery.server.persistence.dao.AbstractPersistence<T>

- Direct Known Subclasses:
    OccurrenceJobPersistence, OccurrenceRowPersistence, ResultRowPersistence, TaxonomyJobPersistence, TaxonomyRowPersistence, TaxonRowPersistence

      public abstract class AbstractPersistence<T>
      extends Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `String` | `AND`
    `protected javax.persistence.EntityManagerFactory` | `entityManagerFactory`
    `protected org.gcube.common.core.utils.logging.GCUBELog` | `logger`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract int` | `countItems()`
    `javax.persistence.EntityManager` | `createNewManager()`
    `abstract int` | `deleteItemByIdField(String idField)`
    `abstract List<T>` | `executeCriteriaQuery(javax.persistence.criteria.CriteriaQuery<Object> criteriaQuery)`
    `abstract List<T>` | `executeTypedQuery(javax.persistence.criteria.CriteriaQuery<Object> cq, int startIndex, int offset)`
    `abstract javax.persistence.criteria.CriteriaBuilder` | `getCriteriaBuilder()`
    `javax.persistence.EntityManagerFactory` | `getEntityManagerFactory()`
    `abstract T` | `getItemByKey(Integer id)`
    `abstract List<T>` | `getList()`
    `abstract List<T>` | `getList(int startIndex, int offset)`
    `abstract List<T>` | `getList(Map<String,String> filterMap, int startIndex, int offset)`
    `boolean` | `insert(T item)`
    `boolean` | `remove(T item, boolean transaction)`
    `abstract int` | `removeAll()`
    `abstract javax.persistence.criteria.Root<T>` | `rootFrom(javax.persistence.criteria.CriteriaQuery<Object> cq)`
    `T` | `update(T item)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### entityManagerFactory

          protected javax.persistence.EntityManagerFactory entityManagerFactory

    - #### AND

          public final String AND

      See Also:
        Constant Field Values

    - #### logger

          protected org.gcube.common.core.utils.logging.GCUBELog logger

  - ### Method Detail

    - #### insert

          public boolean insert(T item)
                         throws DatabaseServiceException

      Parameters:
        `item` -
      Returns:
      Throws:
        `DatabaseServiceException`

    - #### update

          public T update(T item)
                   throws DatabaseServiceException

      Parameters:
        `item` -
      Returns:
      Throws:
        `DatabaseServiceException`

    - #### remove

          public boolean remove(T item,
                       boolean transaction)
                         throws DatabaseServiceException

      Parameters:
        `item` -
      Returns:
      Throws:
        `DatabaseServiceException`

    - #### removeAll

          public abstract int removeAll()
                                 throws DatabaseServiceException

      Returns:
      Throws:
        `DatabaseServiceException`

    - #### getList

          public abstract List<T> getList()
                                   throws DatabaseServiceException

      Parameters:
        `filerMap` -
      Returns:
      Throws:
        `DatabaseServiceException`

    - #### getList

          public abstract List<T> getList(int startIndex,
                        int offset)
                                   throws DatabaseServiceException

      Returns:
      Throws:
        `DatabaseServiceException`

    - #### countItems

          public abstract int countItems()
                                  throws DatabaseServiceException

      Returns:
      Throws:
        `DatabaseServiceException`

    - #### getItemByKey

          public abstract T getItemByKey(Integer id)
                                  throws DatabaseServiceException

      Parameters:
        `employeeId` -
      Returns:
      Throws:
        `DatabaseServiceException`

    - #### executeCriteriaQuery

          public abstract List<T> executeCriteriaQuery(javax.persistence.criteria.CriteriaQuery<Object> criteriaQuery)
                                                throws DatabaseServiceException

      Parameters:
        `builder` -
      Returns:
      Throws:
        `DatabaseServiceException`

    - #### getEntityManagerFactory

          public javax.persistence.EntityManagerFactory getEntityManagerFactory()

      Returns:

    - #### createNewManager

          public javax.persistence.EntityManager createNewManager()
                                                           throws DatabaseServiceException

      Returns:
      Throws:
        `DatabaseServiceException`

    - #### getCriteriaBuilder

          public abstract javax.persistence.criteria.CriteriaBuilder getCriteriaBuilder()
                                                                                 throws DatabaseServiceException

      Returns:
      Throws:
        `DatabaseServiceException`

    - #### executeTypedQuery

          public abstract List<T> executeTypedQuery(javax.persistence.criteria.CriteriaQuery<Object> cq,
                                  int startIndex,
                                  int offset)
                                             throws DatabaseServiceException

      Returns:
      Throws:
        `DatabaseServiceException`

    - #### rootFrom

          public abstract javax.persistence.criteria.Root<T> rootFrom(javax.persistence.criteria.CriteriaQuery<Object> cq)

      Parameters:
        `cq` -
      Returns:

    - #### getList

          public abstract List<T> getList(Map<String,String> filterMap,
                        int startIndex,
                        int offset)
                                   throws DatabaseServiceException

      Parameters:
        `filterMap` -
        `startIndex` -
        `offset` -
      Returns:
      Throws:
        `DatabaseServiceException`

    - #### deleteItemByIdField

          public abstract int deleteItemByIdField(String idField)
                                           throws DatabaseServiceException

      Parameters:
        `idField` -
      Returns:
      Throws:
        `DatabaseServiceException`

Copyright © 2013. All Rights Reserved.