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.
558 lines
13 KiB
558 lines
13 KiB
/*
|
|
* PlanoAreas.java
|
|
*
|
|
* Generated by com.evutils.codegen.EntityObjectGenerator
|
|
*
|
|
* Use but DON'T TOUCH
|
|
* -> (can't touch this)
|
|
*/
|
|
package db.data.siprp.inner;
|
|
|
|
|
|
public class PlanoAreas 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( PlanoAreas.DESCRICAO, PlanoAreas.DESCRICAO_INDEX );
|
|
FIELD_INDEXES.put( PlanoAreas.DESCRICAO_FULL, PlanoAreas.DESCRICAO_INDEX );
|
|
com.evolute.entity.evo.EvoDataObject.register( PlanoAreas.CLASS_IDENTIFIER, PlanoAreas.PLANO_ID, PlanoAreas.TO_PLANO_ID );
|
|
FIELD_INDEXES.put( PlanoAreas.PLANO_ID, PlanoAreas.PLANO_ID_INDEX );
|
|
FIELD_INDEXES.put( PlanoAreas.PLANO_ID_FULL, PlanoAreas.PLANO_ID_INDEX );
|
|
FIELD_INDEXES.put( PlanoAreas.TO_PLANO_ID, PlanoAreas.TO_PLANO_ID_INDEX );
|
|
FIELD_INDEXES.put( PlanoAreas.ID, PlanoAreas.ID_INDEX );
|
|
FIELD_INDEXES.put( PlanoAreas.ID_FULL, PlanoAreas.ID_INDEX );
|
|
FIELD_INDEXES.put( PlanoAreas.AREA_ID, PlanoAreas.AREA_ID_INDEX );
|
|
FIELD_INDEXES.put( PlanoAreas.AREA_ID_FULL, PlanoAreas.AREA_ID_INDEX );
|
|
FIELD_INDEXES.put( PlanoAreas.IS_PRINCIPAL, PlanoAreas.IS_PRINCIPAL_INDEX );
|
|
FIELD_INDEXES.put( PlanoAreas.IS_PRINCIPAL_FULL, PlanoAreas.IS_PRINCIPAL_INDEX );
|
|
FIELD_INDEXES.put( PlanoAreas.ORDEM, PlanoAreas.ORDEM_INDEX );
|
|
FIELD_INDEXES.put( PlanoAreas.ORDEM_FULL, PlanoAreas.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 ForeignKeyplano_idToplanos_actuacao =
|
|
new com.evolute.entity.ForeignKey( PlanoAreas.class, PlanoAreas.PLANO_ID, db.data.siprp.outer.PlanosActuacaoData.class, db.data.siprp.outer.PlanosActuacaoData.ID );
|
|
|
|
public static final String TABLENAME = "plano_areas";
|
|
|
|
|
|
public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.plano_areas";
|
|
|
|
public static final int _INVALID__INDEX = -1;
|
|
public static final String DESCRICAO = "descricao";
|
|
public static final String DESCRICAO_FULL = "plano_areas.descricao";
|
|
public static final int DESCRICAO_INDEX = 0;
|
|
public static final String PLANO_ID = "plano_id";
|
|
public static final String PLANO_ID_FULL = "plano_areas.plano_id";
|
|
public static final int PLANO_ID_INDEX = 1;
|
|
public static final String TO_PLANO_ID = "to_plano_id";
|
|
public static final String TO_PLANO_ID_FULL = "plano_areas.to_plano_id";
|
|
public static final int TO_PLANO_ID_INDEX = 2;
|
|
public static final String ID = "id";
|
|
public static final String ID_FULL = "plano_areas.id";
|
|
public static final int ID_INDEX = 3;
|
|
public static final String AREA_ID = "area_id";
|
|
public static final String AREA_ID_FULL = "plano_areas.area_id";
|
|
public static final int AREA_ID_INDEX = 4;
|
|
public static final String IS_PRINCIPAL = "is_principal";
|
|
public static final String IS_PRINCIPAL_FULL = "plano_areas.is_principal";
|
|
public static final int IS_PRINCIPAL_INDEX = 5;
|
|
public static final String ORDEM = "ordem";
|
|
public static final String ORDEM_FULL = "plano_areas.ordem";
|
|
public static final int ORDEM_INDEX = 6;
|
|
|
|
public static final String FIELD_NAMES[] = new String[]{
|
|
DESCRICAO, PLANO_ID, TO_PLANO_ID, AREA_ID, IS_PRINCIPAL, ORDEM, };
|
|
|
|
public static final String FIELD_NAMES_FULL[] = new String[]{
|
|
TABLENAME + "." + DESCRICAO, TABLENAME + "." + PLANO_ID, TABLENAME + "." + TO_PLANO_ID, TABLENAME + "." + AREA_ID, TABLENAME + "." + IS_PRINCIPAL, TABLENAME + "." + ORDEM, };
|
|
|
|
protected static final String DB_FIELD_NAMES[] = new String[]{
|
|
DESCRICAO, PLANO_ID, ID, AREA_ID, IS_PRINCIPAL, ORDEM, };
|
|
|
|
|
|
protected static final String PK_FIELD_NAMES[] = new String[]{
|
|
ID, };
|
|
|
|
|
|
public static final String DEFAULT_LOAD_SET[] = new String[] {
|
|
DESCRICAO, PLANO_ID, ID, AREA_ID, IS_PRINCIPAL, ORDEM, };
|
|
|
|
private String descricao;
|
|
private Integer plano_id;
|
|
private db.data.siprp.outer.PlanosActuacaoData to_plano_id;
|
|
private Integer id;
|
|
private Integer area_id;
|
|
private Boolean is_principal;
|
|
private Integer ordem;
|
|
|
|
protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey;
|
|
|
|
public PlanoAreas()
|
|
{
|
|
super();
|
|
dirtyProperties = new boolean[]{ false, false, false,
|
|
false, false, false, false };
|
|
}
|
|
|
|
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
|
|
{
|
|
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 getPlano_id()
|
|
{
|
|
try
|
|
{
|
|
setLastAccess( System.currentTimeMillis() );
|
|
prepare( PLANO_ID );
|
|
}
|
|
catch( java.lang.Exception ex )
|
|
{
|
|
throw new RuntimeException( ex );
|
|
}
|
|
return this.plano_id;
|
|
}
|
|
|
|
public void setPlano_id( Integer plano_id )
|
|
{
|
|
try
|
|
{
|
|
preProcess( PLANO_ID, plano_id );
|
|
}
|
|
catch( com.evolute.entity.evo.EvoDataException edex )
|
|
{
|
|
throw new RuntimeException( edex );
|
|
}
|
|
this.plano_id = plano_id;
|
|
LAZY_LOADED_OBJECTS.put( PLANO_ID, Boolean.TRUE );
|
|
}
|
|
|
|
public db.data.siprp.outer.PlanosActuacaoData toPlano_id()
|
|
{
|
|
try
|
|
{
|
|
prepare( TO_PLANO_ID );
|
|
}
|
|
catch( com.evolute.entity.evo.EvoDataException edex )
|
|
{
|
|
throw new RuntimeException( edex );
|
|
}
|
|
return this.to_plano_id;
|
|
}
|
|
|
|
public void setToPlano_id( db.data.siprp.outer.PlanosActuacaoData to_plano_id )
|
|
{
|
|
try
|
|
{
|
|
preProcess( TO_PLANO_ID, to_plano_id );
|
|
}
|
|
catch( com.evolute.entity.evo.EvoDataException edex )
|
|
{
|
|
throw new RuntimeException( edex );
|
|
}
|
|
this.to_plano_id = to_plano_id;
|
|
}
|
|
|
|
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
|
|
{
|
|
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.PlanoRiscosData>fromPlanoRiscos_area_id()
|
|
{
|
|
java.util.List<db.data.siprp.outer.PlanoRiscosData> result = new java.util.LinkedList< db.data.siprp.outer.PlanoRiscosData >();
|
|
if ( getPrimaryKey() != null )
|
|
{
|
|
try
|
|
{
|
|
result = fromReference( db.data.siprp.outer.PlanoRiscosData.class , getPrimaryKey().getMap().get("id"), "area_id" );
|
|
}
|
|
catch( com.evolute.entity.evo.EvoDataException edex )
|
|
{
|
|
throw new RuntimeException( edex );
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
|
|
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
|
|
{
|
|
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 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
|
|
{
|
|
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 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
|
|
{
|
|
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 PlanoAreas.DESCRICAO_INDEX:
|
|
value = getDescricao();
|
|
break;
|
|
case PlanoAreas.PLANO_ID_INDEX:
|
|
value = getPlano_id();
|
|
break;
|
|
case PlanoAreas.TO_PLANO_ID_INDEX:
|
|
value = toPlano_id();
|
|
break;
|
|
case PlanoAreas.ID_INDEX:
|
|
value = getId();
|
|
break;
|
|
case PlanoAreas.AREA_ID_INDEX:
|
|
value = getArea_id();
|
|
break;
|
|
case PlanoAreas.IS_PRINCIPAL_INDEX:
|
|
value = getIs_principal();
|
|
break;
|
|
case PlanoAreas.ORDEM_INDEX:
|
|
value = getOrdem();
|
|
break;
|
|
}
|
|
return value;
|
|
}
|
|
|
|
public Object rawGet( String fieldName )
|
|
{
|
|
Object value = null;
|
|
Integer index = getFieldIndex( fieldName );
|
|
switch( index )
|
|
{
|
|
case PlanoAreas.DESCRICAO_INDEX:
|
|
value = this.descricao;
|
|
break;
|
|
case PlanoAreas.PLANO_ID_INDEX:
|
|
value = this.plano_id;
|
|
break;
|
|
case PlanoAreas.TO_PLANO_ID_INDEX:
|
|
value = this.to_plano_id;
|
|
break;
|
|
case PlanoAreas.ID_INDEX:
|
|
value = this.id;
|
|
break;
|
|
case PlanoAreas.AREA_ID_INDEX:
|
|
value = this.area_id;
|
|
break;
|
|
case PlanoAreas.IS_PRINCIPAL_INDEX:
|
|
value = this.is_principal;
|
|
break;
|
|
case PlanoAreas.ORDEM_INDEX:
|
|
value = this.ordem;
|
|
break;
|
|
}
|
|
return value;
|
|
}
|
|
|
|
public void set( String fieldName, Object value )
|
|
{
|
|
Integer index = getFieldIndex( fieldName );
|
|
switch( index )
|
|
{
|
|
case PlanoAreas.DESCRICAO_INDEX:
|
|
setDescricao( ( String ) value );
|
|
break;
|
|
case PlanoAreas.PLANO_ID_INDEX:
|
|
setPlano_id( ( Integer ) value );
|
|
break;
|
|
case PlanoAreas.TO_PLANO_ID_INDEX:
|
|
setToPlano_id( ( db.data.siprp.outer.PlanosActuacaoData ) value );
|
|
break;
|
|
case PlanoAreas.ID_INDEX:
|
|
setId( ( Integer ) value );
|
|
break;
|
|
case PlanoAreas.AREA_ID_INDEX:
|
|
setArea_id( ( Integer ) value );
|
|
break;
|
|
case PlanoAreas.IS_PRINCIPAL_INDEX:
|
|
setIs_principal( ( Boolean ) value );
|
|
break;
|
|
case PlanoAreas.ORDEM_INDEX:
|
|
setOrdem( ( Integer ) value );
|
|
break;
|
|
}
|
|
}
|
|
|
|
public void rawSet( String fieldName, Object value )
|
|
{
|
|
Integer index = getFieldIndex( fieldName );
|
|
switch( index )
|
|
{
|
|
case PlanoAreas.DESCRICAO_INDEX:
|
|
this.descricao = ( String ) value;
|
|
break;
|
|
case PlanoAreas.PLANO_ID_INDEX:
|
|
this.plano_id = ( Integer ) value;
|
|
break;
|
|
case PlanoAreas.TO_PLANO_ID_INDEX:
|
|
this.to_plano_id = ( db.data.siprp.outer.PlanosActuacaoData ) value;
|
|
break;
|
|
case PlanoAreas.ID_INDEX:
|
|
this.id = ( Integer ) value;
|
|
break;
|
|
case PlanoAreas.AREA_ID_INDEX:
|
|
this.area_id = ( Integer ) value;
|
|
break;
|
|
case PlanoAreas.IS_PRINCIPAL_INDEX:
|
|
this.is_principal = ( Boolean ) value;
|
|
break;
|
|
case PlanoAreas.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 PlanoAreas.DESCRICAO_INDEX:
|
|
theClass = String.class;
|
|
break;
|
|
case PlanoAreas.PLANO_ID_INDEX:
|
|
theClass = Integer.class;
|
|
break;
|
|
case PlanoAreas.TO_PLANO_ID_INDEX:
|
|
theClass = db.data.siprp.outer.PlanosActuacaoData.class;
|
|
break;
|
|
case PlanoAreas.ID_INDEX:
|
|
theClass = Integer.class;
|
|
break;
|
|
case PlanoAreas.AREA_ID_INDEX:
|
|
theClass = Integer.class;
|
|
break;
|
|
case PlanoAreas.IS_PRINCIPAL_INDEX:
|
|
theClass = Boolean.class;
|
|
break;
|
|
case PlanoAreas.ORDEM_INDEX:
|
|
theClass = Integer.class;
|
|
break;
|
|
}
|
|
return theClass;
|
|
}
|
|
|
|
public Integer getFieldIndex( String fieldName )
|
|
{
|
|
Integer index = FIELD_INDEXES.get( fieldName );
|
|
return index != null ? index : PlanoAreas._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, PlanoAreas.PK_FIELD_NAMES );
|
|
Object idObject = array.get( row, col + 0 );
|
|
try
|
|
{
|
|
primaryKey.set( 0, ( Integer ) idObject );
|
|
setId( ( Integer ) idObject );
|
|
}
|
|
catch( ClassCastException ex )
|
|
{
|
|
if( idObject instanceof Number )
|
|
{
|
|
primaryKey.set( 0, ((Number)idObject).intValue() );
|
|
setId( ((Number)idObject).intValue() );
|
|
}
|
|
else {
|
|
throw ex;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@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 );
|
|
}
|
|
}
|
|
}
|