/*
* HsRelatorioPosto.java
*
* Generated by com.evutils.codegen.EntityObjectGenerator
*
* Use but DON'T TOUCH
* -> (can't touch this)
*/
package siprp.data.inner;


public class HsRelatorioPosto extends siprp.data.BaseObject
{
	private static final java.util.HashMap<String,Integer> FIELD_INDEXES = new java.util.HashMap<String,Integer>();

	static
	{
		FIELD_INDEXES.put( HsRelatorioPosto.ID, HsRelatorioPosto.ID_INDEX );
		FIELD_INDEXES.put( HsRelatorioPosto.ID_FULL, HsRelatorioPosto.ID_INDEX );
		FIELD_INDEXES.put( HsRelatorioPosto.DESCRIPTION, HsRelatorioPosto.DESCRIPTION_INDEX );
		FIELD_INDEXES.put( HsRelatorioPosto.DESCRIPTION_FULL, HsRelatorioPosto.DESCRIPTION_INDEX );
		com.evolute.entity.evo.EvoDataObject.register( HsRelatorioPosto.CLASS_IDENTIFIER, HsRelatorioPosto.AREA_ID, HsRelatorioPosto.TO_AREA_ID ); 
		FIELD_INDEXES.put( HsRelatorioPosto.AREA_ID, HsRelatorioPosto.AREA_ID_INDEX );
		FIELD_INDEXES.put( HsRelatorioPosto.AREA_ID_FULL, HsRelatorioPosto.AREA_ID_INDEX );
		FIELD_INDEXES.put( HsRelatorioPosto.TO_AREA_ID, HsRelatorioPosto.TO_AREA_ID_INDEX );
		FIELD_INDEXES.put( HsRelatorioPosto.DELETED_DATE, HsRelatorioPosto.DELETED_DATE_INDEX );
		FIELD_INDEXES.put( HsRelatorioPosto.DELETED_DATE_FULL, HsRelatorioPosto.DELETED_DATE_INDEX );
		FIELD_INDEXES.put( HsRelatorioPosto.IS_PRINCIPAL, HsRelatorioPosto.IS_PRINCIPAL_INDEX );
		FIELD_INDEXES.put( HsRelatorioPosto.IS_PRINCIPAL_FULL, HsRelatorioPosto.IS_PRINCIPAL_INDEX );
		FIELD_INDEXES.put( HsRelatorioPosto.HS_POSTO_ID, HsRelatorioPosto.HS_POSTO_ID_INDEX );
		FIELD_INDEXES.put( HsRelatorioPosto.HS_POSTO_ID_FULL, HsRelatorioPosto.HS_POSTO_ID_INDEX );
	}

	private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >();


	public static final com.evolute.entity.ForeignKey ForeignKeyarea_idTohs_relatorio_area = 
		new com.evolute.entity.ForeignKey( HsRelatorioPosto.class, HsRelatorioPosto.AREA_ID, siprp.data.outer.HsRelatorioAreaData.class, siprp.data.outer.HsRelatorioAreaData.ID );

	public static final String TABLENAME = "hs_relatorio_posto";


	public static final String CLASS_IDENTIFIER = "hs_relatorio_posto1277401737170";

	public static final int _INVALID__INDEX = -1;
	public static final String ID = "id";
	public static final String ID_FULL = "hs_relatorio_posto.id";
	public static final int ID_INDEX = 0;
	public static final String DESCRIPTION = "description";
	public static final String DESCRIPTION_FULL = "hs_relatorio_posto.description";
	public static final int DESCRIPTION_INDEX = 1;
	public static final String AREA_ID = "area_id";
	public static final String AREA_ID_FULL = "hs_relatorio_posto.area_id";
	public static final int AREA_ID_INDEX = 2;
	public static final String TO_AREA_ID = "to_area_id";
	public static final int TO_AREA_ID_INDEX = 3;
	public static final String DELETED_DATE = "deleted_date";
	public static final String DELETED_DATE_FULL = "hs_relatorio_posto.deleted_date";
	public static final int DELETED_DATE_INDEX = 4;
	public static final String IS_PRINCIPAL = "is_principal";
	public static final String IS_PRINCIPAL_FULL = "hs_relatorio_posto.is_principal";
	public static final int IS_PRINCIPAL_INDEX = 5;
	public static final String HS_POSTO_ID = "hs_posto_id";
	public static final String HS_POSTO_ID_FULL = "hs_relatorio_posto.hs_posto_id";
	public static final int HS_POSTO_ID_INDEX = 6;

