package org.jboss.seam.example.contactlist.session;

import org.jboss.seam.example.contactlist.*;
import java.util.ArrayList;
import java.util.List;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityHome;

@Name("contactHome")
public class ContactHome extends EntityHome<Contact> {

	public void setContactId(Long id) {
		setId(id);
	}

	public Long getContactId() {
		return (Long) getId();
	}

	@Override
	protected Contact createInstance() {
		Contact contact = new Contact();
		return contact;
	}

	public void wire() {
	}

	public boolean isWired() {
		return true;
	}

	public Contact getDefinedInstance() {
		return isIdDefined() ? getInstance() : null;
	}

	public List<Comment> getComments() {
		return getInstance() == null ? null : new ArrayList<Comment>(
				getInstance().getComments());
	}

}
