package com.bankaudit.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="maint_district")
public class MaintDistrict implements Serializable{
/*	Table: maint_district
	-------------------------

	Column Information
	----------------------

	Field                   Type         Collation          Null    Key     Default            Extra                        Privileges                       Comment  
	----------------------  -----------  -----------------  ------  ------  -----------------  ---------------------------  -------------------------------  ---------
	country_alpha3_code     varchar(3)   latin1_swedish_ci  NO      PRI     (NULL)                                          select,insert,update,references           
	state_code              varchar(10)  latin1_swedish_ci  NO      PRI     (NULL)                                          select,insert,update,references           
	district_code           varchar(10)  latin1_swedish_ci  NO      PRI     (NULL)                                          select,insert,update,references           
	district_name           varchar(50)  latin1_swedish_ci  NO              (NULL)                                          select,insert,update,references           
	status                  varchar(20)  latin1_swedish_ci  NO              (NULL)                                          select,insert,update,references           
	maker                   varchar(20)  latin1_swedish_ci  NO              (NULL)                                          select,insert,update,references           
	maker_timestamp         timestamp    (NULL)             NO              CURRENT_TIMESTAMP  on update CURRENT_TIMESTAMP  select,insert,update,references           
	checker                 varchar(20)  latin1_swedish_ci  YES             (NULL)                                          select,insert,update,references           
	checker_timestamp       timestamp    (NULL)             YES             (NULL)                                          select,insert,update,references           
	businessdate_timestamp  timestamp    (NULL)             YES             (NULL)                                          select,insert,update,references           
	sysdate_timestamp       timestamp  */
	
	@Id
	@Column(name="country_alpha3_code")
	private String countryAlpha3Code;
	
	@Id
	@Column(name="state_code")
	private String stateCode;
	
	@Id
	@Column(name="district_code")
	private String districtCode;
	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumns({
        @JoinColumn(
            name = "state_code",
            referencedColumnName = "state_code",insertable=false,updatable=false),
        @JoinColumn(
            name = "country_alpha3_code",
            referencedColumnName = "country_alpha3_code",insertable=false,updatable=false)
    })
	private MaintState maintState;
	
	
	@Column(name="district_name")
	private String districtName;
	
	@Column(name="status")
	private String status;
	
	@Column(name="maker",updatable=false)
	private String maker;
	
	@Column(name="maker_timestamp",updatable=false)
	private Date makerTimestamp;
	
	@Column(name="checker")
	private String checker;
	
	@Column(name="checker_timestamp")
	private String checkerTimestamp;
	
	@Column(name="businessdate_timestamp")
	private Date businessdateTimestamp;
	
	@Column(name="sysdate_timestamp")
	private Date sysdateTimestamp;

	/**
	 * @return the countryAlpha3Code
	 */
	public String getCountryAlpha3Code() {
		return countryAlpha3Code;
	}

	/**
	 * @param countryAlpha3Code the countryAlpha3Code to set
	 */
	public void setCountryAlpha3Code(String countryAlpha3Code) {
		this.countryAlpha3Code = countryAlpha3Code;
	}

	/**
	 * @return the stateCode
	 */
	public String getStateCode() {
		return stateCode;
	}

	/**
	 * @param stateCode the stateCode to set
	 */
	public void setStateCode(String stateCode) {
		this.stateCode = stateCode;
	}

	/**
	 * @return the districtCode
	 */
	public String getDistrictCode() {
		return districtCode;
	}

	/**
	 * @param districtCode the districtCode to set
	 */
	public void setDistrictCode(String districtCode) {
		this.districtCode = districtCode;
	}

	/**
	 * @return the maintState
	 */
	public MaintState getMaintState() {
		return maintState;
	}

	/**
	 * @param maintState the maintState to set
	 */
	public void setMaintState(MaintState maintState) {
		this.maintState = maintState;
	}

	/**
	 * @return the districtName
	 */
	public String getDistrictName() {
		return districtName;
	}

	/**
	 * @param districtName the districtName to set
	 */
	public void setDistrictName(String districtName) {
		this.districtName = districtName;
	}

	/**
	 * @return the status
	 */
	public String getStatus() {
		return status;
	}

	/**
	 * @param status the status to set
	 */
	public void setStatus(String status) {
		this.status = status;
	}

	/**
	 * @return the maker
	 */
	public String getMaker() {
		return maker;
	}

	/**
	 * @param maker the maker to set
	 */
	public void setMaker(String maker) {
		this.maker = maker;
	}

	/**
	 * @return the makerTimestamp
	 */
	public Date getMakerTimestamp() {
		return makerTimestamp;
	}

	/**
	 * @param makerTimestamp the makerTimestamp to set
	 */
	public void setMakerTimestamp(Date makerTimestamp) {
		this.makerTimestamp = makerTimestamp;
	}

	/**
	 * @return the checker
	 */
	public String getChecker() {
		return checker;
	}

	/**
	 * @param checker the checker to set
	 */
	public void setChecker(String checker) {
		this.checker = checker;
	}

	/**
	 * @return the checkerTimestamp
	 */
	public String getCheckerTimestamp() {
		return checkerTimestamp;
	}

	/**
	 * @param checkerTimestamp the checkerTimestamp to set
	 */
	public void setCheckerTimestamp(String checkerTimestamp) {
		this.checkerTimestamp = checkerTimestamp;
	}

	/**
	 * @return the businessdateTimestamp
	 */
	public Date getBusinessdateTimestamp() {
		return businessdateTimestamp;
	}

	/**
	 * @param businessdateTimestamp the businessdateTimestamp to set
	 */
	public void setBusinessdateTimestamp(Date businessdateTimestamp) {
		this.businessdateTimestamp = businessdateTimestamp;
	}

	/**
	 * @return the sysdateTimestamp
	 */
	public Date getSysdateTimestamp() {
		return sysdateTimestamp;
	}

	/**
	 * @param sysdateTimestamp the sysdateTimestamp to set
	 */
	public void setSysdateTimestamp(Date sysdateTimestamp) {
		this.sysdateTimestamp = sysdateTimestamp;
	}
	
	
	
}
