package com.atlassian.bitbucket.internal.defaultreviewers.dao;

import net.java.ao.*;
import net.java.ao.schema.*;

@Table("PR_CONDITION")
@Preload
public interface AoPullRequestCondition extends RawEntity<Integer> {
    String ID_COLUMN = "PR_CONDITION_ID";
    String REPOSITORY_ID_COLUMN = "REPOSITORY_ID";
    String SOURCE_REF_MATCHER_ID_COLUMN = "SOURCE_REF_VALUE";
    String SOURCE_REF_MATCHER_TYPE_COLUMN = "SOURCE_REF_TYPE";
    String TARGET_REF_MATCHER_ID_COLUMN = "TARGET_REF_VALUE";
    String TARGET_REF_MATCHER_TYPE_COLUMN = "TARGET_REF_TYPE";
    String REQUIRED_APPROVALS_COLUMN = "REQUIRED_APPROVALS";
    int MAX_REF_MATCHER_ID_LENGTH = 255;
    int MAX_REF_MATCHER_TYPE_LENGTH = 255;

    @OneToMany(reverse = "getCondition")
    AoReviewer[] getReviewers();

    @AutoIncrement
    @NotNull
    @PrimaryKey(ID_COLUMN)
    Integer getId();

    @NotNull
    @Accessor(REPOSITORY_ID_COLUMN)
    @Indexed
    Integer getRepositoryId();

    @Mutator(REPOSITORY_ID_COLUMN)
    void setRepository(Integer newRepository);

    @NotNull
    @Accessor(SOURCE_REF_MATCHER_ID_COLUMN)
    @Indexed
    @StringLength(MAX_REF_MATCHER_ID_LENGTH)
    String getSourceMatcherId();

    @Mutator(SOURCE_REF_MATCHER_ID_COLUMN)
    void setSourceMatcherId(String sourceMatcherId);

    @NotNull
    @Accessor(SOURCE_REF_MATCHER_TYPE_COLUMN)
    @Indexed
    @StringLength(MAX_REF_MATCHER_TYPE_LENGTH)
    String getSourceMatcherType();

    @Mutator(SOURCE_REF_MATCHER_TYPE_COLUMN)
    void setSourceMatcherType(String sourceMatcherType);

    @NotNull
    @Accessor(TARGET_REF_MATCHER_ID_COLUMN)
    @Indexed
    @StringLength(MAX_REF_MATCHER_ID_LENGTH)
    String getTargetMatcherId();

    @Mutator(TARGET_REF_MATCHER_ID_COLUMN)
    void setTargetMatcherId(String targetMatcherId);

    @NotNull
    @Accessor(TARGET_REF_MATCHER_TYPE_COLUMN)
    @Indexed
    @StringLength(MAX_REF_MATCHER_TYPE_LENGTH)
    String getTargetMatcherType();

    @Mutator(TARGET_REF_MATCHER_TYPE_COLUMN)
    void setTargetMatcherType(String targetMatcherType);

    @Accessor(REQUIRED_APPROVALS_COLUMN)
    int getRequiredApprovals();

    @Mutator(REQUIRED_APPROVALS_COLUMN)
    void setRequiredApprovals(int requiredApprovals);
}
