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.
394 lines
8.9 KiB
394 lines
8.9 KiB
/*
|
|
* Medidas.java
|
|
*
|
|
* Generated by com.evutils.codegen.EntityObjectGenerator
|
|
*
|
|
* Use but DON'T TOUCH
|
|
* -> (can't touch this)
|
|
*/
|
|
package db.data.siprp.inner;
|
|
|
|
|
|
public class Medidas 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( Medidas.ID, Medidas.ID_INDEX );
|
|
FIELD_INDEXES.put( Medidas.ID_FULL, Medidas.ID_INDEX );
|
|
com.evolute.entity.evo.EvoDataObject.register( Medidas.CLASS_IDENTIFIER, Medidas.ANALISE_ID, Medidas.TO_ANALISE_ID );
|
|
FIELD_INDEXES.put( Medidas.ANALISE_ID, Medidas.ANALISE_ID_INDEX );
|
|
FIELD_INDEXES.put( Medidas.ANALISE_ID_FULL, Medidas.ANALISE_ID_INDEX );
|
|
FIELD_INDEXES.put( Medidas.TO_ANALISE_ID, Medidas.TO_ANALISE_ID_INDEX );
|
|
FIELD_INDEXES.put( Medidas.MEDIDA, Medidas.MEDIDA_INDEX );
|
|
FIELD_INDEXES.put( Medidas.MEDIDA_FULL, Medidas.MEDIDA_INDEX );
|
|
}
|
|
|
|
private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >();
|
|
|
|
|
|
public static final com.evolute.entity.ForeignKey ForeignKeyanalise_idToanalises_acidentes =
|
|
new com.evolute.entity.ForeignKey( Medidas.class, Medidas.ANALISE_ID, db.data.siprp.outer.AnalisesAcidentesData.class, db.data.siprp.outer.AnalisesAcidentesData.ID );
|
|
|
|
public static final String TABLENAME = "medidas";
|
|
|
|
|
|
public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.medidas";
|
|
|
|
public static final int _INVALID__INDEX = -1;
|
|
public static final String ID = "id";
|
|
public static final String ID_FULL = "medidas.id";
|
|
public static final int ID_INDEX = 0;
|
|
public static final String ANALISE_ID = "analise_id";
|
|
public static final String ANALISE_ID_FULL = "medidas.analise_id";
|
|
public static final int ANALISE_ID_INDEX = 1;
|
|
public static final String TO_ANALISE_ID = "to_analise_id";
|
|
public static final String TO_ANALISE_ID_FULL = "medidas.to_analise_id";
|
|
public static final int TO_ANALISE_ID_INDEX = 2;
|
|
public static final String MEDIDA = "medida";
|
|
public static final String MEDIDA_FULL = "medidas.medida";
|
|
public static final int MEDIDA_INDEX = 3;
|
|
|
|
public static final String FIELD_NAMES[] = new String[]{
|
|
ANALISE_ID, TO_ANALISE_ID, MEDIDA, };
|
|
|
|
public static final String FIELD_NAMES_FULL[] = new String[]{
|
|
TABLENAME + "." + ANALISE_ID, TABLENAME + "." + TO_ANALISE_ID, TABLENAME + "." + MEDIDA, };
|
|
|
|
protected static final String DB_FIELD_NAMES[] = new String[]{
|
|
ID, ANALISE_ID, MEDIDA, };
|
|
|
|
|
|
protected static final String PK_FIELD_NAMES[] = new String[]{
|
|
ID, };
|
|
|
|
|
|
public static final String DEFAULT_LOAD_SET[] = new String[] {
|
|
ID, ANALISE_ID, MEDIDA, };
|
|
|
|
private Integer id;
|
|
private Integer analise_id;
|
|
private db.data.siprp.outer.AnalisesAcidentesData to_analise_id;
|
|
private String medida;
|
|
|
|
protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey;
|
|
|
|
public Medidas()
|
|
{
|
|
super();
|
|
dirtyProperties = new boolean[]{ 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 Integer getAnalise_id()
|
|
{
|
|
try
|
|
{
|
|
setLastAccess( System.currentTimeMillis() );
|
|
prepare( ANALISE_ID );
|
|
}
|
|
catch( java.lang.Exception ex )
|
|
{
|
|
throw new RuntimeException( ex );
|
|
}
|
|
return this.analise_id;
|
|
}
|
|
|
|
public void setAnalise_id( Integer analise_id )
|
|
{
|
|
try
|
|
{
|
|
preProcess( ANALISE_ID, analise_id );
|
|
}
|
|
catch( com.evolute.entity.evo.EvoDataException edex )
|
|
{
|
|
throw new RuntimeException( edex );
|
|
}
|
|
this.analise_id = analise_id;
|
|
LAZY_LOADED_OBJECTS.put( ANALISE_ID, Boolean.TRUE );
|
|
}
|
|
|
|
public db.data.siprp.outer.AnalisesAcidentesData toAnalise_id()
|
|
{
|
|
try
|
|
{
|
|
prepare( TO_ANALISE_ID );
|
|
}
|
|
catch( com.evolute.entity.evo.EvoDataException edex )
|
|
{
|
|
throw new RuntimeException( edex );
|
|
}
|
|
return this.to_analise_id;
|
|
}
|
|
|
|
public void setToAnalise_id( db.data.siprp.outer.AnalisesAcidentesData to_analise_id )
|
|
{
|
|
try
|
|
{
|
|
preProcess( TO_ANALISE_ID, to_analise_id );
|
|
}
|
|
catch( com.evolute.entity.evo.EvoDataException edex )
|
|
{
|
|
throw new RuntimeException( edex );
|
|
}
|
|
this.to_analise_id = to_analise_id;
|
|
}
|
|
|
|
public String getMedida()
|
|
{
|
|
try
|
|
{
|
|
setLastAccess( System.currentTimeMillis() );
|
|
prepare( MEDIDA );
|
|
}
|
|
catch( java.lang.Exception ex )
|
|
{
|
|
throw new RuntimeException( ex );
|
|
}
|
|
return this.medida;
|
|
}
|
|
|
|
public void setMedida( String medida )
|
|
{
|
|
try
|
|
{
|
|
preProcess( MEDIDA, medida );
|
|
}
|
|
catch( com.evolute.entity.evo.EvoDataException edex )
|
|
{
|
|
throw new RuntimeException( edex );
|
|
}
|
|
this.medida = medida;
|
|
LAZY_LOADED_OBJECTS.put( MEDIDA, Boolean.TRUE );
|
|
}
|
|
|
|
public Object get( String fieldName )
|
|
{
|
|
Object value = null;
|
|
Integer index = getFieldIndex( fieldName );
|
|
switch( index )
|
|
{
|
|
case Medidas.ID_INDEX:
|
|
value = getId();
|
|
break;
|
|
case Medidas.ANALISE_ID_INDEX:
|
|
value = getAnalise_id();
|
|
break;
|
|
case Medidas.TO_ANALISE_ID_INDEX:
|
|
value = toAnalise_id();
|
|
break;
|
|
case Medidas.MEDIDA_INDEX:
|
|
value = getMedida();
|
|
break;
|
|
}
|
|
return value;
|
|
}
|
|
|
|
public Object rawGet( String fieldName )
|
|
{
|
|
Object value = null;
|
|
Integer index = getFieldIndex( fieldName );
|
|
switch( index )
|
|
{
|
|
case Medidas.ID_INDEX:
|
|
value = this.id;
|
|
break;
|
|
case Medidas.ANALISE_ID_INDEX:
|
|
value = this.analise_id;
|
|
break;
|
|
case Medidas.TO_ANALISE_ID_INDEX:
|
|
value = this.to_analise_id;
|
|
break;
|
|
case Medidas.MEDIDA_INDEX:
|
|
value = this.medida;
|
|
break;
|
|
}
|
|
return value;
|
|
}
|
|
|
|
public void set( String fieldName, Object value )
|
|
{
|
|
Integer index = getFieldIndex( fieldName );
|
|
switch( index )
|
|
{
|
|
case Medidas.ID_INDEX:
|
|
setId( ( Integer ) value );
|
|
break;
|
|
case Medidas.ANALISE_ID_INDEX:
|
|
setAnalise_id( ( Integer ) value );
|
|
break;
|
|
case Medidas.TO_ANALISE_ID_INDEX:
|
|
setToAnalise_id( ( db.data.siprp.outer.AnalisesAcidentesData ) value );
|
|
break;
|
|
case Medidas.MEDIDA_INDEX:
|
|
setMedida( ( String ) value );
|
|
break;
|
|
}
|
|
}
|
|
|
|
public void rawSet( String fieldName, Object value )
|
|
{
|
|
Integer index = getFieldIndex( fieldName );
|
|
switch( index )
|
|
{
|
|
case Medidas.ID_INDEX:
|
|
this.id = ( Integer ) value;
|
|
break;
|
|
case Medidas.ANALISE_ID_INDEX:
|
|
this.analise_id = ( Integer ) value;
|
|
break;
|
|
case Medidas.TO_ANALISE_ID_INDEX:
|
|
this.to_analise_id = ( db.data.siprp.outer.AnalisesAcidentesData ) value;
|
|
break;
|
|
case Medidas.MEDIDA_INDEX:
|
|
this.medida = ( 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 Medidas.ID_INDEX:
|
|
theClass = Integer.class;
|
|
break;
|
|
case Medidas.ANALISE_ID_INDEX:
|
|
theClass = Integer.class;
|
|
break;
|
|
case Medidas.TO_ANALISE_ID_INDEX:
|
|
theClass = db.data.siprp.outer.AnalisesAcidentesData.class;
|
|
break;
|
|
case Medidas.MEDIDA_INDEX:
|
|
theClass = String.class;
|
|
break;
|
|
}
|
|
return theClass;
|
|
}
|
|
|
|
public Integer getFieldIndex( String fieldName )
|
|
{
|
|
Integer index = FIELD_INDEXES.get( fieldName );
|
|
return index != null ? index : Medidas._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, Medidas.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 );
|
|
}
|
|
}
|
|
}
|