Example usage for com.liferay.portal.kernel.dao.orm ObjectNotFoundException ObjectNotFoundException

List of usage examples for com.liferay.portal.kernel.dao.orm ObjectNotFoundException ObjectNotFoundException

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.dao.orm ObjectNotFoundException ObjectNotFoundException.

Prototype

public ObjectNotFoundException(Throwable cause) 

Source Link

Usage

From source file:com.liferay.salesforce.service.impl.SalesforceLocalServiceImpl.java

License:Open Source License

public Message executeQuery(long companyId, String objectId, String objectType, List<String> fieldNames,
        long ownerId) throws ObjectNotFoundException, SystemException {

    SalesforceConnection salesforceConnection = getSalesforceConnection(companyId, ownerId);

    SObject[] sObjects = salesforceConnection.retrieve(StringUtil.merge(fieldNames), objectType,
            new String[] { objectId });

    if ((sObjects == null) || (sObjects.length == 0)) {
        throw new ObjectNotFoundException(objectId);
    }/*ww  w  . ja v  a  2 s  .  c  o m*/

    return SObjectConverter.convert(sObjects[0]);
}