	public static final String FIELD_NAMES[] = new String[]{
		DESCRIPTION, AREA_ID, TO_AREA_ID, DELETED_DATE, IS_PRINCIPAL, HS_POSTO_ID, };

	public static final String FIELD_NAMES_FULL[] = new String[]{
		TABLENAME + "." + DESCRIPTION, TABLENAME + "." + AREA_ID, TABLENAME + "." + TO_AREA_ID, TABLENAME + "." + DELETED_DATE, TABLENAME + "." + IS_PRINCIPAL, TABLENAME + "." + HS_POSTO_ID, };

	protected static final String DB_FIELD_NAMES[] = new String[]{
		ID, DESCRIPTION, AREA_ID, DELETED_DATE, IS_PRINCIPAL, HS_POSTO_ID, };


	protected static final String PK_FIELD_NAMES[] = new String[]{
		ID, };


	public static final String DEFAULT_LOAD_SET[] = new String[] {
		ID, DESCRIPTION, AREA_ID, DELETED_DATE, IS_PRINCIPAL, HS_POSTO_ID, };

	private Integer id;
	private String description;
	private Integer area_id;
	private siprp.data.outer.HsRelatorioAreaData to_area_id;
	private java.sql.Timestamp deleted_date;
	private Boolean is_principal;
	private Integer hs_posto_id;

	protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey;

	public HsRelatorioPosto()
	{
		super();
		dirtyProperties = new boolean[]{ false, false, false
			, false, false, false, false };
	}

	public Integer getId()
	{
		try
		{
			setLastAccess( System.currentTimeMillis() );
			prepare( ID );
		}
		catch( java.lang.Exception ex )
		{
			throw new RuntimeException( ex );
		}
		return this.id;
	}

