package com.atlassian.bitbucket.internal.key.ssh.dao.v0;

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.*;

@Preload
@Table("PUBLIC_KEY")
public interface AoSshKeyV0 extends RawEntity<Integer> {

    String ID_COLUMN = "ID";
    String USER_ID_COLUMN = "USER_ID";
    String TEXT_COLUMN = "KEY_TEXT";
    String MD5_COLUMN = "KEY_MD5";

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

    @NotNull
    @Accessor(USER_ID_COLUMN)
    Integer getUserId();

    @NotNull
    @StringLength(StringLength.UNLIMITED)
    @Accessor(TEXT_COLUMN)
    String getText();

    @Mutator(TEXT_COLUMN)
    void setText(String text);

    @NotNull
    @Indexed
    @Accessor(MD5_COLUMN)
    String getMD5();
}
