package com.izouma.jiashanxia.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import java.util.List;

//@Entity
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
@ApiModel(value = "企业表")
public class Company extends BaseEntity {

    private Long userId;

    @ApiModelProperty(value = "企业名称")
    private String name;

    @ApiModelProperty(value = "员工")
    @OneToMany(cascade = CascadeType.DETACH)
    @JoinColumn(name = "user_id")
    private List<User> users;


}
