package com.atlassian.bitbucket.internal.mirroring.mirror.dao.v0;

import net.java.ao.Accessor;
import net.java.ao.OneToMany;
import net.java.ao.Preload;
import net.java.ao.RawEntity;
import net.java.ao.schema.NotNull;
import net.java.ao.schema.PrimaryKey;
import net.java.ao.schema.Table;

import static com.atlassian.bitbucket.internal.mirroring.mirror.dao.v0.AoConstantsV0.MODE_COLUMN;
import static com.atlassian.bitbucket.internal.mirroring.mirror.dao.v0.AoConstantsV0.UPSTREAM_ID_COLUMN;

@Preload
@Table(AoUpstreamSettingsV0.TABLE_NAME)
public interface AoUpstreamSettingsV0 extends RawEntity<String> {

    String TABLE_NAME = "UPSTREAM_SETTINGS";

    @NotNull
    @PrimaryKey(UPSTREAM_ID_COLUMN)
    String getUpstreamId();

    @NotNull
    @Accessor(MODE_COLUMN)
    String getMode();

    @OneToMany(reverse = "getUpstreamSettings")
    AoMirroredProjectV0[] getMirroredProjects();
}
