All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.db.component.SnapshotMapper Maven / Gradle / Ivy

There is a newer version: 6.3.1
Show newest version
/*
 * SonarQube
 * Copyright (C) 2009-2016 SonarSource SA
 * mailto:contact AT sonarsource DOT com
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
package org.sonar.db.component;

import java.util.List;
import javax.annotation.CheckForNull;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;

public interface SnapshotMapper {

  @CheckForNull
  SnapshotDto selectByKey(long id);

  List selectByIds(@Param("ids") List ids);

  void insert(SnapshotDto snapshot);

  @CheckForNull
  SnapshotDto selectLastSnapshot(Long resourceId);

  int countLastSnapshotByComponentUuid(String componentUuid);

  @CheckForNull
  SnapshotDto selectLastSnapshotByComponentUuid(String componentUuid);

  List selectSnapshotsByQuery(@Param("query") SnapshotQuery query);

  List selectPreviousVersionSnapshots(@Param(value = "componentId") Long componentId, @Param(value = "lastVersion") String lastVersion);

  List selectOldestSnapshots(@Param(value = "componentId") Long componentId, RowBounds rowBounds);

  List selectSnapshotAndChildrenOfScope(@Param(value = "snapshot") Long resourceId, @Param(value = "scope") String scope);

  int updateSnapshotAndChildrenLastFlagAndStatus(@Param(value = "root") Long rootId, @Param(value = "pathRootId") Long pathRootId,
    @Param(value = "path") String path, @Param(value = "isLast") boolean isLast, @Param(value = "status") String status);

  int updateSnapshotAndChildrenLastFlag(@Param(value = "root") Long rootId, @Param(value = "pathRootId") Long pathRootId,
    @Param(value = "path") String path, @Param(value = "isLast") boolean isLast);

  List selectSnapshotBefore(@Param("componentId") long componentId, @Param("date") long date);

  ViewsSnapshotDto selectLatestSnapshot(@Param("componentId") long componentId);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy