Example usage for org.hibernate.jpa AvailableSettings COLLECTION_CACHE_PREFIX

List of usage examples for org.hibernate.jpa AvailableSettings COLLECTION_CACHE_PREFIX

Introduction

In this page you can find the example usage for org.hibernate.jpa AvailableSettings COLLECTION_CACHE_PREFIX.

Prototype

String COLLECTION_CACHE_PREFIX

To view the source code for org.hibernate.jpa AvailableSettings COLLECTION_CACHE_PREFIX.

Click Source Link

Document

Caching configuration should follow the following pattern hibernate.ejb.collectioncache.. usage[, region] where usage is the cache strategy used and region the cache region name

Usage

From source file:com.lg.hibernate.guide.test.BaseEntityManagerFunctionalTestCase.java

License:LGPL

protected Map getConfig() {
    Map<Object, Object> config = Environment.getProperties();
    ArrayList<Class> classes = new ArrayList<Class>();

    classes.addAll(Arrays.asList(getAnnotatedClasses()));
    config.put(AvailableSettings.LOADED_CLASSES, classes);
    for (Map.Entry<Class, String> entry : getCachedClasses().entrySet()) {
        config.put(AvailableSettings.CLASS_CACHE_PREFIX + "." + entry.getKey().getName(), entry.getValue());
    }/*from  ww w  . j  a v  a 2 s  .c om*/
    for (Map.Entry<String, String> entry : getCachedCollections().entrySet()) {
        config.put(AvailableSettings.COLLECTION_CACHE_PREFIX + "." + entry.getKey(), entry.getValue());
    }
    if (getEjb3DD().length > 0) {
        ArrayList<String> dds = new ArrayList<String>();
        dds.addAll(Arrays.asList(getEjb3DD()));
        config.put(AvailableSettings.XML_FILE_NAMES, dds);
    }

    addConfigOptions(config);
    return config;
}