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.
459 lines
10 KiB
459 lines
10 KiB
/*
|
|
* EcdOficial.java
|
|
*
|
|
* Generated by com.evutils.codegen.EntityObjectGenerator
|
|
*
|
|
* Use but DON'T TOUCH
|
|
* -> (can't touch this)
|
|
*/
|
|
package db.data.siprp_local.inner;
|
|
|
|
|
|
public class EcdOficial 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( EcdOficial.ID, EcdOficial.ID_INDEX );
|
|
FIELD_INDEXES.put( EcdOficial.ID_FULL, EcdOficial.ID_INDEX );
|
|
FIELD_INDEXES.put( EcdOficial.DESCRICAO, EcdOficial.DESCRICAO_INDEX );
|
|
FIELD_INDEXES.put( EcdOficial.DESCRICAO_FULL, EcdOficial.DESCRICAO_INDEX );
|
|
FIELD_INDEXES.put( EcdOficial.DESCRICAO_PLAIN, EcdOficial.DESCRICAO_PLAIN_INDEX );
|
|
FIELD_INDEXES.put( EcdOficial.DESCRICAO_PLAIN_FULL, EcdOficial.DESCRICAO_PLAIN_INDEX );
|
|
FIELD_INDEXES.put( EcdOficial.ORDEM, EcdOficial.ORDEM_INDEX );
|
|
FIELD_INDEXES.put( EcdOficial.ORDEM_FULL, EcdOficial.ORDEM_INDEX );
|
|
FIELD_INDEXES.put( EcdOficial.ACTIVO, EcdOficial.ACTIVO_INDEX );
|
|
FIELD_INDEXES.put( EcdOficial.ACTIVO_FULL, EcdOficial.ACTIVO_INDEX );
|
|
}
|
|
|
|
private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >();
|
|
|
|
|
|
public static final String TABLENAME = "ecd_oficial";
|
|
|
|
|
|
public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.ecd_oficial";
|
|
|
|
public static final int _INVALID__INDEX = -1;
|
|
public static final String ID = "id";
|
|
public static final String ID_FULL = "ecd_oficial.id";
|
|
public static final int ID_INDEX = 0;
|
|
public static final String DESCRICAO = "descricao";
|
|
public static final String DESCRICAO_FULL = "ecd_oficial.descricao";
|
|
public static final int DESCRICAO_INDEX = 1;
|
|
public static final String DESCRICAO_PLAIN = "descricao_plain";
|
|
public static final String DESCRICAO_PLAIN_FULL = "ecd_oficial.descricao_plain";
|
|
public static final int DESCRICAO_PLAIN_INDEX = 2;
|
|
public static final String ORDEM = "ordem";
|
|
public static final String ORDEM_FULL = "ecd_oficial.ordem";
|
|
public static final int ORDEM_INDEX = 3;
|
|
public static final String ACTIVO = "activo";
|
|
public static final String ACTIVO_FULL = "ecd_oficial.activo";
|
|
public static final int ACTIVO_INDEX = 4;
|
|
|
|
public static final String FIELD_NAMES[] = new String[]{
|
|
DESCRICAO, DESCRICAO_PLAIN, ORDEM, ACTIVO, };
|
|
|
|
public static final String FIELD_NAMES_FULL[] = new String[]{
|
|
TABLENAME + "." + DESCRICAO, TABLENAME + "." + DESCRICAO_PLAIN, TABLENAME + "." + ORDEM, TABLENAME + "." + ACTIVO, };
|
|
|
|
protected static final String DB_FIELD_NAMES[] = new String[]{
|
|
ID, DESCRICAO, DESCRICAO_PLAIN, ORDEM, ACTIVO, };
|
|
|
|
|
|
protected static final String PK_FIELD_NAMES[] = new String[]{
|
|
ID, };
|
|
|
|
|
|
public static final String DEFAULT_LOAD_SET[] = new String[] {
|
|
ID, DESCRICAO, DESCRICAO_PLAIN, ORDEM, ACTIVO, };
|
|
|
|
private Integer id;
|
|
private String descricao;
|
|
private String descricao_plain;
|
|
private Integer ordem;
|
|
private String activo;
|
|
|
|
protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey;
|
|
|
|
public EcdOficial()
|
|
{
|
|
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
|
|
{
|
|
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_local.outer.TrabalhadoresEcdData>fromTrabalhadoresEcd_ecd_oficial_id()
|
|
{
|
|
java.util.List<db.data.siprp_local.outer.TrabalhadoresEcdData> result = new java.util.LinkedList< db.data.siprp_local.outer.TrabalhadoresEcdData >();
|
|
if ( getPrimaryKey() != null )
|
|
{
|
|
try
|
|
{
|
|
result = fromReference( db.data.siprp_local.outer.TrabalhadoresEcdData.class , getPrimaryKey().getMap().get("id"), "ecd_oficial_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
|
|
{
|
|
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 String getDescricao_plain()
|
|
{
|
|
try
|
|
{
|
|
setLastAccess( System.currentTimeMillis() );
|
|
prepare( DESCRICAO_PLAIN );
|
|
}
|
|
catch( java.lang.Exception ex )
|
|
{
|
|
throw new RuntimeException( ex );
|
|
}
|
|
return this.descricao_plain;
|
|
}
|
|
|
|
public void setDescricao_plain( String descricao_plain )
|
|
{
|
|
try
|
|
{
|
|
preProcess( DESCRICAO_PLAIN, descricao_plain );
|
|
}
|
|
catch( com.evolute.entity.evo.EvoDataException edex )
|
|
{
|
|
throw new RuntimeException( edex );
|
|
}
|
|
this.descricao_plain = descricao_plain;
|
|
LAZY_LOADED_OBJECTS.put( DESCRICAO_PLAIN, 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 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
|
|
{
|
|
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 EcdOficial.ID_INDEX:
|
|
value = getId();
|
|
break;
|
|
case EcdOficial.DESCRICAO_INDEX:
|
|
value = getDescricao();
|
|
break;
|
|
case EcdOficial.DESCRICAO_PLAIN_INDEX:
|
|
value = getDescricao_plain();
|
|
break;
|
|
case EcdOficial.ORDEM_INDEX:
|
|
value = getOrdem();
|
|
break;
|
|
case EcdOficial.ACTIVO_INDEX:
|
|
value = getActivo();
|
|
break;
|
|
}
|
|
return value;
|
|
}
|
|
|
|
public Object rawGet( String fieldName )
|
|
{
|
|
Object value = null;
|
|
Integer index = getFieldIndex( fieldName );
|
|
switch( index )
|
|
{
|
|
case EcdOficial.ID_INDEX:
|
|
value = this.id;
|
|
break;
|
|
case EcdOficial.DESCRICAO_INDEX:
|
|
value = this.descricao;
|
|
break;
|
|
case EcdOficial.DESCRICAO_PLAIN_INDEX:
|
|
value = this.descricao_plain;
|
|
break;
|
|
case EcdOficial.ORDEM_INDEX:
|
|
value = this.ordem;
|
|
break;
|
|
case EcdOficial.ACTIVO_INDEX:
|
|
value = this.activo;
|
|
break;
|
|
}
|
|
return value;
|
|
}
|
|
|
|
public void set( String fieldName, Object value )
|
|
{
|
|
Integer index = getFieldIndex( fieldName );
|
|
switch( index )
|
|
{
|
|
case EcdOficial.ID_INDEX:
|
|
setId( ( Integer ) value );
|
|
break;
|
|
case EcdOficial.DESCRICAO_INDEX:
|
|
setDescricao( ( String ) value );
|
|
break;
|
|
case EcdOficial.DESCRICAO_PLAIN_INDEX:
|
|
setDescricao_plain( ( String ) value );
|
|
break;
|
|
case EcdOficial.ORDEM_INDEX:
|
|
setOrdem( ( Integer ) value );
|
|
break;
|
|
case EcdOficial.ACTIVO_INDEX:
|
|
setActivo( ( String ) value );
|
|
break;
|
|
}
|
|
}
|
|
|
|
public void rawSet( String fieldName, Object value )
|
|
{
|
|
Integer index = getFieldIndex( fieldName );
|
|
switch( index )
|
|
{
|
|
case EcdOficial.ID_INDEX:
|
|
this.id = ( Integer ) value;
|
|
break;
|
|
case EcdOficial.DESCRICAO_INDEX:
|
|
this.descricao = ( String ) value;
|
|
break;
|
|
case EcdOficial.DESCRICAO_PLAIN_INDEX:
|
|
this.descricao_plain = ( String ) value;
|
|
break;
|
|
case EcdOficial.ORDEM_INDEX:
|
|
this.ordem = ( Integer ) value;
|
|
break;
|
|
case EcdOficial.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 EcdOficial.ID_INDEX:
|
|
theClass = Integer.class;
|
|
break;
|
|
case EcdOficial.DESCRICAO_INDEX:
|
|
theClass = String.class;
|
|
break;
|
|
case EcdOficial.DESCRICAO_PLAIN_INDEX:
|
|
theClass = String.class;
|
|
break;
|
|
case EcdOficial.ORDEM_INDEX:
|
|
theClass = Integer.class;
|
|
break;
|
|
case EcdOficial.ACTIVO_INDEX:
|
|
theClass = String.class;
|
|
break;
|
|
}
|
|
return theClass;
|
|
}
|
|
|
|
public Integer getFieldIndex( String fieldName )
|
|
{
|
|
Integer index = FIELD_INDEXES.get( fieldName );
|
|
return index != null ? index : EcdOficial._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, EcdOficial.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 );
|
|
}
|
|
}
|
|
}
|