Example usage for com.liferay.portal.kernel.exception ModelListenerException ModelListenerException

List of usage examples for com.liferay.portal.kernel.exception ModelListenerException ModelListenerException

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.exception ModelListenerException ModelListenerException.

Prototype

public ModelListenerException() 

Source Link

Usage

From source file:com.liferay.osb.scv.connector.internal.model.SCVModel.java

License:Open Source License

@Override
public void onBeforeUpdate(T model) throws ModelListenerException {
    long mappingDataSourceId = MappingDataSourceUtil.getMappingDataSourceId();

    if (mappingDataSourceId == 0) {
        return;/*from w  w w. ja va 2  s . c  o m*/
    }

    PersistedModel originalModel = null;

    try {
        PersistedModelLocalService persistedModelLocalService = PersistedModelLocalServiceRegistryUtil
                .getPersistedModelLocalService(model.getModelClassName());
        originalModel = persistedModelLocalService.getPersistedModel(model.getPrimaryKeyObj());

        _models.put(model.getPrimaryKeyObj(), originalModel);
    } catch (Exception e) {
        throw new ModelListenerException();
    }
}