Каталог статей
Меню сайта


Форма входа


Категории раздела
Oracle DB administering [46]
Oracle DB programming [15]
Oracle DB troubleshooting [11]


Поиск


Друзья сайта
  • Официальный блог
  • Сообщество uCoz
  • FAQ по системе
  • Инструкции для uCoz


  • Статистика

    Онлайн всего: 1
    Гостей: 1
    Пользователей: 0


    Приветствую Вас, Гость · RSS 20.05.2024, 00:06
    Главная » Статьи » Oracle DB » Oracle DB administering

    JPA

    JPA 2.0 Cache APIs

    JPA 2.0 provides a set of standard query hints to allow refreshing or bypassing the cache. The query hints are defined on the two enum classes CacheRetrieveMode and CacheStoreMode.

    Query hints:

    • javax.persistence.cache.retrieveMode : CacheRetrieveMode
      • BYPASS : Ignore the cache, and build the object directly from the database result.
      • USE : Allow the query to use the cache. If the object/data is already in the cache, the cached object/data will be used.
    • javax.persistence.cache.storeMode : CacheStoreMode
      • BYPASS : Do not cache the database results.
      • REFRESH : If the object/data is already in the cache, then refresh/replace it with the database results.
      • USE : Cache the objects/data returned from the query.

    Cache hints example

    Query query = em.createQuery("Select e from Employee e");
    query.setHint("javax.persistence.cache.storeMode", CacheStoreMode.REFRESH);
    
    Категория: Oracle DB administering | Добавил: basil (29.12.2015)
    Просмотров: 355 | Рейтинг: 0.0/0
    Всего комментариев: 0
    Имя *:
    Email *:
    Код *:
    Бесплатный конструктор сайтов - uCoz