package model;

import java.beans.Transient;

import javax.inject.Named;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * Represents one person in our database.
 * @author Ian Darwin
 */
@Entity
@Named
public class Person {
	
	@Id @GeneratedValue(strategy=GenerationType.AUTO)
	long id;
	String firstName, lastName;
	String email;
	String address, address2;
	String city, province, postCode;
	Country country = Country.CANADA;

	public long getId() {
		return id;
	}

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

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	
	@Transient
	public String getName() {
		return getFirstName() + ' ' + getLastName();
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getAddress2() {
		return address2;
	}

	public void setAddress2(String address2) {
		this.address2 = address2;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getPostCode() {
		return postCode;
	}

	public void setPostCode(String postCode) {
		this.postCode = postCode;
	}

	public Country getCountry() {
		return country;
	}

	public void setCountry(Country country) {
		this.country = country;
	}
}


@@ -56,20 +56,30 @@
 vax.
-inject.Named
+faces.bean.ManagedBean
 ;%0Aim
@@ -306,13 +306,19 @@
 ty%0A@
-Named
+ManagedBean
 %0Apub

Make Entity also @ManagedBean for easier JSF creation