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


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

	static
	{
		com.evolute.entity.evo.EvoDataObject.register( HsRelatorioLegislacao.CLASS_IDENTIFIER, HsRelatorioLegislacao.HS_RELATORIO_ID, HsRelatorioLegislacao.TO_HS_RELATORIO_ID ); 
		FIELD_INDEXES.put( HsRelatorioLegislacao.HS_RELATORIO_ID, HsRelatorioLegislacao.HS_RELATORIO_ID_INDEX );
		FIELD_INDEXES.put( HsRelatorioLegislacao.HS_RELATORIO_ID_FULL, HsRelatorioLegislacao.HS_RELATORIO_ID_INDEX );
		FIELD_INDEXES.put( HsRelatorioLegislacao.TO_HS_RELATORIO_ID, HsRelatorioLegislacao.TO_HS_RELATORIO_ID_INDEX );
		FIELD_INDEXES.put( HsRelatorioLegislacao.HS_LEGISLACAO_ID, HsRelatorioLegislacao.HS_LEGISLACAO_ID_INDEX );
		FIELD_INDEXES.put( HsRelatorioLegislacao.HS_LEGISLACAO_ID_FULL, HsRelatorioLegislacao.HS_LEGISLACAO_ID_INDEX );
		FIELD_INDEXES.put( HsRelatorioLegislacao.ID, HsRelatorioLegislacao.ID_INDEX );
		FIELD_INDEXES.put( HsRelatorioLegislacao.ID_FULL, HsRelatorioLegislacao.ID_INDEX );
		FIELD_INDEXES.put( HsRelatorioLegislacao.CATEGORIA, HsRelatorioLegislacao.CATEGORIA_INDEX );
		FIELD_INDEXES.put( HsRelatorioLegislacao.CATEGORIA_FULL, HsRelatorioLegislacao.CATEGORIA_INDEX );
		FIELD_INDEXES.put( HsRelatorioLegislacao.DESCRICAO, HsRelatorioLegislacao.DESCRICAO_INDEX );
		FIELD_INDEXES.put( HsRelatorioLegislacao.DESCRICAO_FULL, HsRelatorioLegislacao.DESCRICAO_INDEX );
		FIELD_INDEXES.put( HsRelatorioLegislacao.ORDEM, HsRelatorioLegislacao.ORDEM_INDEX );
		FIELD_INDEXES.put( HsRelatorioLegislacao.ORDEM_FULL, HsRelatorioLegislacao.ORDEM_INDEX );
	}

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


	public static final com.evolute.entity.ForeignKey ForeignKeyhs_relatorio_idTohs_relatorio = 
		new com.evolute.entity.ForeignKey( HsRelatorioLegislacao.class, HsRelatorioLegislacao.HS_RELATORIO_ID, siprp.data.outer.HsRelatorioData.class, siprp.data.outer.HsRelatorioData.ID );

	public static final String TABLENAME = "hs_relatorio_legislacao";


	public static final String CLASS_IDENTIFIER = "hs_relatorio_legislacao1277401737168";

	public static final int _INVALID__INDEX = -1;
	public static final String HS_RELATORIO_ID = "hs_relatorio_id";
	public static final String HS_RELATORIO_ID_FULL = "hs_relatorio_legislacao.hs_relatorio_id";
	public static final int HS_RELATORIO_ID_INDEX = 0;
	public static final String TO_HS_RELATORIO_ID = "to_hs_relatorio_id";
	public static final int TO_HS_RELATORIO_ID_INDEX = 1;
	public static final String HS_LEGISLACAO_ID = "hs_legislacao_id";
	public static final String HS_LEGISLACAO_ID_FULL = "hs_relatorio_legislacao.hs_legislacao_id";
	public static final int HS_LEGISLACAO_ID_INDEX = 2;
	public static final String ID = "id";
	public static final String ID_FULL = "hs_relatorio_legislacao.id";
	public static final int ID_INDEX = 3;
	public static final String CATEGORIA = "categoria";
	public static final String CATEGORIA_FULL = "hs_relatorio_legislacao.categoria";
	public static final int CATEGORIA_INDEX = 4;
	public static final String DESCRICAO = "descricao";
	public static final String DESCRICAO_FULL = "hs_relatorio_legislacao.descricao";
	public static final int DESCRICAO_INDEX = 5;
	public static final String ORDEM = "ordem";
	public static final String ORDEM_FULL = "hs_relatorio_legislacao.ordem";
	public static final int ORDEM_INDEX = 6;

	public static final String FIELD_NAMES[] = new String[]{
		HS_RELATORIO_ID, TO_HS_RELATORIO_ID, HS_LEGISLACAO_ID, CATEGORIA, DESCRICAO, 
		ORDEM, };

	public static final String FIELD_NAMES_FULL[] = new String[]{
		TABLENAME + "." + HS_RELATORIO_ID, TABLENAME + "." + TO_HS_RELATORIO_ID, TABLENAME + "." + HS_LEGISLACAO_ID, TABLENAME + "." + CATEGORIA, TABLENAME + "." + DESCRICAO, 
		TABLENAME + "." + ORDEM, };

	protected static final String DB_FIELD_NAMES[] = new String[]{
		HS_RELATORIO_ID, HS_LEGISLACAO_ID, ID, CATEGORIA, DESCRICAO, ORDEM, };


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


	public static final String DEFAULT_LOAD_SET[] = new String[] {
		HS_RELATORIO_ID, HS_LEGISLACAO_ID, ID, CATEGORIA, DESCRICAO, ORDEM, };

	private Integer hs_relatorio_id;
	private siprp.data.outer.HsRelatorioData to_hs_relatorio_id;
	private Integer hs_legislacao_id;
	private Integer id;
	private String categoria;
	private String descricao;
	private Integer ordem;

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

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

	public Integer getHs_relatorio_id()
	{
		try
		{
			setLastAccess( System.currentTimeMillis() );
			prepare( HS_RELATORIO_ID );
		}
		catch( java.lang.Exception ex )
		{
			throw new RuntimeException( ex );
		}
		return this.hs_relatorio_id;
	}

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

	public siprp.data.outer.HsRelatorioData toHs_relatorio_id()
	{
		try
		{
			prepare( TO_HS_RELATORIO_ID );
		}
		catch( com.evolute.entity.evo.EvoDataException edex )
		{
			throw new RuntimeException( edex );
		}
		return this.to_hs_relatorio_id;
	}

	public void setToHs_relatorio_id( siprp.data.outer.HsRelatorioData to_hs_relatorio_id )
	{
		try
		{
			preProcess( TO_HS_RELATORIO_ID, to_hs_relatorio_id );
		}
		catch( com.evolute.entity.evo.EvoDataException edex )
		{
			throw new RuntimeException( edex );
		}
		this.to_hs_relatorio_id = to_hs_relatorio_id;
	}

	public Integer getHs_legislacao_id()
	{
		try
		{
			setLastAccess( System.currentTimeMillis() );
			prepare( HS_LEGISLACAO_ID );
		}
		catch( java.lang.Exception ex )
		{
			throw new RuntimeException( ex );
		}
		return this.hs_legislacao_id;
	}

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

	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 String getCategoria()
	{
		try
		{
			setLastAccess( System.currentTimeMillis() );
			prepare( CATEGORIA );
		}
		catch( java.lang.Exception ex )
		{
			throw new RuntimeException( ex );
		}
		return this.categoria;
	}

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

	public String getDescricao()
	{
		try
		{
			setLastAccess( System.currentTimeMillis() );
			prepare( DESCRICAO );
		}
		catch( java.lang.Exception ex )
		{
			throw new RuntimeException( ex );
		}
		return this.descricao;
	}

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

	public Integer getOrdem()
	{
		try
		{
			setLastAccess( System.currentTimeMillis() );
			prepare( ORDEM );
		}
		catch( java.lang.Exception ex )
		{
			throw new RuntimeException( ex );
		}
		return this.ordem;
	}

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

	public Object get( String fieldName )
	{
		Object value = null;
		Integer index = getFieldIndex( fieldName );
		switch( index )
		{
			case HsRelatorioLegislacao.HS_RELATORIO_ID_INDEX:
				value = getHs_relatorio_id();
				break;
			case HsRelatorioLegislacao.TO_HS_RELATORIO_ID_INDEX:
				value = toHs_relatorio_id();
				break;
			case HsRelatorioLegislacao.HS_LEGISLACAO_ID_INDEX:
				value = getHs_legislacao_id();
				break;
			case HsRelatorioLegislacao.ID_INDEX:
				value = getId();
				break;
			case HsRelatorioLegislacao.CATEGORIA_INDEX:
				value = getCategoria();
				break;
			case HsRelatorioLegislacao.DESCRICAO_INDEX:
				value = getDescricao();
				break;
			case HsRelatorioLegislacao.ORDEM_INDEX:
				value = getOrdem();
				break;
		}
		return value;
	}

	public Object rawGet( String fieldName )
	{
		Object value = null;
		Integer index = getFieldIndex( fieldName );
		switch( index )
		{
			case HsRelatorioLegislacao.HS_RELATORIO_ID_INDEX:
				value = this.hs_relatorio_id;
				break;
			case HsRelatorioLegislacao.TO_HS_RELATORIO_ID_INDEX:
				value = this.to_hs_relatorio_id;
				break;
			case HsRelatorioLegislacao.HS_LEGISLACAO_ID_INDEX:
				value = this.hs_legislacao_id;
				break;
			case HsRelatorioLegislacao.ID_INDEX:
				value = this.id;
				break;
			case HsRelatorioLegislacao.CATEGORIA_INDEX:
				value = this.categoria;
				break;
			case HsRelatorioLegislacao.DESCRICAO_INDEX:
				value = this.descricao;
				break;
			case HsRelatorioLegislacao.ORDEM_INDEX:
				value = this.ordem;
				break;
		}
		return value;
	}

	public void set( String fieldName, Object value )
	{
		Integer index = getFieldIndex( fieldName );
		switch( index )
		{
			case HsRelatorioLegislacao.HS_RELATORIO_ID_INDEX:
				setHs_relatorio_id( ( Integer ) value );
				break;
			case HsRelatorioLegislacao.TO_HS_RELATORIO_ID_INDEX:
				setToHs_relatorio_id( ( siprp.data.outer.HsRelatorioData ) value );
				break;
			case HsRelatorioLegislacao.HS_LEGISLACAO_ID_INDEX:
				setHs_legislacao_id( ( Integer ) value );
				break;
			case HsRelatorioLegislacao.ID_INDEX:
				setId( ( Integer ) value );
				break;
			case HsRelatorioLegislacao.CATEGORIA_INDEX:
				setCategoria( ( String ) value );
				break;
			case HsRelatorioLegislacao.DESCRICAO_INDEX:
				setDescricao( ( String ) value );
				break;
			case HsRelatorioLegislacao.ORDEM_INDEX:
				setOrdem( ( Integer ) value );
				break;
		}
	}

	public void rawSet( String fieldName, Object value )
	{
		Integer index = getFieldIndex( fieldName );
		switch( index )
		{
			case HsRelatorioLegislacao.HS_RELATORIO_ID_INDEX:
				this.hs_relatorio_id = ( Integer ) value;
				break;
			case HsRelatorioLegislacao.TO_HS_RELATORIO_ID_INDEX:
				this.to_hs_relatorio_id = ( siprp.data.outer.HsRelatorioData ) value;
				break;
			case HsRelatorioLegislacao.HS_LEGISLACAO_ID_INDEX:
				this.hs_legislacao_id = ( Integer ) value;
				break;
			case HsRelatorioLegislacao.ID_INDEX:
				this.id = ( Integer ) value;
				break;
			case HsRelatorioLegislacao.CATEGORIA_INDEX:
				this.categoria = ( String ) value;
				break;
			case HsRelatorioLegislacao.DESCRICAO_INDEX:
				this.descricao = ( String ) value;
				break;
			case HsRelatorioLegislacao.ORDEM_INDEX:
				this.ordem = ( 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 HsRelatorioLegislacao.HS_RELATORIO_ID_INDEX:
				theClass = Integer.class;
				break;
			case HsRelatorioLegislacao.TO_HS_RELATORIO_ID_INDEX:
				theClass = siprp.data.outer.HsRelatorioData.class;
				break;
			case HsRelatorioLegislacao.HS_LEGISLACAO_ID_INDEX:
				theClass = Integer.class;
				break;
			case HsRelatorioLegislacao.ID_INDEX:
				theClass = Integer.class;
				break;
			case HsRelatorioLegislacao.CATEGORIA_INDEX:
				theClass = String.class;
				break;
			case HsRelatorioLegislacao.DESCRICAO_INDEX:
				theClass = String.class;
				break;
			case HsRelatorioLegislacao.ORDEM_INDEX:
				theClass = Integer.class;
				break;
		}
		return theClass;
	}

	public Integer getFieldIndex( String fieldName )
	{
		Integer index = FIELD_INDEXES.get( fieldName );
		return index != null ? index : HsRelatorioLegislacao._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, HsRelatorioLegislacao.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 );
		}
	}
}
