/*******************************************************************************
 * Copyright SemanticBits, Northwestern University and Akaza Research
 * 
 * Distributed under the OSI-approved BSD 3-Clause License.
 * See http://ncip.github.com/caaers/LICENSE.txt for details.
 ******************************************************************************/
package gov.nih.nci.cabig.caaers.domain;

import gov.nih.nci.cabig.ctms.domain.AbstractMutableDomainObject;

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

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.Type;

import java.util.Date;


/**
 * Represents a config property (which is a look up value).
 *
 * @author Biju Joseph
 */
@Entity
@GenericGenerator(name = "id-generator", strategy = "native", parameters = {@Parameter(name = "sequence", value = "seq_config_properties_id")})
@Table(name="config_properties")
public class ConfigProperty extends AbstractMutableDomainObject{
	
	/** The code. */
	private String code;
	
	/** The name. */
	private String name;
	
	/** The description. */
	private String description;
	
	/** The config type. */
	private ConfigPropertyType configType;
    private Date lastSynchedDate;

    public Date getLastSynchedDate() {
        return lastSynchedDate;
    }

    public void setLastSynchedDate(Date lastSynchedDate) {
        this.lastSynchedDate = lastSynchedDate;
    }
	
	/**
	 * Gets the code.
	 *
	 * @return the code
	 */
	public String getCode() {
		return code;
	}
	
	/**
	 * Returns the name of this property.
	 * 
	 * @return the name
	 */
	@Override
	public String toString() {
		return name;
	}
	
	/**
	 * Sets the code.
	 *
	 * @param code the new code
	 */
	public void setCode(String code) {
		this.code = code;
	}
	
	/**
	 * Gets the name.
	 *
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	
	/**
	 * Sets the name.
	 *
	 * @param name the new name
	 */
	public void setName(String name) {
		this.name = name;
	}
	
	/**
	 * Gets the description.
	 *
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}
	
	/**
	 * Sets the description.
	 *
	 * @param description the new description
	 */
	public void setDescription(String description) {
		this.description = description;
	}
	
	
	/**
	 * Gets the config type.
	 *
	 * @return the config type
	 */
	@Type(type = "configType")
	@Column(name="config_type",nullable=false)
	public ConfigPropertyType getConfigType() {
		return configType;
	}
	
	/**
	 * Sets the config type.
	 *
	 * @param configType the new config type
	 */
	public void setConfigType(ConfigPropertyType configType) {
		this.configType = configType;
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((code == null) ? 0 : code.hashCode());
		result = prime
				* result
				+ ((configType == null) ? 0 : configType
						.hashCode());
		result = prime * result
				+ ((description == null) ? 0 : description.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) return true;
		if (obj == null) return false;
		if (getClass() != obj.getClass()) return false;
		ConfigProperty other = (ConfigProperty) obj;
		if (code == null) {
			if (other.code != null)
				return false;
		} else if (!code.equals(other.code))
			return false;
		if (configType == null) {
			if (other.configType != null)
				return false;
		} else if (!configType.equals(other.configType))
			return false;
		if (description == null) {
			if (other.description != null)
				return false;
		} else if (!description.equals(other.description))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}
	
	
}

@@ -1608,142 +1608,8 @@
 /**%0A
-%09 * Returns the name of this property.%0A%09 * %0A%09 * @return the name%0A%09 */%0A%09@Override%0A%09public String toString() %7B%0A%09%09return name;%0A%09%7D%0A%09%0A%09/**%0A
 %09 * 

undo mistaken checkin.