package com.uas.search.console.b2b.model;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = KindSimpleInfo.TABLE_NAME)
public class KindSimpleInfo {

	public static final String TABLE_NAME = "PRODUCT$KIND";

	public static final String ID_FIELD = "ki_id";

	public static final String NAMECN_FIELD = "ki_name";

	public static final String NAMEEN_FIELD = "ki_name_en";


	/**
	 * id
	 */
	@Id
	@Column(name = ID_FIELD)
	private Long id;

	/**
	 * 类目名称
	 */
	@Column(name = NAMECN_FIELD)
	private String nameCn;

	/**
	 * 英文名
	 */
	@Column(name = NAMEEN_FIELD)
	private String nameEn;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getNameCn() {
		return nameCn;
	}

	public void setNameCn(String nameCn) {
		this.nameCn = nameCn;
	}

	public String getNameEn() {
		return nameEn;
	}

	public void setNameEn(String nameEn) {
		this.nameEn = nameEn;
	}

	/**
	 * 获取所有可以搜索的字段列名（索引的field名）
	 *
	 * @return 可以搜索的字段列名
	 */
	public static List<String> getKeywordFields() {
		List<String> fields = new ArrayList<>();
		fields.add(NAMECN_FIELD);
		fields.add(NAMEEN_FIELD);
		return fields;
	}

	@Override
	public String toString() {
		return "KindSimpleInfo [id=" + id + ", nameCn=" + nameCn + ", nameEn=" + nameEn + "]";
	}

}
