package com.jasamedika.medifirst2000.entities;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.*;
import javax.validation.constraints.Size;
import java.io.Serializable;

import static javax.persistence.FetchType.LAZY;
import static javax.persistence.GenerationType.SEQUENCE;

/**
 * @author salmanoe
 * @version 1.0.0
 * @since 08/11/2023
 */
@Getter
@Setter
@Entity
@Table(name = "migrasikelurahandesa_m")
public class MigrasiKelurahanDesa implements Serializable {

	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "sg_migrasikelurahandesa_m")
	@SequenceGenerator(name = "sg_migrasikelurahandesa_m", sequenceName = "migrasikelurahandesa_m_seq", allocationSize = 1)
	private Long id;

	@Column(length = 13)
	@Size(max = 13)
	private String kodeKemendagri;

	private String kelurahanAtauDesa;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "migrasikecamatanfk")
	@ToString.Exclude
	private MigrasiKecamatan migrasiKecamatan;

}
