package com.bocloud.ims.entity.resource;

import java.util.List;

import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.IgnoreAll;
import com.bocloud.entity.annotations.PK;
import com.bocloud.entity.annotations.Table;
import com.bocloud.entity.bean.Generic;
import com.bocloud.entity.meta.PKStrategy;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 资源池-对象（集群，宿主机，可用域）关联表
 *
 * @author ymh
 * @时间 2018年12月26日
 */
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@Table("pool_group_relation")
public class PoolGroupRelation extends Generic {

	// 主键ID
	@PK(value = PKStrategy.AUTO)
	private Long id;
	// 资源池ID
	@Column("pool_group_id")
	private Long poolGroupId;
	// 目标ID
	@Column("target")
	private Long target;
	// 绑定的目标类型
	@Column("category")
	private String category;
	// 是否启用
	@Column("enabled")
	private Boolean enabled;
	/**
	 * 端口组以及绑定的IP池，数据格式 [ { "portGroupId":1, "poolId":1 } ]
	 */
	@Column("networks")
	private String networks;
	// 数据存储ID
	@Column("store_ids")
	private String storeIds;

	public PoolGroupRelation(Long id, Long poolGroupId, Long target, String category, Boolean enabled, String networks,
			String storeIds) {
		super();
		this.id = id;
		this.poolGroupId = poolGroupId;
		this.target = target;
		this.category = category;
		this.enabled = enabled;
		this.networks = networks;
		this.storeIds = storeIds;
	}

	@IgnoreAll
	private List<Long> targetIds;

}
