/*
 * Hibernate OGM, Domain model persistence for NoSQL datastores
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later
 * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. 
 */
package org.hibernate.ogm.backendtck.inheritance.singletable.family;

import javax.persistence. DiscriminatorColumn;
import javax.persistence. DiscriminatorType;
import javax.persistence. Entity;
import javax.persistence. Id;
import javax.persistence. Inheritance;
import javax.persistence. InheritanceType;
import javax.persistence. ManyToOne;

import org.hibernate.search.annotations. Indexed;

@Entity
@Inheritance(strategy = InheritanceType. SINGLE_TABLE)
@DiscriminatorColumn(name = "TYPE", discriminatorType = DiscriminatorType. STRING)
@Indexed
class Person {

	@Id
	private String name;

	@ManyToOne
	private Family familyName;

	public Person() {
	}

	public Person(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Family getFamilyName() {
		return familyName;
	}

	public void setFamilyName(Family familyName) {
		this.familyName = familyName;
	}

	@Override
	public String toString() {
		return name;
	}
}
