1
14
15 package com.liferay.portal.kernel.dao.orm;
16
17 import java.io.Serializable;
18
19
24 public class EntityCacheUtil {
25
26 public static void clearCache() {
27 getEntityCache().clearCache();
28 }
29
30 public static void clearCache(String className) {
31 getEntityCache().clearCache(className);
32 }
33
34 public static void clearLocalCache() {
35 getEntityCache().clearLocalCache();
36 }
37
38 public static EntityCache getEntityCache() {
39 return _finderCache;
40 }
41
42 public static Object getResult(
43 boolean entityCacheEnabled, Class<?> classObj,
44 Serializable primaryKeyObj, SessionFactory sessionFactory) {
45
46 return getEntityCache().getResult(
47 entityCacheEnabled, classObj, primaryKeyObj, sessionFactory);
48 }
49
50 public static void invalidate() {
51 getEntityCache().invalidate();
52 }
53
54 public static Object loadResult(
55 boolean entityCacheEnabled, Class<?> classObj,
56 Serializable primaryKeyObj, SessionFactory sessionFactory) {
57
58 return getEntityCache().loadResult(
59 entityCacheEnabled, classObj, primaryKeyObj, sessionFactory);
60 }
61
62 public static void putResult(
63 boolean entityCacheEnabled, Class<?> classObj,
64 Serializable primaryKeyObj, Object result) {
65
66 getEntityCache().putResult(
67 entityCacheEnabled, classObj, primaryKeyObj, result);
68 }
69
70 public static void removeCache(String className) {
71 getEntityCache().removeCache(className);
72 }
73
74 public static void removeResult(
75 boolean entityCacheEnabled, Class<?> classObj,
76 Serializable primaryKeyObj) {
77
78 getEntityCache().removeResult(
79 entityCacheEnabled, classObj, primaryKeyObj);
80 }
81
82 public void setEntityCache(EntityCache finderCache) {
83 _finderCache = finderCache;
84 }
85
86 private static EntityCache _finderCache;
87
88 }