package quotes.common.model;

import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.relational.core.mapping.Table;

/**
 * This class stores a quote from various sources, e.g., Zippy,
 * Handey, etc.
 *
 * The {@code @Data} annotation generates all the boilerplate that is
 * normally associated with simple Plain Old Java Objects (POJOs) and
 * beans, including getters for all fields and setters for all
 * non-final fields.
 *
 * The {@code NoArgsConstructor} annotation will generate a
 * constructor with no parameters.
 */
@Entity
@Table(name = "QUOTE")
@Data
@NoArgsConstructor
public class Quote {
    /**
     * ID # of the quote (the primary key generated by the database).
     */
    @Id
    private Integer id;

    /**
     * The play associated with the {@link Quote}, e.g.,
     * "Hamlet", "Macbeth", etc.
     */
    private String play;

    /**
     * A quote from some Bard play.
     */
    private String quote;

    /**
     * The sentiment of the {@link Quote}.
     */
    private String sentiment;

    /**
     * The constructor initializes the fields.
     * @param quoteId ID # of the quote (the primary key)
     * @param play This is the play associated with the {@link Quote},
     *              e.g., "Hamlet", "Macbeth", etc.
     * @param quote A quote from some Bard play
     * @param sentiment The sentiment of the {@link Quote}
     */
    public Quote(int quoteId,
                 String play,
                 String quote,
                 String sentiment) {
        this.id = quoteId;
        this.play = play;
        this.quote = quote;
        this.sentiment = sentiment;
    }
}
