package com.atlassian.stash.internal.repository.sync.dao;

import net.java.ao.Accessor;
import net.java.ao.Mutator;
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 java.util.Date;

/**
 * @since 2.6
 */
@Preload
@Table("SYNC_CONFIG")
public interface AoRefSyncConfig extends RawEntity<Integer> {

    String ENABLED_COLUMN = "IS_ENABLED";
    String LAST_SYNC_COLUMN = "LAST_SYNC";
    String REPOSITORY_ID_COLUMN = "REPOSITORY_ID";

    @Accessor(LAST_SYNC_COLUMN)
    @NotNull
    Date getLastSync();

    @NotNull
    @PrimaryKey(REPOSITORY_ID_COLUMN)
    int getRepositoryId();

    @Accessor(ENABLED_COLUMN)
    @NotNull
    boolean isEnabled();

    @Mutator(ENABLED_COLUMN)
    void setEnabled(boolean enabled);

    @Mutator(LAST_SYNC_COLUMN)
    void setLastSync(Date lastSync);
}
