/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved.
 * <a>http://www.crunii.com</a>
 */
package com.crunii.micro.domain.common.jdbc.dto;

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

import java.beans.PropertyDescriptor;
import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;

/**
 * @author 田平 create 2020/11/27 16:53
 */
@Setter
@Getter
@ToString
public class DomainInfo implements Serializable {

	private static final long serialVersionUID = 1L;

	private String domainName;

	private String tableName;

	private String schemaName;

	private PropertyDescriptor primaryProp;

	private DomainCol primaryCol;

	private Map<String, DomainCol> cols = new LinkedHashMap<>(30);

	private String selectColSql;

	private String pageBaseSql;

	private String pageCountBaseSql;

	private String getBaseSql;

	private String getByPrimarySql;

	private String insertSql;

	private String deleteSql;

	private String updateBaseSql;

	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (o == null || getClass() != o.getClass()) {
			return false;
		}
		DomainInfo that = (DomainInfo) o;
		return Objects.equals(domainName, that.domainName);
	}

	@Override
	public int hashCode() {
		return Objects.hash(domainName);
	}
}
