package com.dbnt.sims.equip.model;

import com.dbnt.sims.config.BaseModel;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

import java.io.Serializable;


@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@IdClass(EquipFile.EquipFileId.class)
@Table(name = "equ_file")
public class EquipFile extends BaseModel implements Serializable{
  @Id
  @Column(name = "equ_key")
  private Integer equKey;
  @Id
  @Column(name = "version_no")
  private Integer versionNo;
  @Column(name = "orig_nm")
  private String origNm;
  @Column(name = "conv_nm")
  private String convNm;
  @Column(name = "file_extn")
  private String fileExtn;
  @Column(name = "file_size")
  private String fileSize;
  @Column(name = "file_path")
  private String filePath;
  

  
@Embeddable
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class EquipFileId implements Serializable {
  private Integer equKey; 
  private Integer versionNo;
}



@Override
public String toString() {
	return "EquipFile [equKey=" + equKey + ", versionNo=" + versionNo + ", origNm=" + origNm + ", convNm=" + convNm
			+ ", fileExtn=" + fileExtn + ", fileSize=" + fileSize + ", filePath=" + filePath + "]";
}












}
