001
014
015 package com.liferay.portlet.dynamicdatamapping.storage;
016
017 import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018 import com.liferay.portal.service.ServiceContext;
019 import com.liferay.portlet.dynamicdatamapping.StorageException;
020
021
024 public class StorageEngineUtil {
025
026 public static long create(
027 long companyId, long ddmStructureId, DDMFormValues ddmFormValues,
028 ServiceContext serviceContext)
029 throws StorageException {
030
031 return getStorageEngine().create(
032 companyId, ddmStructureId, ddmFormValues, serviceContext);
033 }
034
035 public static void deleteByClass(long classPK) throws StorageException {
036 getStorageEngine().deleteByClass(classPK);
037 }
038
039 public static void deleteByDDMStructure(long ddmStructureId)
040 throws StorageException {
041
042 getStorageEngine().deleteByDDMStructure(ddmStructureId);
043 }
044
045 public static DDMFormValues getDDMFormValues(long classPK)
046 throws StorageException {
047
048 return getStorageEngine().getDDMFormValues(classPK);
049 }
050
051 public static StorageEngine getStorageEngine() {
052 PortalRuntimePermission.checkGetBeanProperty(StorageEngineUtil.class);
053
054 return _storageEngine;
055 }
056
057 public static void update(
058 long classPK, DDMFormValues ddmFormValues,
059 ServiceContext serviceContext)
060 throws StorageException {
061
062 getStorageEngine().update(classPK, ddmFormValues, serviceContext);
063 }
064
065 public void setStorageEngine(StorageEngine storageEngine) {
066 PortalRuntimePermission.checkSetBeanProperty(getClass());
067
068 _storageEngine = storageEngine;
069 }
070
071 private static StorageEngine _storageEngine;
072
073 }