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
/*
|
|
* Version.java
|
|
*
|
|
* Generated by com.evutils.codegen.EntityObjectGenerator
|
|
*
|
|
* Use but DON'T TOUCH
|
|
* -> (can't touch this)
|
|
*/
|
|
package db.data.siprp.inner;
|
|
|
|
|
|
public class Version 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( Version.CURRENT_VERSION, Version.CURRENT_VERSION_INDEX );
|
|
FIELD_INDEXES.put( Version.CURRENT_VERSION_FULL, Version.CURRENT_VERSION_INDEX );
|
|
FIELD_INDEXES.put( Version.ID, Version.ID_INDEX );
|
|
FIELD_INDEXES.put( Version.ID_FULL, Version.ID_INDEX );
|
|
FIELD_INDEXES.put( Version.MODULE_NAME, Version.MODULE_NAME_INDEX );
|
|
FIELD_INDEXES.put( Version.MODULE_NAME_FULL, Version.MODULE_NAME_INDEX );
|
|
}
|
|
|
|
private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >();
|
|
|
|
|
|
public static final String TABLENAME = "version";
|
|
|
|
|
|
public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.version";
|
|
|
|
public static final int _INVALID__INDEX = -1;
|
|
public static final String CURRENT_VERSION = "current_version";
|
|
public static final String CURRENT_VERSION_FULL = "version.current_version";
|
|
public static final int CURRENT_VERSION_INDEX = 0;
|
|
public static final String ID = "id";
|
|
public static final String ID_FULL = "version.id";
|
|
public static final int ID_INDEX = 1;
|
|
public static final String MODULE_NAME = "module_name";
|
|
public static final String MODULE_NAME_FULL = "version.module_name";
|
|
public static final int MODULE_NAME_INDEX = 2;
|
|
|
|
public static final String FIELD_NAMES[] = new String[]{
|
|
CURRENT_VERSION, MODULE_NAME, };
|
|
|
|
public static final String FIELD_NAMES_FULL[] = new String[]{
|
|
TABLENAME + "." + CURRENT_VERSION, TABLENAME + "." + MODULE_NAME, };
|
|
|
|
protected static final String DB_FIELD_NAMES[] = new String[]{
|
|
CURRENT_VERSION, ID, MODULE_NAME, };
|
|
|
|
|
|
protected static final String PK_FIELD_NAMES[] = new String[]{
|
|
ID, };
|
|
|
|
|
|
public static final String DEFAULT_LOAD_SET[] = new String[] {
|
|
CURRENT_VERSION, ID, MODULE_NAME, };
|
|
|
|
private Double current_version;
|
|
private Integer id;
|
|
private String module_name;
|
|
|
|
protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey;
|
|
|
|
public Version()
|
|
{
|
|
super();
|
|
dirtyProperties = new boolean[]{ false, false, false };
|
|
}
|
|
|
|
public Double getCurrent_version()
|
|
{
|
|
try
|
|
{
|
|
setLastAccess( System.currentTimeMillis() );
|
|
prepare( CURRENT_VERSION );
|
|
}
|
|
catch( java.lang.Exception ex )
|
|
{
|
|
throw new RuntimeException( ex );
|
|
}
|
|
return this.current_version;
|
|
}
|
|
|
|
public void setCurrent_version( Double current_version )
|
|
{
|
|
try
|
|
{
|
|
preProcess( CURRENT_VERSION, current_version );
|
|
}
|
|
catch( com.evolute.entity.evo.EvoDataException edex )
|
|
{
|
|
throw new RuntimeException( edex );
|
|
}
|
|
this.current_version = current_version;
|
|
LAZY_LOADED_OBJECTS.put( CURRENT_VERSION, Boolean.TRUE );
|
|
}
|
|
|
|
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 String getModule_name()
|
|
{
|
|
try
|
|
{
|
|
setLastAccess( System.currentTimeMillis() );
|
|
prepare( MODULE_NAME );
|
|
}
|
|
catch( java.lang.Exception ex )
|
|
{
|
|
throw new RuntimeException( ex );
|
|
}
|
|
return this.module_name;
|
|
}
|
|
|
|
public void setModule_name( String module_name )
|
|
{
|
|
try
|
|
{
|
|
preProcess( MODULE_NAME, module_name );
|
|
}
|
|
catch( com.evolute.entity.evo.EvoDataException edex )
|
|
{
|
|
throw new RuntimeException( edex );
|
|
}
|
|
this.module_name = module_name;
|
|
LAZY_LOADED_OBJECTS.put( MODULE_NAME, Boolean.TRUE );
|
|
}
|
|
|
|
public Object get( String fieldName )
|
|
{
|
|
Object value = null;
|
|
Integer index = getFieldIndex( fieldName );
|
|
switch( index )
|
|
{
|
|
case Version.CURRENT_VERSION_INDEX:
|
|
value = getCurrent_version();
|
|
break;
|
|
case Version.ID_INDEX:
|
|
value = getId();
|
|
break;
|
|
case Version.MODULE_NAME_INDEX:
|
|
value = getModule_name();
|
|
break;
|
|
}
|
|
return value;
|
|
}
|
|
|
|
public Object rawGet( String fieldName )
|
|
{
|
|
Object value = null;
|
|
Integer index = getFieldIndex( fieldName );
|
|
switch( index )
|
|
{
|
|
case Version.CURRENT_VERSION_INDEX:
|
|
value = this.current_version;
|
|
break;
|
|
case Version.ID_INDEX:
|
|
value = this.id;
|
|
break;
|
|
case Version.MODULE_NAME_INDEX:
|
|
value = this.module_name;
|
|
break;
|
|
}
|
|
return value;
|
|
}
|
|
|
|
public void set( String fieldName, Object value )
|
|
{
|
|
Integer index = getFieldIndex( fieldName );
|
|
switch( index )
|
|
{
|
|
case Version.CURRENT_VERSION_INDEX:
|
|
setCurrent_version( ( Double ) value );
|
|
break;
|
|
case Version.ID_INDEX:
|
|
setId( ( Integer ) value );
|
|
break;
|
|
case Version.MODULE_NAME_INDEX:
|
|
setModule_name( ( String ) value );
|
|
break;
|
|
}
|
|
}
|
|
|
|
public void rawSet( String fieldName, Object value )
|
|
{
|
|
Integer index = getFieldIndex( fieldName );
|
|
switch( index )
|
|
{
|
|
case Version.CURRENT_VERSION_INDEX:
|
|
this.current_version = ( Double ) value;
|
|
break;
|
|
case Version.ID_INDEX:
|
|
this.id = ( Integer ) value;
|
|
break;
|
|
case Version.MODULE_NAME_INDEX:
|
|
this.module_name = ( 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 Version.CURRENT_VERSION_INDEX:
|
|
theClass = Double.class;
|
|
break;
|
|
case Version.ID_INDEX:
|
|
theClass = Integer.class;
|
|
break;
|
|
case Version.MODULE_NAME_INDEX:
|
|
theClass = String.class;
|
|
break;
|
|
}
|
|
return theClass;
|
|
}
|
|
|
|
public Integer getFieldIndex( String fieldName )
|
|
{
|
|
Integer index = FIELD_INDEXES.get( fieldName );
|
|
return index != null ? index : Version._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, Version.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 );
|
|
}
|
|
}
|
|
}
|