package com.dsk.common.dtos;

import java.io.*;

/**
 * <pre>
 * <b>.</b>
 * <b>Description:实体类基类</b> 
 * 
 * <b>Author:</b> vip@chennxu.com
 * <b>Date:</b> 2016年9月3日 上午11:49:20
 * <b>Copyright:</b> Copyright &copy;2006-2015 chennxu.com Co., Ltd. All rights reserved.
 * <b>Changelog:</b>
 *   Ver   Date                  Author              Detail
 *   ----------------------------------------------------------------------
 *   1.0   2016年9月3日 上午11:49:20   vip@chennxu.com        new file.
 * </pre>
 */
public class Entity implements Serializable, Cloneable, Comparable<Entity> {

	/**
	 * 序列化版本标示
	 */
	private static final long serialVersionUID = 1L;


	/**
	 * 深度克隆
	 * 
	 * @return 克隆后得到的对象
	 * @throws IOException
	 * @throws ClassNotFoundException
	 */
	public final Object deepClone() throws IOException, ClassNotFoundException {
		ByteArrayOutputStream bos = new ByteArrayOutputStream();
		ObjectOutputStream oos = new ObjectOutputStream(bos);
		oos.writeObject(this);
		ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
		return new ObjectInputStream(bis).readObject();
	}

	@Override
	protected Object clone() throws CloneNotSupportedException {
		// TODO Auto-generated method stub
		return super.clone();
	}

	public int compareTo(Entity o) {
		return 0;
	}

}
