package org.thdl.roster.om;

import java.util.*;
import org.apache.torque.om.BaseObject;
import org.apache.torque.util.BasePeer;
import org.apache.torque.util.Criteria;
import org.apache.torque.TorqueException;


/** 
 * The skeleton for this class was autogenerated by Torque on:
 *
 * [Thu Feb 27 12:26:47 EST 2003]
 *
 * You should add additional methods to this class to meet the
 * application requirements.  This class will only be generated as
 * long as it does not already exist in the output directory.
 */
public class Organization extends org.thdl.roster.om.Member implements RosterMember
{
//attributes
	RosterMemberData memberData;
//accessors
	public void setMemberData (RosterMemberData memberData)  throws RosterMemberTypeException
	{
		if ( memberData instanceof OrganizationData )
		{
			try { 
				OrganizationData pd = (OrganizationData) memberData;
				setOrganizationData( pd );
			}
			catch ( 	TorqueException te )
			{
				throw new RosterMemberTypeException( te.getMessage() );
			}
		}
		else
		{
			throw new RosterMemberTypeException( "MemberData must be a OrganizationData for this object" );
		}
	}
	public RosterMemberData getMemberData() throws RosterMemberTypeException
	{
		try { 
			return getOrganizationData();
		}
		catch ( 	TorqueException te )
		{
			throw new RosterMemberTypeException( te.getMessage() );
		}
	}
//helpers
    public Member copy() throws TorqueException
    {
      Organization organization = new Organization();
		organization = (Organization) copyInto( organization );
		organization.setOrganizationData( getOrganizationData().copy() );
		return organization;
    }

//constructors
    public Organization() throws TorqueException
    {
		setMemberType(MemberPeer.CLASSKEY_ORGANIZATION);
		setOrganizationData( new OrganizationData() );
		setContactInfo( new ContactInfo() );
		setResearchInterest( new ResearchInterest() );
		setPublication( new Publication() );
		//setDocument( new Document() );
    }
}
