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.
343 lines
7.4 KiB
343 lines
7.4 KiB
/*
|
|
* Permissoes.java
|
|
*
|
|
* Generated by com.evutils.codegen.EntityObjectGenerator
|
|
*
|
|
* Use but DON'T TOUCH
|
|
* -> (can't touch this)
|
|
*/
|
|
package db.data.siprp.inner;
|
|
|
|
|
|
public class Permissoes 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( Permissoes.ID, Permissoes.ID_INDEX );
|
|
FIELD_INDEXES.put( Permissoes.ID_FULL, Permissoes.ID_INDEX );
|
|
FIELD_INDEXES.put( Permissoes.USER_ID, Permissoes.USER_ID_INDEX );
|
|
FIELD_INDEXES.put( Permissoes.USER_ID_FULL, Permissoes.USER_ID_INDEX );
|
|
FIELD_INDEXES.put( Permissoes.CODIGO_PERMISSAO, Permissoes.CODIGO_PERMISSAO_INDEX );
|
|
FIELD_INDEXES.put( Permissoes.CODIGO_PERMISSAO_FULL, Permissoes.CODIGO_PERMISSAO_INDEX );
|
|
}
|
|
|
|
private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >();
|
|
|
|
|
|
public static final String TABLENAME = "permissoes";
|
|
|
|
|
|
public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.permissoes";
|
|
|
|
public static final int _INVALID__INDEX = -1;
|
|
public static final String ID = "id";
|
|
public static final String ID_FULL = "permissoes.id";
|
|
public static final int ID_INDEX = 0;
|
|
public static final String USER_ID = "user_id";
|
|
public static final String USER_ID_FULL = "permissoes.user_id";
|
|
public static final int USER_ID_INDEX = 1;
|
|
public static final String CODIGO_PERMISSAO = "codigo_permissao";
|
|
public static final String CODIGO_PERMISSAO_FULL = "permissoes.codigo_permissao";
|
|
public static final int CODIGO_PERMISSAO_INDEX = 2;
|
|
|
|
public static final String FIELD_NAMES[] = new String[]{
|
|
USER_ID, CODIGO_PERMISSAO, };
|
|
|
|
public static final String FIELD_NAMES_FULL[] = new String[]{
|
|
TABLENAME + "." + USER_ID, TABLENAME + "." + CODIGO_PERMISSAO, };
|
|
|
|
protected static final String DB_FIELD_NAMES[] = new String[]{
|
|
ID, USER_ID, CODIGO_PERMISSAO, };
|
|
|
|
|
|
protected static final String PK_FIELD_NAMES[] = new String[]{
|
|
ID, };
|
|
|
|
|
|
public static final String DEFAULT_LOAD_SET[] = new String[] {
|
|
ID, USER_ID, CODIGO_PERMISSAO, };
|
|
|
|
private Integer id;
|
|
private Integer user_id;
|
|
private Integer codigo_permissao;
|
|
|
|
protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey;
|
|
|
|
public Permissoes()
|
|
{
|
|
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
|
|
{
|
|
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 getUser_id()
|
|
{
|
|
try
|
|
{
|
|
setLastAccess( System.currentTimeMillis() );
|
|
prepare( USER_ID );
|
|
}
|
|
catch( java.lang.Exception ex )
|
|
{
|
|
throw new RuntimeException( ex );
|
|
}
|
|
return this.user_id;
|
|
}
|
|
|
|
public void setUser_id( Integer user_id )
|
|
{
|
|
try
|
|
{
|
|
preProcess( USER_ID, user_id );
|
|
}
|
|
catch( com.evolute.entity.evo.EvoDataException edex )
|
|
{
|
|
throw new RuntimeException( edex );
|
|
}
|
|
this.user_id = user_id;
|
|
LAZY_LOADED_OBJECTS.put( USER_ID, Boolean.TRUE );
|
|
}
|
|
|
|
public Integer getCodigo_permissao()
|
|
{
|
|
try
|
|
{
|
|
setLastAccess( System.currentTimeMillis() );
|
|
prepare( CODIGO_PERMISSAO );
|
|
}
|
|
catch( java.lang.Exception ex )
|
|
{
|
|
throw new RuntimeException( ex );
|
|
}
|
|
return this.codigo_permissao;
|
|
}
|
|
|
|
public void setCodigo_permissao( Integer codigo_permissao )
|
|
{
|
|
try
|
|
{
|
|
preProcess( CODIGO_PERMISSAO, codigo_permissao );
|
|
}
|
|
catch( com.evolute.entity.evo.EvoDataException edex )
|
|
{
|
|
throw new RuntimeException( edex );
|
|
}
|
|
this.codigo_permissao = codigo_permissao;
|
|
LAZY_LOADED_OBJECTS.put( CODIGO_PERMISSAO, Boolean.TRUE );
|
|
}
|
|
|
|
public Object get( String fieldName )
|
|
{
|
|
Object value = null;
|
|
Integer index = getFieldIndex( fieldName );
|
|
switch( index )
|
|
{
|
|
case Permissoes.ID_INDEX:
|
|
value = getId();
|
|
break;
|
|
case Permissoes.USER_ID_INDEX:
|
|
value = getUser_id();
|
|
break;
|
|
case Permissoes.CODIGO_PERMISSAO_INDEX:
|
|
value = getCodigo_permissao();
|
|
break;
|
|
}
|
|
return value;
|
|
}
|
|
|
|
public Object rawGet( String fieldName )
|
|
{
|
|
Object value = null;
|
|
Integer index = getFieldIndex( fieldName );
|
|
switch( index )
|
|
{
|
|
case Permissoes.ID_INDEX:
|
|
value = this.id;
|
|
break;
|
|
case Permissoes.USER_ID_INDEX:
|
|
value = this.user_id;
|
|
break;
|
|
case Permissoes.CODIGO_PERMISSAO_INDEX:
|
|
value = this.codigo_permissao;
|
|
break;
|
|
}
|
|
return value;
|
|
}
|
|
|
|
public void set( String fieldName, Object value )
|
|
{
|
|
Integer index = getFieldIndex( fieldName );
|
|
switch( index )
|
|
{
|
|
case Permissoes.ID_INDEX:
|
|
setId( ( Integer ) value );
|
|
break;
|
|
case Permissoes.USER_ID_INDEX:
|
|
setUser_id( ( Integer ) value );
|
|
break;
|
|
case Permissoes.CODIGO_PERMISSAO_INDEX:
|
|
setCodigo_permissao( ( Integer ) value );
|
|
break;
|
|
}
|
|
}
|
|
|
|
public void rawSet( String fieldName, Object value )
|
|
{
|
|
Integer index = getFieldIndex( fieldName );
|
|
switch( index )
|
|
{
|
|
case Permissoes.ID_INDEX:
|
|
this.id = ( Integer ) value;
|
|
break;
|
|
case Permissoes.USER_ID_INDEX:
|
|
this.user_id = ( Integer ) value;
|
|
break;
|
|
case Permissoes.CODIGO_PERMISSAO_INDEX:
|
|
this.codigo_permissao = ( 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 Permissoes.ID_INDEX:
|
|
theClass = Integer.class;
|
|
break;
|
|
case Permissoes.USER_ID_INDEX:
|
|
theClass = Integer.class;
|
|
break;
|
|
case Permissoes.CODIGO_PERMISSAO_INDEX:
|
|
theClass = Integer.class;
|
|
break;
|
|
}
|
|
return theClass;
|
|
}
|
|
|
|
public Integer getFieldIndex( String fieldName )
|
|
{
|
|
Integer index = FIELD_INDEXES.get( fieldName );
|
|
return index != null ? index : Permissoes._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, Permissoes.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 );
|
|
}
|
|
}
|
|
}
|