/*******************************************************************************
 * Copyright (c) 2010, 2012 Tasktop Technologies
 * Copyright (c) 2010, 2011 SpringSource, a division of VMware
 * 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     Tasktop Technologies - initial API and implementation
 ******************************************************************************/
package com.tasktop.c2c.server.internal.tasks.domain;

// Generated May 26, 2010 11:31:55 AM by Hibernate Tools 3.3.0.GA

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * SettingValue generated by hbm2java
 */
@Entity
@Table(name = "setting_value", uniqueConstraints = { @UniqueConstraint(columnNames = { "name", "value" }),
		@UniqueConstraint(columnNames = { "name", "sortindex" }) })
@SuppressWarnings("serial")
public class SettingValue implements java.io.Serializable {

	private SettingValueId id;
	private Setting setting;

	public SettingValue() {
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "name", column = @Column(name = "name", nullable = false, length = 32)),
			@AttributeOverride(name = "value", column = @Column(name = "value", nullable = false, length = 32)),
			@AttributeOverride(name = "sortindex", column = @Column(name = "sortindex", nullable = false)) })
	public SettingValueId getId() {
		return this.id;
	}

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

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "name", nullable = false, insertable = false, updatable = false)
	public Setting getSetting() {
		return this.setting;
	}

	public void setSetting(Setting setting) {
		this.setting = setting;
	}

}
