package org.thdl.roster.om;

import org.apache.torque.om.Persistent;
import org.apache.torque.*;
import org.apache.torque.util.*;
import java.util.*;

/** 
 * The skeleton for this class was autogenerated by Torque on:
 *
 * [Thu Feb 27 15:11:05 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 OrganizationData 
    extends org.thdl.roster.om.BaseOrganizationData
    implements java.io.Serializable, RosterMemberData
{
	//attributes
	private List organizationTypeIdList;
	//accessors
	public void setId(Integer v) throws TorqueException
	{
		super.setId( v );
		setOrganizationTypeIdList( buildIdList() );
	}
	public void setOrganizationTypeIdList( List organizationTypeIdList )
	{
		this.organizationTypeIdList = organizationTypeIdList;
	}
	public List getOrganizationTypeIdList() throws TorqueException
	{
		return organizationTypeIdList;
	}
	//helpers
	public List buildIdList() throws TorqueException
	{
			Criteria crit = new Criteria();
			crit.add(  OrganizationOrganizationTypePeer.ORGANIZATION_DATA_ID, getId() );
			crit.addAscendingOrderByColumn( OrganizationOrganizationTypePeer.RELEVANCE );
			List idSourceList = OrganizationOrganizationTypePeer.doSelect( crit );
			LinkedList newList = new LinkedList();
			ListIterator iterator = idSourceList.listIterator( 0 );
			while ( iterator.hasNext() )
			{
				OrganizationOrganizationType ppt = (OrganizationOrganizationType) iterator.next();
				Integer id = ppt.getOrganizationType().getId();
				newList.add( id );
			}
			return newList;
	}

	public java.util.List getMemberTypes() throws org.apache.torque.TorqueException
	{
		return getOrganizationOrganizationTypes();
	}
	public void setMemberTypes( java.util.List memberTypes )
	{
		// WRONG setOrganizationOrganizationTypes( memberTypes );
	}
}
