package com.izouma.zhirongip.domain;

import com.izouma.zhirongip.enums.NavType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where;

import javax.persistence.*;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@ApiModel(value = "banner")
@Where(clause = "del = 0")
public class Banner extends BaseEntity {
    @ApiModelProperty(value = "图片")
    private String img;

    @ApiModelProperty(value = "链接")
    private String url;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty("位置")
    private Long navigationId;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "navigationId", insertable = false, updatable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
    private Navigation navigation;

}
