forked from Coded/SIPRP
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
446 lines
11 KiB
446 lines
11 KiB
/*
|
|
* Seccoes.java
|
|
*
|
|
* Generated by com.evutils.codegen.EntityObjectGenerator
|
|
*
|
|
* Use but DON'T TOUCH
|
|
* -> (can't touch this)
|
|
*/
|
|
package db.data.siprp.inner;
|
|
|
|
|
|
public class Seccoes extends com.evolute.entity.evo.EvoDataObject<com.evolute.entity.utils.IntegerPrimaryKey>
|
|
{
|
|
private static final java.util.HashMap<String,Integer> FIELD_INDEXES = new java.util.HashMap<String,Integer>();
|
|
|
|
static
|
|
{
|
|
FIELD_INDEXES.put( Seccoes.ID, Seccoes.ID_INDEX );
|
|
FIELD_INDEXES.put( Seccoes.ID_FULL, Seccoes.ID_INDEX );
|
|
FIELD_INDEXES.put( Seccoes.DESCRICAO, Seccoes.DESCRICAO_INDEX );
|
|
FIELD_INDEXES.put( Seccoes.DESCRICAO_FULL, Seccoes.DESCRICAO_INDEX );
|
|
com.evolute.entity.evo.EvoDataObject.register( Seccoes.CLASS_IDENTIFIER, Seccoes.DEPARTAMENTO_ID, Seccoes.TO_DEPARTAMENTO_ID );
|
|
FIELD_INDEXES.put( Seccoes.DEPARTAMENTO_ID, Seccoes.DEPARTAMENTO_ID_INDEX );
|
|
FIELD_INDEXES.put( Seccoes.DEPARTAMENTO_ID_FULL, Seccoes.DEPARTAMENTO_ID_INDEX );
|
|
FIELD_INDEXES.put( Seccoes.TO_DEPARTAMENTO_ID, Seccoes.TO_DEPARTAMENTO_ID_INDEX );
|
|
FIELD_INDEXES.put( Seccoes.ACTIVO, Seccoes.ACTIVO_INDEX );
|
|
FIELD_INDEXES.put( Seccoes.ACTIVO_FULL, Seccoes.ACTIVO_INDEX );
|
|
}
|
|
|
|
private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >();
|
|
|
|
|
|
public static final com.evolute.entity.ForeignKey ForeignKeydepartamento_idTodepartamentos =
|
|
new com.evolute.entity.ForeignKey( Seccoes.class, Seccoes.DEPARTAMENTO_ID, db.data.siprp.outer.DepartamentosData.class, db.data.siprp.outer.DepartamentosData.ID );
|
|
|
|
public static final String TABLENAME = "seccoes";
|
|
|
|
|
|
public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.seccoes";
|
|
|
|
public static final int _INVALID__INDEX = -1;
|
|
public static final String ID = "id";
|
|
public static final String ID_FULL = "seccoes.id";
|
|
public static final int ID_INDEX = 0;
|
|
public static final String DESCRICAO = "descricao";
|
|
public static final String DESCRICAO_FULL = "seccoes.descricao";
|
|
public static final int DESCRICAO_INDEX = 1;
|
|
public static final String DEPARTAMENTO_ID = "departamento_id";
|
|
public static final String DEPARTAMENTO_ID_FULL = "seccoes.departamento_id";
|
|
public static final int DEPARTAMENTO_ID_INDEX = 2;
|
|
public static final String TO_DEPARTAMENTO_ID = "to_departamento_id";
|
|
public static final String TO_DEPARTAMENTO_ID_FULL = "seccoes.to_departamento_id";
|
|
public static final int TO_DEPARTAMENTO_ID_INDEX = 3;
|
|
public static final String ACTIVO = "activo";
|
|
public static final String ACTIVO_FULL = "seccoes.activo";
|
|
public static final int ACTIVO_INDEX = 4;
|
|
|
|
public static final String FIELD_NAMES[] = new String[]{
|
|
DESCRICAO, DEPARTAMENTO_ID, TO_DEPARTAMENTO_ID, ACTIVO, };
|
|
|
|
public static final String FIELD_NAMES_FULL[] = new String[]{
|
|
TABLENAME + "." + DESCRICAO, TABLENAME + "." + DEPARTAMENTO_ID, TABLENAME + "." + TO_DEPARTAMENTO_ID, TABLENAME + "." + ACTIVO, };
|
|
|
|
protected static final String DB_FIELD_NAMES[] = new String[]{
|
|
ID, DESCRICAO, DEPARTAMENTO_ID, ACTIVO, };
|
|
|
|
|
|
protected static final String PK_FIELD_NAMES[] = new String[]{
|
|
ID, };
|
|
|
|
|
|
public static final String DEFAULT_LOAD_SET[] = new String[] {
|
|
ID, DESCRICAO, DEPARTAMENTO_ID, ACTIVO, };
|
|
|
|
private Integer id;
|
|
private String descricao;
|
|
private Integer departamento_id;
|
|
private db.data.siprp.outer.DepartamentosData to_departamento_id;
|
|
private String activo;
|
|
|
|
protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey;
|
|
|
|
public Seccoes()
|
|
{
|
|
super();
|
|
dirtyProperties = new boolean[]{ 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<db.data.siprp.outer.AnalisesAcidentesData>fromAnalisesAcidentes_seccao_id()
|
|
{
|
|
java.util.List<db.data.siprp.outer.AnalisesAcidentesData> result = null;
|
|
try
|
|
{
|
|
result = fromReference( db.data.siprp.outer.AnalisesAcidentesData.class , getPrimaryKey().getMap().get("id"), "seccao_id" );
|
|
}
|
|
catch( com.evolute.entity.evo.EvoDataException edex )
|
|
{
|
|
throw new RuntimeException( edex );
|
|
}
|
|
return result;
|
|
}
|
|
|
|
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 getDepartamento_id()
|
|
{
|
|
try
|
|
{
|
|
setLastAccess( System.currentTimeMillis() );
|
|
prepare( DEPARTAMENTO_ID );
|
|
}
|
|
catch( java.lang.Exception ex )
|
|
{
|
|
throw new RuntimeException( ex );
|
|
}
|
|
return this.departamento_id;
|
|
}
|
|
|
|
public void setDepartamento_id( Integer departamento_id )
|
|
{
|
|
try
|
|
{
|
|
setLockedForRefresh( true );
|
|
preProcess( DEPARTAMENTO_ID, departamento_id );
|
|
}
|
|
catch( com.evolute.entity.evo.EvoDataException edex )
|
|
{
|
|
throw new RuntimeException( edex );
|
|
}
|
|
this.departamento_id = departamento_id;
|
|
LAZY_LOADED_OBJECTS.put( DEPARTAMENTO_ID, Boolean.TRUE );
|
|
}
|
|
|
|
public db.data.siprp.outer.DepartamentosData toDepartamento_id()
|
|
{
|
|
try
|
|
{
|
|
prepare( TO_DEPARTAMENTO_ID );
|
|
}
|
|
catch( com.evolute.entity.evo.EvoDataException edex )
|
|
{
|
|
throw new RuntimeException( edex );
|
|
}
|
|
return this.to_departamento_id;
|
|
}
|
|
|
|
public void setToDepartamento_id( db.data.siprp.outer.DepartamentosData to_departamento_id )
|
|
{
|
|
try
|
|
{
|
|
preProcess( TO_DEPARTAMENTO_ID, to_departamento_id );
|
|
}
|
|
catch( com.evolute.entity.evo.EvoDataException edex )
|
|
{
|
|
throw new RuntimeException( edex );
|
|
}
|
|
this.to_departamento_id = to_departamento_id;
|
|
}
|
|
|
|
public String getActivo()
|
|
{
|
|
try
|
|
{
|
|
setLastAccess( System.currentTimeMillis() );
|
|
prepare( ACTIVO );
|
|
}
|
|
catch( java.lang.Exception ex )
|
|
{
|
|
throw new RuntimeException( ex );
|
|
}
|
|
return this.activo;
|
|
}
|
|
|
|
public void setActivo( String activo )
|
|
{
|
|
try
|
|
{
|
|
setLockedForRefresh( true );
|
|
preProcess( ACTIVO, activo );
|
|
}
|
|
catch( com.evolute.entity.evo.EvoDataException edex )
|
|
{
|
|
throw new RuntimeException( edex );
|
|
}
|
|
this.activo = activo;
|
|
LAZY_LOADED_OBJECTS.put( ACTIVO, Boolean.TRUE );
|
|
}
|
|
|
|
public Object get( String fieldName )
|
|
{
|
|
Object value = null;
|
|
Integer index = getFieldIndex( fieldName );
|
|
switch( index )
|
|
{
|
|
case Seccoes.ID_INDEX:
|
|
value = getId();
|
|
break;
|
|
case Seccoes.DESCRICAO_INDEX:
|
|
value = getDescricao();
|
|
break;
|
|
case Seccoes.DEPARTAMENTO_ID_INDEX:
|
|
value = getDepartamento_id();
|
|
break;
|
|
case Seccoes.TO_DEPARTAMENTO_ID_INDEX:
|
|
value = toDepartamento_id();
|
|
break;
|
|
case Seccoes.ACTIVO_INDEX:
|
|
value = getActivo();
|
|
break;
|
|
}
|
|
return value;
|
|
}
|
|
|
|
public Object rawGet( String fieldName )
|
|
{
|
|
Object value = null;
|
|
Integer index = getFieldIndex( fieldName );
|
|
switch( index )
|
|
{
|
|
case Seccoes.ID_INDEX:
|
|
value = this.id;
|
|
break;
|
|
case Seccoes.DESCRICAO_INDEX:
|
|
value = this.descricao;
|
|
break;
|
|
case Seccoes.DEPARTAMENTO_ID_INDEX:
|
|
value = this.departamento_id;
|
|
break;
|
|
case Seccoes.TO_DEPARTAMENTO_ID_INDEX:
|
|
value = this.to_departamento_id;
|
|
break;
|
|
case Seccoes.ACTIVO_INDEX:
|
|
value = this.activo;
|
|
break;
|
|
}
|
|
return value;
|
|
}
|
|
|
|
public void set( String fieldName, Object value )
|
|
{
|
|
Integer index = getFieldIndex( fieldName );
|
|
switch( index )
|
|
{
|
|
case Seccoes.ID_INDEX:
|
|
setId( ( Integer ) value );
|
|
break;
|
|
case Seccoes.DESCRICAO_INDEX:
|
|
setDescricao( ( String ) value );
|
|
break;
|
|
case Seccoes.DEPARTAMENTO_ID_INDEX:
|
|
setDepartamento_id( ( Integer ) value );
|
|
break;
|
|
case Seccoes.TO_DEPARTAMENTO_ID_INDEX:
|
|
setToDepartamento_id( ( db.data.siprp.outer.DepartamentosData ) value );
|
|
break;
|
|
case Seccoes.ACTIVO_INDEX:
|
|
setActivo( ( String ) value );
|
|
break;
|
|
}
|
|
}
|
|
|
|
public void rawSet( String fieldName, Object value )
|
|
{
|
|
Integer index = getFieldIndex( fieldName );
|
|
switch( index )
|
|
{
|
|
case Seccoes.ID_INDEX:
|
|
this.id = ( Integer ) value;
|
|
break;
|
|
case Seccoes.DESCRICAO_INDEX:
|
|
this.descricao = ( String ) value;
|
|
break;
|
|
case Seccoes.DEPARTAMENTO_ID_INDEX:
|
|
this.departamento_id = ( Integer ) value;
|
|
break;
|
|
case Seccoes.TO_DEPARTAMENTO_ID_INDEX:
|
|
this.to_departamento_id = ( db.data.siprp.outer.DepartamentosData ) value;
|
|
break;
|
|
case Seccoes.ACTIVO_INDEX:
|
|
this.activo = ( String ) 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 Seccoes.ID_INDEX:
|
|
theClass = Integer.class;
|
|
break;
|
|
case Seccoes.DESCRICAO_INDEX:
|
|
theClass = String.class;
|
|
break;
|
|
case Seccoes.DEPARTAMENTO_ID_INDEX:
|
|
theClass = Integer.class;
|
|
break;
|
|
case Seccoes.TO_DEPARTAMENTO_ID_INDEX:
|
|
theClass = db.data.siprp.outer.DepartamentosData.class;
|
|
break;
|
|
case Seccoes.ACTIVO_INDEX:
|
|
theClass = String.class;
|
|
break;
|
|
}
|
|
return theClass;
|
|
}
|
|
|
|
public Integer getFieldIndex( String fieldName )
|
|
{
|
|
Integer index = FIELD_INDEXES.get( fieldName );
|
|
return index != null ? index : Seccoes._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, Seccoes.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 );
|
|
}
|
|
}
|
|
}
|