001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.dynamicdatalists.service.impl;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.util.OrderByComparator;
019    import com.liferay.portlet.dynamicdatalists.model.DDLRecordVersion;
020    import com.liferay.portlet.dynamicdatalists.service.base.DDLRecordVersionLocalServiceBaseImpl;
021    
022    import java.util.List;
023    
024    /**
025     * @author Marcellus Tavares
026     */
027    public class DDLRecordVersionLocalServiceImpl
028            extends DDLRecordVersionLocalServiceBaseImpl {
029    
030            @Override
031            public DDLRecordVersion getRecordVersion(long recordVersionId)
032                    throws PortalException {
033    
034                    return ddlRecordVersionPersistence.findByPrimaryKey(recordVersionId);
035            }
036    
037            @Override
038            public DDLRecordVersion getRecordVersion(long recordId, String version)
039                    throws PortalException {
040    
041                    return ddlRecordVersionPersistence.findByR_V(recordId, version);
042            }
043    
044            @Override
045            public List<DDLRecordVersion> getRecordVersions(
046                    long recordId, int start, int end,
047                    OrderByComparator<DDLRecordVersion> orderByComparator) {
048    
049                    return ddlRecordVersionPersistence.findByRecordId(
050                            recordId, start, end, orderByComparator);
051            }
052    
053            @Override
054            public int getRecordVersionsCount(long recordId) {
055                    return ddlRecordVersionPersistence.countByRecordId(recordId);
056            }
057    
058    }