001
014
015 package com.liferay.portal.service.persistence;
016
017 import com.liferay.portal.kernel.dao.orm.ORMException;
018 import com.liferay.portal.kernel.dao.orm.Session;
019 import com.liferay.portal.model.BaseModel;
020
021
025 public class BatchSessionUtil {
026
027 public static BatchSession getBatchSession() {
028 return _batchSession;
029 }
030
031 public static boolean isEnabled() {
032 return getBatchSession().isEnabled();
033 }
034
035 public static void setEnabled(boolean enabled) {
036 getBatchSession().setEnabled(enabled);
037 }
038
039 public static void update(
040 Session session, BaseModel<?> model, boolean merge)
041 throws ORMException {
042
043 getBatchSession().update(session, model, merge);
044 }
045
046 public void setBatchSession(BatchSession batchSession) {
047 _batchSession = batchSession;
048 }
049
050 private static BatchSession _batchSession;
051
052 }