	public void setId( Integer id )
	{
		try
		{
			setLockedForRefresh( true );
			preProcess( ID, id );
		}
		catch( com.evolute.entity.evo.EvoDataException edex )
		{
			throw new RuntimeException( edex );
		}
		this.id = id;
		LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE );
	}

	public java.util.List<siprp.data.outer.HsRelatorioPostoMedidaData>fromHsRelatorioPostoMedida_posto_id()
	{
		java.util.List<siprp.data.outer.HsRelatorioPostoMedidaData> result = null;
		try
		{
			result = fromReference( siprp.data.outer.HsRelatorioPostoMedidaData.class , getPrimaryKey().getMap().get("id"), "posto_id" );
		}
		catch( com.evolute.entity.evo.EvoDataException edex )
		{
			throw new RuntimeException( edex );
		}
		return result;
	}

	public java.util.List<siprp.data.outer.HsRelatorioPostoRiscoData>fromHsRelatorioPostoRisco_posto_id()
	{
		java.util.List<siprp.data.outer.HsRelatorioPostoRiscoData> result = null;
		try
		{
			result = fromReference( siprp.data.outer.HsRelatorioPostoRiscoData.class , getPrimaryKey().getMap().get("id"), "posto_id" );
		}
		catch( com.evolute.entity.evo.EvoDataException edex )
		{
			throw new RuntimeException( edex );
		}
		return result;
	}

	public String getDescription()
	{
		try
		{
			setLastAccess( System.currentTimeMillis() );
			prepare( DESCRIPTION );
		}
		catch( java.lang.Exception ex )
		{
			throw new RuntimeException( ex );
		}
		return this.description;
	}

	public void setDescription( String description )
	{
		try
		{
			setLockedForRefresh( true );
			preProcess( DESCRIPTION, description );
		}
		catch( com.evolute.entity.evo.EvoDataException edex )
		{
			throw new RuntimeException( edex );
		}
		this.description = description;
		LAZY_LOADED_OBJECTS.put( DESCRIPTION, Boolean.TRUE );
	}

	public Integer getArea_id()
	{
		try
		{
			setLastAccess( System.currentTimeMillis() );
			prepare( AREA_ID );
		}
		catch( java.lang.Exception ex )
		{
			throw new RuntimeException( ex );
		}
		return this.area_id;
	}

	public void setArea_id( Integer area_id )
	{
		try
		{
			setLockedForRefresh( true );
			preProcess( AREA_ID, area_id );
		}
		catch( com.evolute.entity.evo.EvoDataException edex )
		{
			throw new RuntimeException( edex );
		}
		this.area_id = area_id;
		LAZY_LOADED_OBJECTS.put( AREA_ID, Boolean.TRUE );
	}

	public siprp.data.outer.HsRelatorioAreaData toArea_id()
	{
		try
		{
			prepare( TO_AREA_ID );
		}
		catch( com.evolute.entity.evo.EvoDataException edex )
		{
			throw new RuntimeException( edex );
		}
		return this.to_area_id;
	}

	public void setToArea_id( siprp.data.outer.HsRelatorioAreaData to_area_id )
	{
		try
		{
			preProcess( TO_AREA_ID, to_area_id );
		}
		catch( com.evolute.entity.evo.EvoDataException edex )
		{
			throw new RuntimeException( edex );
		}
		this.to_area_id = to_area_id;
	}

	public java.sql.Timestamp getDeleted_date()
	{
		try
		{
			setLastAccess( System.currentTimeMillis() );
			prepare( DELETED_DATE );
		}
		catch( java.lang.Exception ex )
		{
			throw new RuntimeException( ex );
		}
		return this.deleted_date;
	}

	public void setDeleted_date( java.sql.Timestamp deleted_date )
	{
		try
		{
			setLockedForRefresh( true );
			preProcess( DELETED_DATE, deleted_date );
		}
		catch( com.evolute.entity.evo.EvoDataException edex )
		{
			throw new RuntimeException( edex );
		}
		this.deleted_date = deleted_date;
		LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE );
	}

	public Boolean getIs_principal()
	{
		try
		{
			setLastAccess( System.currentTimeMillis() );
			prepare( IS_PRINCIPAL );
		}
		catch( java.lang.Exception ex )
		{
			throw new RuntimeException( ex );
		}
		return this.is_principal;
	}

	public void setIs_principal( Boolean is_principal )
	{
		try
		{
			setLockedForRefresh( true );
			preProcess( IS_PRINCIPAL, is_principal );
		}
		catch( com.evolute.entity.evo.EvoDataException edex )
		{
			throw new RuntimeException( edex );
		}
		this.is_principal = is_principal;
		LAZY_LOADED_OBJECTS.put( IS_PRINCIPAL, Boolean.TRUE );
	}

	public Integer getHs_posto_id()
	{
		try
		{
			setLastAccess( System.currentTimeMillis() );
			prepare( HS_POSTO_ID );
		}
		catch( java.lang.Exception ex )
		{
			throw new RuntimeException( ex );
		}
		return this.hs_posto_id;
	}

	public void setHs_posto_id( Integer hs_posto_id )
	{
		try
		{
			setLockedForRefresh( true );
			preProcess( HS_POSTO_ID, hs_posto_id );
		}
		catch( com.evolute.entity.evo.EvoDataException edex )
		{
			throw new RuntimeException( edex );
		}
		this.hs_posto_id = hs_posto_id;
		LAZY_LOADED_OBJECTS.put( HS_POSTO_ID, Boolean.TRUE );
	}

	public Object get( String fieldName )
	{
		Object value = null;
		Integer index = getFieldIndex( fieldName );
		switch( index )
		{
			case HsRelatorioPosto.ID_INDEX:
				value = getId();
				break;
			case HsRelatorioPosto.DESCRIPTION_INDEX:
				value = getDescription();
				break;
			case HsRelatorioPosto.AREA_ID_INDEX:
				value = getArea_id();
				break;
			case HsRelatorioPosto.TO_AREA_ID_INDEX:
				value = toArea_id();
				break;
			case HsRelatorioPosto.DELETED_DATE_INDEX:
				value = getDeleted_date();
				break;
			case HsRelatorioPosto.IS_PRINCIPAL_INDEX:
				value = getIs_principal();
				break;
			case HsRelatorioPosto.HS_POSTO_ID_INDEX:
				value = getHs_posto_id();
				break;
		}
		return value;
	}

	public Object rawGet( String fieldName )
	{
		Object value = null;
		Integer index = getFieldIndex( fieldName );
		switch( index )
		{
			case HsRelatorioPosto.ID_INDEX:
				value = this.id;
				break;
			case HsRelatorioPosto.DESCRIPTION_INDEX:
				value = this.description;
				break;
			case HsRelatorioPosto.AREA_ID_INDEX:
				value = this.area_id;
				break;
			case HsRelatorioPosto.TO_AREA_ID_INDEX:
				value = this.to_area_id;
				break;
			case HsRelatorioPosto.DELETED_DATE_INDEX:
				value = this.deleted_date;
				break;
			case HsRelatorioPosto.IS_PRINCIPAL_INDEX:
				value = this.is_principal;
				break;
			case HsRelatorioPosto.HS_POSTO_ID_INDEX:
				value = this.hs_posto_id;
				break;
		}
		return value;
	}

	public void set( String fieldName, Object value )
	{
		Integer index = getFieldIndex( fieldName );
		switch( index )
		{
			case HsRelatorioPosto.ID_INDEX:
				setId( ( Integer ) value );
				break;
			case HsRelatorioPosto.DESCRIPTION_INDEX:
				setDescription( ( String ) value );
				break;
			case HsRelatorioPosto.AREA_ID_INDEX:
				setArea_id( ( Integer ) value );
				break;
			case HsRelatorioPosto.TO_AREA_ID_INDEX:
				setToArea_id( ( siprp.data.outer.HsRelatorioAreaData ) value );
				break;
			case HsRelatorioPosto.DELETED_DATE_INDEX:
				setDeleted_date( ( java.sql.Timestamp ) value );
				break;
			case HsRelatorioPosto.IS_PRINCIPAL_INDEX:
				setIs_principal( ( Boolean ) value );
				break;
			case HsRelatorioPosto.HS_POSTO_ID_INDEX:
				setHs_posto_id( ( Integer ) value );
				break;
		}
	}

	public void rawSet( String fieldName, Object value )
	{
		Integer index = getFieldIndex( fieldName );
		switch( index )
		{
			case HsRelatorioPosto.ID_INDEX:
				this.id = ( Integer ) value;
				break;
			case HsRelatorioPosto.DESCRIPTION_INDEX:
				this.description = ( String ) value;
				break;
			case HsRelatorioPosto.AREA_ID_INDEX:
				this.area_id = ( Integer ) value;
				break;
			case HsRelatorioPosto.TO_AREA_ID_INDEX:
				this.to_area_id = ( siprp.data.outer.HsRelatorioAreaData ) value;
				break;
			case HsRelatorioPosto.DELETED_DATE_INDEX:
				this.deleted_date = ( java.sql.Timestamp ) value;
				break;
			case HsRelatorioPosto.IS_PRINCIPAL_INDEX:
				this.is_principal = ( Boolean ) value;
				break;
			case HsRelatorioPosto.HS_POSTO_ID_INDEX:
				this.hs_posto_id = ( Integer ) value;
				break;
		}
	}

	public String []getFieldNames()
	{
		return FIELD_NAMES;
	}

	public String []getFieldNamesFull()
	{
		return FIELD_NAMES_FULL;
	}

	public String []getDBFieldNames()
	{
		return DB_FIELD_NAMES;
	}

	public String []getPrimaryKeyNames()
	{
		return PK_FIELD_NAMES;
	}

	public String []getDefaultLoadSet()
	{
		return DEFAULT_LOAD_SET;
	}

	public String getPrimaryKeyName()
	{
		return PK_FIELD_NAMES[ 0 ];
	}

	public Class<?> getFieldClass( String fieldName )
	{
		Integer index = getFieldIndex( fieldName );
		Class<?> theClass = null;
		switch( index )
		{
			case HsRelatorioPosto.ID_INDEX:
				theClass = Integer.class;
				break;
			case HsRelatorioPosto.DESCRIPTION_INDEX:
				theClass = String.class;
				break;
			case HsRelatorioPosto.AREA_ID_INDEX:
				theClass = Integer.class;
				break;
			case HsRelatorioPosto.TO_AREA_ID_INDEX:
				theClass = siprp.data.outer.HsRelatorioAreaData.class;
				break;
			case HsRelatorioPosto.DELETED_DATE_INDEX:
				theClass = java.sql.Timestamp.class;
				break;
			case HsRelatorioPosto.IS_PRINCIPAL_INDEX:
				theClass = Boolean.class;
				break;
			case HsRelatorioPosto.HS_POSTO_ID_INDEX:
				theClass = Integer.class;
				break;
		}
		return theClass;
	}

	public Integer getFieldIndex( String fieldName )
	{
		Integer index = FIELD_INDEXES.get( fieldName );
		return index != null ? index : HsRelatorioPosto._INVALID__INDEX;
	}

	public String getTableName()
	{
		return TABLENAME;
	}

	public String getClassIdentifier()
	{
		return CLASS_IDENTIFIER;
	}

	@Override
	protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col )
	{
		if( primaryKey == null )
		{
			primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsRelatorioPosto.PK_FIELD_NAMES );
			primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) );
		}
		setId( ( Integer ) array.get( row, col + 0 ) );
	}

	@Override
	public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey()
	{
		return primaryKey;
	}

	public void initLazyLoadFields()
	{
	}

	public boolean isPropertyLoaded( String fieldName )
	{
		if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null )
		{
			return true;
		}
		else
		{
			return LAZY_LOADED_OBJECTS.get( fieldName );
		}
	}
}
