package io.delphiplatform.api.v3.rdb.entity;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;

import lombok.Getter;
import lombok.Setter;

@Entity(name = "region")
@Getter
@Setter
public class RegionEntity extends TrackedEntity {

    @Id
    private String regionId;
    private String regionName;
    private String regionCodeNo;
    private String subRegionName;
    private String subRegionCodeNo;
    @Column(unique = true)
    private String countryCode;
    @Column(name = "country_code_a3", unique = true)
    private String countryCodeA3;
    private String countryName;
    @Column(unique = true)
    private String countryCodeNo;

    @OneToMany(mappedBy = "countryLocaleId.countryCode", fetch = FetchType.LAZY)
    private Set<CountryLocaleEntity> countryLocales;

}
