/** * Convert the given user value to a value consumable by OpenJPA kernel constructs. * * @return the same value if the given key is not a valid JPA property key or the value is null. */ public static <T> T convertToKernelValue(Class<T> resultType, String key, Object value) { if (value == null) return null; if (JPAProperties.isValidKey(key)) { // works because enum values are identical String if (value instanceof CacheRetrieveMode || (value instanceof String && CACHE_RETRIEVE_MODE.equals(key))) { return (T)DataCacheRetrieveMode.valueOf(value.toString().trim().toUpperCase()); } else if (value instanceof CacheStoreMode || (value instanceof String && CACHE_STORE_MODE.equals(key))) { return (T)DataCacheStoreMode.valueOf(value.toString().trim().toUpperCase()); } } return (T)value; }
public void refresh(Object entity, LockModeType mode, Map<String, Object> properties) { assertNotCloseInvoked(); assertValidAttchedEntity(REFRESH, entity); _broker.assertWriteOperation(); configureCurrentCacheModes(pushFetchPlan(), properties); configureCurrentFetchPlan(getFetchPlan(), properties, mode, true); DataCacheRetrieveMode rmode = getFetchPlan().getCacheRetrieveMode(); if (DataCacheRetrieveMode.USE.equals(rmode) || rmode == null) { getFetchPlan().setCacheRetrieveMode(DataCacheRetrieveMode.BYPASS); } try { _broker.refresh(entity, this); } finally { popFetchPlan(); } }
public void refresh(Object entity, LockModeType mode, Map<String, Object> properties) { assertNotCloseInvoked(); assertValidAttchedEntity(REFRESH, entity); _broker.assertWriteOperation(); configureCurrentCacheModes(pushFetchPlan(), properties); configureCurrentFetchPlan(getFetchPlan(), properties, mode, true); DataCacheRetrieveMode rmode = getFetchPlan().getCacheRetrieveMode(); if (DataCacheRetrieveMode.USE.equals(rmode) || rmode == null) { getFetchPlan().setCacheRetrieveMode(DataCacheRetrieveMode.BYPASS); } try { _broker.refresh(entity, this); } finally { popFetchPlan(); } }
public void refresh(Object entity, LockModeType mode, Map<String, Object> properties) { assertNotCloseInvoked(); assertValidAttchedEntity(REFRESH, entity); _broker.assertWriteOperation(); configureCurrentCacheModes(pushFetchPlan(), properties); configureCurrentFetchPlan(getFetchPlan(), properties, mode, true); DataCacheRetrieveMode rmode = getFetchPlan().getCacheRetrieveMode(); if (DataCacheRetrieveMode.USE.equals(rmode) || rmode == null) { getFetchPlan().setCacheRetrieveMode(DataCacheRetrieveMode.BYPASS); } try { _broker.refresh(entity, this); } finally { popFetchPlan(); } }
/** * Convert the given user value to a value consumable by OpenJPA kernel constructs. * * @return the same value if the given key is not a valid JPA property key or the value is null. */ public static <T> T convertToKernelValue(Class<T> resultType, String key, Object value) { if (value == null) return null; if (JPAProperties.isValidKey(key)) { // works because enum values are identical String if (value instanceof CacheRetrieveMode || (value instanceof String && CACHE_RETRIEVE_MODE.equals(key))) { return (T)DataCacheRetrieveMode.valueOf(value.toString().trim().toUpperCase(Locale.ENGLISH)); } else if (value instanceof CacheStoreMode || (value instanceof String && CACHE_STORE_MODE.equals(key))) { return (T)DataCacheStoreMode.valueOf(value.toString().trim().toUpperCase(Locale.ENGLISH)); } } return (T)value; }
public void refresh(Object entity, LockModeType mode, Map<String, Object> properties) { assertNotCloseInvoked(); assertValidAttchedEntity(REFRESH, entity); _broker.assertWriteOperation(); configureCurrentCacheModes(pushFetchPlan(), properties); configureCurrentFetchPlan(getFetchPlan(), properties, mode, true); DataCacheRetrieveMode rmode = getFetchPlan().getCacheRetrieveMode(); if (DataCacheRetrieveMode.USE.equals(rmode) || rmode == null) { getFetchPlan().setCacheRetrieveMode(DataCacheRetrieveMode.BYPASS); } try { _broker.refresh(entity, this); } finally { popFetchPlan(); } }
/** * Convert the given user value to a value consumable by OpenJPA kernel constructs. * * @return the same value if the given key is not a valid JPA property key or the value is null. */ public static <T> T convertToKernelValue(Class<T> resultType, String key, Object value) { if (value == null) return null; if (JPAProperties.isValidKey(key)) { // works because enum values are identical String if (value instanceof CacheRetrieveMode || (value instanceof String && CACHE_RETRIEVE_MODE.equals(key))) { return (T)DataCacheRetrieveMode.valueOf(value.toString().trim().toUpperCase()); } else if (value instanceof CacheStoreMode || (value instanceof String && CACHE_STORE_MODE.equals(key))) { return (T)DataCacheStoreMode.valueOf(value.toString().trim().toUpperCase()); } } return (T)value; }
/** * Convert the given user value to a value consumable by OpenJPA kernel constructs. * * @return the same value if the given key is not a valid JPA property key or the value is null. */ public static <T> T convertToKernelValue(Class<T> resultType, String key, Object value) { if (value == null) return null; if (JPAProperties.isValidKey(key)) { // works because enum values are identical String if (value instanceof CacheRetrieveMode || (value instanceof String && CACHE_RETRIEVE_MODE.equals(key))) { return (T)DataCacheRetrieveMode.valueOf(value.toString().trim().toUpperCase(Locale.ENGLISH)); } else if (value instanceof CacheStoreMode || (value instanceof String && CACHE_STORE_MODE.equals(key))) { return (T)DataCacheStoreMode.valueOf(value.toString().trim().toUpperCase(Locale.ENGLISH)); } } return (T)value; }