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


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

	static
	{
		FIELD_INDEXES.put( ExamesPortaria.ID, ExamesPortaria.ID_INDEX );
		FIELD_INDEXES.put( ExamesPortaria.ID_FULL, ExamesPortaria.ID_INDEX );
		FIELD_INDEXES.put( ExamesPortaria.PORTARIA, ExamesPortaria.PORTARIA_INDEX );
		FIELD_INDEXES.put( ExamesPortaria.PORTARIA_FULL, ExamesPortaria.PORTARIA_INDEX );
		FIELD_INDEXES.put( ExamesPortaria.DATA_ENTRADA, ExamesPortaria.DATA_ENTRADA_INDEX );
		FIELD_INDEXES.put( ExamesPortaria.DATA_ENTRADA_FULL, ExamesPortaria.DATA_ENTRADA_INDEX );
	}

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


	public static final String TABLENAME = "exames_portaria";


	public static final String CLASS_IDENTIFIER = "exames_portaria1277401737160";

	public static final int _INVALID__INDEX = -1;
	public static final String ID = "id";
	public static final String ID_FULL = "exames_portaria.id";
	public static final int ID_INDEX = 0;
	public static final String PORTARIA = "portaria";
	public static final String PORTARIA_FULL = "exames_portaria.portaria";
	public static final int PORTARIA_INDEX = 1;
	public static final String DATA_ENTRADA = "data_entrada";
	public static final String DATA_ENTRADA_FULL = "exames_portaria.data_entrada";
	public static final int DATA_ENTRADA_INDEX = 2;

	public static final String FIELD_NAMES[] = new String[]{
		PORTARIA, DATA_ENTRADA, };

	public static final String FIELD_NAMES_FULL[] = new String[]{
		TABLENAME + "." + PORTARIA, TABLENAME + "." + DATA_ENTRADA, };

	protected static final String DB_FIELD_NAMES[] = new String[]{
		ID, PORTARIA, DATA_ENTRADA, };


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


	public static final String DEFAULT_LOAD_SET[] = new String[] {
		ID, PORTARIA, DATA_ENTRADA, };

	private Integer id;
	private String portaria;
	private java.sql.Timestamp data_entrada;

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

	public ExamesPortaria()
	{
		super();
		dirtyProperties = new boolean[]{ 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 String getPortaria()
	{
		try
		{
			setLastAccess( System.currentTimeMillis() );
			prepare( PORTARIA );
		}
		catch( java.lang.Exception ex )
		{
			throw new RuntimeException( ex );
		}
		return this.portaria;
	}

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

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

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

	public Object get( String fieldName )
	{
		Object value = null;
		Integer index = getFieldIndex( fieldName );
		switch( index )
		{
			case ExamesPortaria.ID_INDEX:
				value = getId();
				break;
			case ExamesPortaria.PORTARIA_INDEX:
				value = getPortaria();
				break;
			case ExamesPortaria.DATA_ENTRADA_INDEX:
				value = getData_entrada();
				break;
		}
		return value;
	}

	public Object rawGet( String fieldName )
	{
		Object value = null;
		Integer index = getFieldIndex( fieldName );
		switch( index )
		{
			case ExamesPortaria.ID_INDEX:
				value = this.id;
				break;
			case ExamesPortaria.PORTARIA_INDEX:
				value = this.portaria;
				break;
			case ExamesPortaria.DATA_ENTRADA_INDEX:
				value = this.data_entrada;
				break;
		}
		return value;
	}

	public void set( String fieldName, Object value )
	{
		Integer index = getFieldIndex( fieldName );
		switch( index )
		{
			case ExamesPortaria.ID_INDEX:
				setId( ( Integer ) value );
				break;
			case ExamesPortaria.PORTARIA_INDEX:
				setPortaria( ( String ) value );
				break;
			case ExamesPortaria.DATA_ENTRADA_INDEX:
				setData_entrada( ( java.sql.Timestamp ) value );
				break;
		}
	}

	public void rawSet( String fieldName, Object value )
	{
		Integer index = getFieldIndex( fieldName );
		switch( index )
		{
			case ExamesPortaria.ID_INDEX:
				this.id = ( Integer ) value;
				break;
			case ExamesPortaria.PORTARIA_INDEX:
				this.portaria = ( String ) value;
				break;
			case ExamesPortaria.DATA_ENTRADA_INDEX:
				this.data_entrada = ( java.sql.Timestamp ) 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 ExamesPortaria.ID_INDEX:
				theClass = Integer.class;
				break;
			case ExamesPortaria.PORTARIA_INDEX:
				theClass = String.class;
				break;
			case ExamesPortaria.DATA_ENTRADA_INDEX:
				theClass = java.sql.Timestamp.class;
				break;
		}
		return theClass;
	}

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