#include "dbconn.h"
#include "error_handling.h"
#include "items.h"
#include "cache_list.h"
#include "context.h"

#include <string>
#include <utility>

#ifdef _DEBUG
#ifndef DEBUG_NEW
#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
#define new DEBUG_NEW
#endif
#endif

// indexes for items:
#define DB_INDEX_ITEMS__INSERT_IDITEM                        1
#define DB_INDEX_ITEMS__INSERT_PATTERN                       2
#define DB_INDEX_ITEMS__INSERT_WEIGHT                        3
#define DB_INDEX_ITEMS__INSERT_DAMAGE                        4
#define DB_INDEX_ITEMS__INSERT_WORKING                       5
#define DB_INDEX_ITEMS__INSERT_DAMAGED                       6
#define DB_INDEX_ITEMS__INSERT_D1                            7
#define DB_INDEX_ITEMS__INSERT_I1                            8
#define DB_INDEX_ITEMS__INSERT_I2                            9
#define DB_INDEX_ITEMS__INSERT_I3                           10
#define DB_INDEX_ITEMS__INSERT_I4                           11
#define DB_INDEX_ITEMS__INSERT_I5                           12
#define DB_INDEX_ITEMS__INSERT_I6                           13
#define DB_INDEX_ITEMS__INSERT_SHADOWDAMAGE                 14
#define DB_INDEX_ITEMS__INSERT_SHADOWDAMAGED                15
#define DB_INDEX_ITEMS__INSERT_I7                           16
#define DB_INDEX_ITEMS__INSERT_I8                           17
#define DB_INDEX_ITEMS__INSERT_I9                           18
#define DB_INDEX_ITEMS__INSERT_I10                          19
#define DB_INDEX_ITEMS__INSERT_I11                          20
#define DB_INDEX_ITEMS__INSERT_I12                          21
#define DB_INDEX_ITEMS__INSERT_I13                          22
#define DB_INDEX_ITEMS__INSERT_I14                          23
#define DB_INDEX_ITEMS__INSERT_D2                           24
#define DB_INDEX_ITEMS__INSERT_D3                           25
#define DB_INDEX_ITEMS__INSERT_D4                           26

#define DB_INDEX_ITEMS__SELECT_GET_IDITEM                    1
#define DB_INDEX_ITEMS__SELECT_GET_PATTERN                   2
#define DB_INDEX_ITEMS__SELECT_GET_WEIGHT                    3
#define DB_INDEX_ITEMS__SELECT_GET_DAMAGE                    4
#define DB_INDEX_ITEMS__SELECT_GET_WORKING                   5
#define DB_INDEX_ITEMS__SELECT_GET_DAMAGED                   6
#define DB_INDEX_ITEMS__SELECT_GET_D1                        7
#define DB_INDEX_ITEMS__SELECT_GET_I1                        8
#define DB_INDEX_ITEMS__SELECT_GET_I2                        9
#define DB_INDEX_ITEMS__SELECT_GET_I3                       10
#define DB_INDEX_ITEMS__SELECT_GET_I4                       11
#define DB_INDEX_ITEMS__SELECT_GET_I5                       12
#define DB_INDEX_ITEMS__SELECT_GET_I6                       13
#define DB_INDEX_ITEMS__SELECT_GET_SHADOWDAMAGE             14
#define DB_INDEX_ITEMS__SELECT_GET_SHADOWDAMAGED            15
#define DB_INDEX_ITEMS__SELECT_GET_I7                       16
#define DB_INDEX_ITEMS__SELECT_GET_I8                       17
#define DB_INDEX_ITEMS__SELECT_GET_I9                       18
#define DB_INDEX_ITEMS__SELECT_GET_I10                      19
#define DB_INDEX_ITEMS__SELECT_GET_I11                      20
#define DB_INDEX_ITEMS__SELECT_GET_I12                      21
#define DB_INDEX_ITEMS__SELECT_GET_I13                      22
#define DB_INDEX_ITEMS__SELECT_GET_I14                      23
#define DB_INDEX_ITEMS__SELECT_GET_D2                       24
#define DB_INDEX_ITEMS__SELECT_GET_D3                       25
#define DB_INDEX_ITEMS__SELECT_GET_D4                       26
#define DB_INDEX_ITEMS__SELECT_SET_IDITEM                    1

#define DB_INDEX_ITEMS__DELETE_IDITEM                        1

#define DB_INDEX_ITEMS__UPDATE_IDITEM                       26
#define DB_INDEX_ITEMS__UPDATE_PATTERN                       1
#define DB_INDEX_ITEMS__UPDATE_WEIGHT                        2
#define DB_INDEX_ITEMS__UPDATE_DAMAGE                        3
#define DB_INDEX_ITEMS__UPDATE_WORKING                       4
#define DB_INDEX_ITEMS__UPDATE_DAMAGED                       5
#define DB_INDEX_ITEMS__UPDATE_D1                            6
#define DB_INDEX_ITEMS__UPDATE_I1                            7
#define DB_INDEX_ITEMS__UPDATE_I2                            8
#define DB_INDEX_ITEMS__UPDATE_I3                            9
#define DB_INDEX_ITEMS__UPDATE_I4                           10
#define DB_INDEX_ITEMS__UPDATE_I5                           11
#define DB_INDEX_ITEMS__UPDATE_I6                           12
#define DB_INDEX_ITEMS__UPDATE_SHADOWDAMAGE                 13
#define DB_INDEX_ITEMS__UPDATE_SHADOWDAMAGED                14
#define DB_INDEX_ITEMS__UPDATE_I7                           15
#define DB_INDEX_ITEMS__UPDATE_I8                           16
#define DB_INDEX_ITEMS__UPDATE_I9                           17
#define DB_INDEX_ITEMS__UPDATE_I10                          18
#define DB_INDEX_ITEMS__UPDATE_I11                          19
#define DB_INDEX_ITEMS__UPDATE_I12                          20
#define DB_INDEX_ITEMS__UPDATE_I13                          21
#define DB_INDEX_ITEMS__UPDATE_I14                          22
#define DB_INDEX_ITEMS__UPDATE_D2                           23
#define DB_INDEX_ITEMS__UPDATE_D3                           24
#define DB_INDEX_ITEMS__UPDATE_D4                           25

// --------------------------------

#define DB_ITEMS_INITIALIZE_QUERY "SELECT IDITEM   FROM ITEMS ORDER BY IDITEM DESC"

#define DB_INDEX_ITEMS_INITIALIZE_IDITEM                            1


// --------------------------------

void cacheItemsListClass :: DB_Initialize()
{
    // priprav cache list a i nahraj data do indexu
    IBPP :: Database& db    = actx->db.getDatabase();
    IBPP :: Transaction& tr = actx->db.getTransaction();
    
    IBPP :: Statement s = IBPP :: StatementFactory(db, tr, DB_ITEMS_INITIALIZE_QUERY);

	try
	{
        s->Execute();

        // nacteme, jak velky potrebujeme ten list
        if (s->Fetch())
        {
            int64_t d;
            s->Get(DB_INDEX_ITEMS_INITIALIZE_IDITEM, d);
            expand((unsigned long)d + 1, identifiersReusable());       
        
            // postupne nacitame polozky
            do
            {
                int64_t itemId;
                s->Get(DB_INDEX_ITEMS_INITIALIZE_IDITEM,    itemId);

                // pote oznacime polozku v listu, ze je v databazi
                data[(unsigned long)itemId].first = DATA_IN_DATABASE_ONLY;
                freeIDs.erase((dtIdentifier)itemId);
            } while (s->Fetch());
        }

        s->Close();
	}
	catch (std :: bad_alloc e)
	{
		errExceptionError(e.what());
	}   
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void cacheItemsListClass :: DB_IternalLoadFromQuery( unsigned long ID )
{
	// nahraj data itemu 
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	try
	{
		dataListObjectClass* obj = NULL;

		int64_t pattern;
		s->Get(DB_INDEX_ITEMS__SELECT_GET_PATTERN, pattern);

		// rozlisime, ktery druh itemu nahrat, vytvorime ten objekt a nahrajeme ho
		switch (pattern)
		{
		case PATTERN_ID_ENERGETIC_ACCUMULATOR:            obj = new energeticAccumulatorClass();                   break;
		case PATTERN_ID_NAVIGATION_COMPUTER:              obj = new navigationComputerClass();                     break;
		case PATTERN_ID_QUARK_GLUON_CORE:                 obj = new quarkGluonCoreClass();                         break;
		case PATTERN_ID_SUBSPACE_BEACON:                  obj = new subspaceBeaconClass();                         break;
		case PATTERN_ID_INERTIAL_DAMPERS:                 obj = new inertialDampersClass();                        break;
		case PATTERN_ID_IMPULS_JET_ENGINE:                obj = new impulsJetEngineClass();                        break;
		case PATTERN_ID_MECHANICAL_DAMPERS:               obj = new mechanicalDampersClass();                      break;
		case PATTERN_ID_DEFLECTOR_SHIELDS:                obj = new deflectorShieldsGeneratorClass();              break;
		case PATTERN_ID_WEAPON_ENERGY_CIRCUIT:            obj = new weaponEnergyCircuitClass();                    break;
		case PATTERN_ID_DRONE_MISSILES:                   obj = new droneMissilesClass();                          break;
		case PATTERN_ID_DRONE_MISSILE_LAUNCHER:           obj = new droneMissileLauncherClass();                   break;
		case PATTERN_ID_LASER_GUN:                        obj = new laserGunClass();                               break;
		case PATTERN_ID_TRANSPORT_BEAM_GENERATOR:         obj = new transportBeamGeneratorClass();                 break;
		case PATTERN_ID_MAGNETICAL_COLLECTORS_OF_PLASMA:  obj = new magneticalCollectorsOfPlasmaClass();           break;
		case PATTERN_ID_SUBMERSIBLE_FILTRATION_TANK:      obj = new submersibleFiltrationTankClass();              break;
		case PATTERN_ID_SUBMARINE_MINING_MACHINE:         obj = new submarineMiningMachineClass();                 break;
		case PATTERN_ID_UNDERGROUND_DRILLIG_MACHINE:      obj = new undergroundDrillingMachineClass();             break;
		case PATTERN_ID_PROBE:                            obj = new probeClass();                                  break;
		case PATTERN_ID_HIGH_RESOLUTION_SENSORS:          obj = new highResolutionSensorsClass();                  break;
		case PATTERN_ID_LONG_RANGE_SENSORS:               obj = new longRangeSensorsClass();                       break;
		case PATTERN_ID_CLOAKING_DEVICE:                  obj = new cloakingDeviceClass();                         break;
		case PATTERN_ID_ANDROIDS:                         obj = new androidsClass();                               break;
		case PATTERN_ID_MAGNETICAL_GRID:                  obj = new magneticalGridClass();                         break;
		case PATTERN_ID_TRANSPORT_CONTAINER:              obj = new transportContainerClass();                     break;
		case PATTERN_ID_ENERGETIC_CELL:                   obj = new energeticCellClass();                          break;
		case PATTERN_ID_PLASMA_FILTER:                    obj = new plasmaFilterClass();                           break;
		case PATTERN_ID_SCIENTIFIC_LAB:                   obj = new scientificLabClass();                          break;
		case PATTERN_ID_LIFE_SUPPORT:                     obj = new lifeSupportClass();                            break;
		case PATTERN_ID_SUBSPACE_TRANSMITTER:             obj = new subspaceTransmitterClass();                    break;
		case PATTERN_ID_MAINFRAME:                        obj = new mainframeClass();                              break;
		case PATTERN_ID_HANGAR:                           obj = new hangarClass();                                 break;
		case PATTERN_ID_MAGNETICAL_FILTER:                obj = new magneticalFilterClass();                       break;
		case PATTERN_ID_DEUTERIUM_DECOMPOSER:             obj = new deuteriumDecomposerClass();                    break;
		case PATTERN_ID_ZIRCONIUM_REACTOR:                obj = new zirconiumReactorClass();                       break;
		case PATTERN_ID_ILMENITE_FURNACE:                 obj = new ilmeniteFurnaceClass();                        break;
		default:
			obj = NULL;
		}

		if (obj != NULL)
		{
			obj->DB_Load(ID);
			data[ID] = make_pair(DATA_SYNCHRONIZED, obj);
		}
		else
		{
			errLogicalError( "Bad item index in items table");
		}
	}
	catch (std :: bad_alloc e)
	{
		errExceptionError( e.what());
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void cacheItemsListClass :: DB_Load( unsigned long ID )
{
	// nahraj data itemu 
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	try
	{
		s->Set(DB_INDEX_ITEMS__SELECT_SET_IDITEM, (int64_t)ID);
		s->Execute();

		// jestli je to v databazi, nahraj to, jinak oznam chybu 
		if (s->Fetch()) 
		{
			DB_IternalLoadFromQuery(ID);
		} else
		{
			errExceptionError( "Item load failed - no record in DB");
		}
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void cacheItemsListClass :: DB_Remove( unsigned long ID )
{
	/* smaz vsechny uzly uzivatele */
	IBPP :: Statement& s = actx->db.getItemsQueryDELETE();	
	s->Set(DB_INDEX_ITEMS__DELETE_IDITEM, (int64_t)ID);
	try
	{
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void commonItemClass :: DB_Load(unsigned long ID)
{
	// predpokladame, ze dotaz je pripraveny pro cteni dat
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	setID(ID);

	// nacteme sva data
	int64_t data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_PATTERN,         data);             patternID_ = (dtIdentifier) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_WEIGHT,          data);             weight_    = (dtIdentifier) data;
}

// --------------------------------

void commonItemClass :: DB_Save(unsigned long ID)
{
	// predpokladame, ze dotaz je pripraveny pro zapis dat
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	setID(ID);

	// zapiseme sva data
	s->Set(DB_INDEX_ITEMS__UPDATE_IDITEM,         (int64_t) ID);            
	s->Set(DB_INDEX_ITEMS__UPDATE_PATTERN,        (int64_t) patternID_);           
	s->Set(DB_INDEX_ITEMS__UPDATE_WEIGHT,         (int64_t) weight_);             
}

// --------------------------------

void commonItemClass :: DB_Insert(unsigned long ID)
{
	// predpokladame, ze dotaz je pripraveny pro zapis dat
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	setID(ID);

	// zapiseme sva data
	s->Set(DB_INDEX_ITEMS__INSERT_IDITEM,         (int64_t) ID);            
	s->Set(DB_INDEX_ITEMS__INSERT_PATTERN,        (int64_t) patternID_);           
	s->Set(DB_INDEX_ITEMS__INSERT_WEIGHT,         (int64_t) weight_);   
}

// --------------------------------
// --------------------------------

void separateItemClass :: DB_Load(unsigned long ID)
{
	// predpokladame, ze dotaz je pripraveny pro cteni dat
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	// nacteme sva data
    s->Get(DB_INDEX_ITEMS__SELECT_GET_DAMAGE,          damage_);      
    s->Get(DB_INDEX_ITEMS__SELECT_GET_SHADOWDAMAGE,    shadowDamage_);

	// zavolame predka
	commonItemClass :: DB_Load(ID);
}

// --------------------------------

void separateItemClass :: DB_Save(unsigned long ID)
{
	// predpokladame, ze dotaz je pripraveny pro zapis dat
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	// zapiseme sva data
	s->Set(DB_INDEX_ITEMS__UPDATE_DAMAGE,          damage_); 
    s->Set(DB_INDEX_ITEMS__UPDATE_SHADOWDAMAGE,    shadowDamage_);
    s->SetNull(DB_INDEX_ITEMS__UPDATE_SHADOWDAMAGED);
	s->SetNull(DB_INDEX_ITEMS__UPDATE_DAMAGED);           
	s->SetNull(DB_INDEX_ITEMS__UPDATE_WORKING);  

	// zavolame predka 
	commonItemClass :: DB_Save(ID);
}

// --------------------------------

void separateItemClass :: DB_Insert(unsigned long ID)
{
	// predpokladame, ze dotaz je pripraveny pro zapis dat
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	// zapiseme sva data
	s->Set(DB_INDEX_ITEMS__INSERT_DAMAGE,         damage_); 
    s->Set(DB_INDEX_ITEMS__INSERT_SHADOWDAMAGE,    shadowDamage_);
    s->SetNull(DB_INDEX_ITEMS__INSERT_SHADOWDAMAGED);
	s->SetNull(DB_INDEX_ITEMS__INSERT_DAMAGED);           
	s->SetNull(DB_INDEX_ITEMS__INSERT_WORKING);  

	// zavolame predka 
	commonItemClass :: DB_Insert(ID); 
}

// --------------------------------

void stackableItemClass :: DB_Load(unsigned long ID)
{
	// predpokladame, ze dotaz je pripraveny pro cteni dat
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	// nacteme sva data
	int64_t data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_DAMAGED,          data);             damaged_         = (unsigned long long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_WORKING,          data);             working_         = (unsigned long long) data;
    s->Get(DB_INDEX_ITEMS__SELECT_GET_SHADOWDAMAGED,    data);             shadowDamaged_   = (unsigned long long) data; 

	// zavolame predka
	commonItemClass :: DB_Load(ID);
}

// --------------------------------

void stackableItemClass :: DB_Save(unsigned long ID)
{
	// predpokladame, ze dotaz je pripraveny pro zapis dat
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	// zapiseme sva data
	s->SetNull(DB_INDEX_ITEMS__UPDATE_DAMAGE); 
    s->SetNull(DB_INDEX_ITEMS__UPDATE_SHADOWDAMAGE);
	s->Set(DB_INDEX_ITEMS__UPDATE_DAMAGED,        (int64_t) damaged_);           
	s->Set(DB_INDEX_ITEMS__UPDATE_WORKING,        (int64_t) working_); 
    s->Set(DB_INDEX_ITEMS__UPDATE_SHADOWDAMAGED,  (int64_t) shadowDamaged_);

	// zavolame predka 
	commonItemClass :: DB_Save(ID);
}

// --------------------------------

void stackableItemClass :: DB_Insert(unsigned long ID)
{
	// predpokladame, ze dotaz je pripraveny pro zapis dat
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	// zapiseme sva data
	s->SetNull(DB_INDEX_ITEMS__INSERT_DAMAGE); 
    s->SetNull(DB_INDEX_ITEMS__INSERT_SHADOWDAMAGE);
	s->Set(DB_INDEX_ITEMS__INSERT_DAMAGED,        (int64_t) damaged_);           
	s->Set(DB_INDEX_ITEMS__INSERT_WORKING,        (int64_t) working_);  
    s->Set(DB_INDEX_ITEMS__INSERT_SHADOWDAMAGED,  (int64_t) shadowDamaged_);

	// zavolame predka 
	commonItemClass :: DB_Insert(ID); 
}

// --------------------------------

void energeticAccumulatorClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	int64_t data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I1, data);              accumulator_             =                 data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I2, data);              charging_                = (unsigned long) data;

	separateItemClass :: DB_Load(ID);
}

// --------------------------------

void energeticAccumulatorClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->Set(DB_INDEX_ITEMS__UPDATE_I1,          (int64_t)accumulator_);          
		s->Set(DB_INDEX_ITEMS__UPDATE_I2,          (int64_t)charging_);                      
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		separateItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void energeticAccumulatorClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->Set(DB_INDEX_ITEMS__INSERT_I1,          (int64_t)accumulator_);          
		s->Set(DB_INDEX_ITEMS__INSERT_I2,          (int64_t)charging_);                      
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		separateItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void navigationComputerClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	s->Get(DB_INDEX_ITEMS__SELECT_GET_D1, maxSpeedToC_);  

	separateItemClass :: DB_Load(ID);
}

// --------------------------------

void navigationComputerClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I1);          
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I2);            
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);
		s->Set(DB_INDEX_ITEMS__UPDATE_D1,      maxSpeedToC_);

		separateItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void navigationComputerClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__INSERT_I1);          
		s->SetNull(DB_INDEX_ITEMS__INSERT_I2);            
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);
		s->Set(DB_INDEX_ITEMS__INSERT_D1,      maxSpeedToC_);

		separateItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void quarkGluonCoreClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	int64_t data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I1, data);              consumption_             = (unsigned short) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_D1, maxSpeedToC_);             

	separateItemClass :: DB_Load(ID);
}

// --------------------------------

void quarkGluonCoreClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->Set(DB_INDEX_ITEMS__UPDATE_I1,          (int64_t)consumption_);                   
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I2);            
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);
		s->Set(DB_INDEX_ITEMS__UPDATE_D1,          maxSpeedToC_);

		separateItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void quarkGluonCoreClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->Set(DB_INDEX_ITEMS__INSERT_I1,          (int64_t)consumption_);                  
		s->SetNull(DB_INDEX_ITEMS__INSERT_I2);            
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);
		s->Set(DB_INDEX_ITEMS__INSERT_D1,          maxSpeedToC_);

		separateItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void subspaceBeaconClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	s->Get(DB_INDEX_ITEMS__SELECT_GET_D1, maxSpeedToC_);  

	separateItemClass :: DB_Load(ID);
}

// --------------------------------

void subspaceBeaconClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I1);          
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I2);            
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);
		s->Set(DB_INDEX_ITEMS__UPDATE_D1,      maxSpeedToC_);

		separateItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void subspaceBeaconClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__INSERT_I1);          
		s->SetNull(DB_INDEX_ITEMS__INSERT_I2);            
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);
		s->Set(DB_INDEX_ITEMS__INSERT_D1,      maxSpeedToC_);

		separateItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void inertialDampersClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	s->Get(DB_INDEX_ITEMS__SELECT_GET_D1, maxSpeedToC_);  

	separateItemClass :: DB_Load(ID);
}

// --------------------------------

void inertialDampersClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I1);          
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I2);            
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);
		s->Set(DB_INDEX_ITEMS__UPDATE_D1,      maxSpeedToC_);

		separateItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void inertialDampersClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__INSERT_I1);          
		s->SetNull(DB_INDEX_ITEMS__INSERT_I2);            
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);
		s->Set(DB_INDEX_ITEMS__INSERT_D1,      maxSpeedToC_);

		separateItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void impulsJetEngineClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	int64_t data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I1, data);              consumption_             = (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I2, data);              force_                   = (unsigned long) data;

	separateItemClass :: DB_Load(ID);
}

// --------------------------------

void impulsJetEngineClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->Set(DB_INDEX_ITEMS__UPDATE_I1,          (int64_t)consumption_);          
		s->Set(DB_INDEX_ITEMS__UPDATE_I2,          (int64_t)force_);                      
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		separateItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void impulsJetEngineClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->Set(DB_INDEX_ITEMS__INSERT_I1,          (int64_t)consumption_);          
		s->Set(DB_INDEX_ITEMS__INSERT_I2,          (int64_t)force_);                       
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		separateItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void mechanicalDampersClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	int64_t data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I1, data);              maxAcceleration_         = (unsigned short) data;

	separateItemClass :: DB_Load(ID);
}

// --------------------------------

void mechanicalDampersClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->Set(DB_INDEX_ITEMS__UPDATE_I1,          (int64_t)maxAcceleration_);                 
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I2);            
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		separateItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void mechanicalDampersClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->Set(DB_INDEX_ITEMS__INSERT_I1,          (int64_t)maxAcceleration_);                    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I2);            
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		separateItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void deflectorShieldsGeneratorClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	int64_t data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I1, data);              solidity_         =  (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I2, data);              accumulator_      =  (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I3, data);              charging_         =  (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I4, data);              leak_             =  (unsigned long) data;

	separateItemClass :: DB_Load(ID);
}

// --------------------------------

void deflectorShieldsGeneratorClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->Set(DB_INDEX_ITEMS__UPDATE_I1,          (int64_t)solidity_);          
		s->Set(DB_INDEX_ITEMS__UPDATE_I2,          (int64_t)accumulator_ );            
		s->Set(DB_INDEX_ITEMS__UPDATE_I3,          (int64_t)charging_);    
		s->Set(DB_INDEX_ITEMS__UPDATE_I4,          (int64_t)leak_);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		separateItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void deflectorShieldsGeneratorClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->Set(DB_INDEX_ITEMS__INSERT_I1,          (int64_t)solidity_);          
		s->Set(DB_INDEX_ITEMS__INSERT_I2,          (int64_t)accumulator_ );            
		s->Set(DB_INDEX_ITEMS__INSERT_I3,          (int64_t)charging_);    
		s->Set(DB_INDEX_ITEMS__INSERT_I4,          (int64_t)leak_);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		separateItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void weaponEnergyCircuitClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	int64_t data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I1, data);              charging_         =  (unsigned long) data;

	separateItemClass :: DB_Load(ID);
}

// --------------------------------

void weaponEnergyCircuitClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->Set(DB_INDEX_ITEMS__UPDATE_I1,          (int64_t)charging_);                
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I2);            
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		separateItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void weaponEnergyCircuitClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->Set(DB_INDEX_ITEMS__INSERT_I1,          (int64_t)charging_);                  
		s->SetNull(DB_INDEX_ITEMS__INSERT_I2);            
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		separateItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void droneMissileLauncherClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	int64_t data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I1, data);              accumulator_             = (unsigned long) data;
    s->Get(DB_INDEX_ITEMS__SELECT_GET_I2, data);              charging_                = (unsigned long) data;

	separateItemClass :: DB_Load(ID);
}

// --------------------------------

void droneMissileLauncherClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->Set(DB_INDEX_ITEMS__UPDATE_I1,          (int64_t)accumulator_);          
		s->Set(DB_INDEX_ITEMS__UPDATE_I2,          (int64_t)charging_);                          
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		separateItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void droneMissileLauncherClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->Set(DB_INDEX_ITEMS__INSERT_I1,          (int64_t)accumulator_);          
		s->Set(DB_INDEX_ITEMS__INSERT_I2,          (int64_t)charging_);                        
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		separateItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void droneMissilesClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	stackableItemClass :: DB_Load(ID);
}

// --------------------------------

void droneMissilesClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I1);          
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I2);            
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		stackableItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void droneMissilesClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__INSERT_I1);          
		s->SetNull(DB_INDEX_ITEMS__INSERT_I2);            
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		stackableItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void laserGunClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	int64_t data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I1, data);              accumulator_         = (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I2, data);              range_               = (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I3, data);              precision_           = (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I4, data);              forcibility_         = (unsigned long) data;
    s->Get(DB_INDEX_ITEMS__SELECT_GET_I5, data);              charging_            = (unsigned long) data;

	separateItemClass :: DB_Load(ID);
}

// --------------------------------

void laserGunClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->Set(DB_INDEX_ITEMS__UPDATE_I1,          (int64_t)accumulator_);                    
		s->Set(DB_INDEX_ITEMS__UPDATE_I2,          (int64_t)range_);    
		s->Set(DB_INDEX_ITEMS__UPDATE_I3,          (int64_t)precision_);
		s->Set(DB_INDEX_ITEMS__UPDATE_I4,          (int64_t)forcibility_);
		s->Set(DB_INDEX_ITEMS__UPDATE_I5,          (int64_t)charging_);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		separateItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void laserGunClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->Set(DB_INDEX_ITEMS__INSERT_I1,          (int64_t)accumulator_);                     
		s->Set(DB_INDEX_ITEMS__INSERT_I2,          (int64_t)range_);    
		s->Set(DB_INDEX_ITEMS__INSERT_I3,          (int64_t)precision_);
		s->Set(DB_INDEX_ITEMS__INSERT_I4,          (int64_t)forcibility_);
		s->Set(DB_INDEX_ITEMS__INSERT_I5,          (int64_t)charging_);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		separateItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void transportBeamGeneratorClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	int64_t data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I1, data);              accumulator_         = (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I2, data);              charging_            = (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I3, data);              range_               = (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I4, data);              precision_           = (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I5, data);              forcibility_         = (unsigned long) data;

	separateItemClass :: DB_Load(ID);
}

// --------------------------------

void transportBeamGeneratorClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->Set(DB_INDEX_ITEMS__UPDATE_I1,          (int64_t)accumulator_);          
		s->Set(DB_INDEX_ITEMS__UPDATE_I2,          (int64_t)charging_ );            
		s->Set(DB_INDEX_ITEMS__UPDATE_I3,          (int64_t)range_);    
		s->Set(DB_INDEX_ITEMS__UPDATE_I4,          (int64_t)precision_);
		s->Set(DB_INDEX_ITEMS__UPDATE_I5,          (int64_t)forcibility_);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		separateItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void transportBeamGeneratorClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->Set(DB_INDEX_ITEMS__INSERT_I1,          (int64_t)accumulator_);          
		s->Set(DB_INDEX_ITEMS__INSERT_I2,          (int64_t)charging_ );            
		s->Set(DB_INDEX_ITEMS__INSERT_I3,          (int64_t)range_);    
		s->Set(DB_INDEX_ITEMS__INSERT_I4,          (int64_t)precision_);
		s->Set(DB_INDEX_ITEMS__INSERT_I5,          (int64_t)forcibility_);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		separateItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void magneticalCollectorsOfPlasmaClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	stackableItemClass :: DB_Load(ID);
}

// --------------------------------

void magneticalCollectorsOfPlasmaClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I1);          
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I2);            
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		stackableItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void magneticalCollectorsOfPlasmaClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__INSERT_I1);          
		s->SetNull(DB_INDEX_ITEMS__INSERT_I2);            
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		stackableItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void submersibleFiltrationTankClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	stackableItemClass :: DB_Load(ID);
}

// --------------------------------

void submersibleFiltrationTankClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I1);          
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I2);            
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		stackableItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void submersibleFiltrationTankClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__INSERT_I1);          
		s->SetNull(DB_INDEX_ITEMS__INSERT_I2);            
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		stackableItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void submarineMiningMachineClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	stackableItemClass :: DB_Load(ID);
}

// --------------------------------

void submarineMiningMachineClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I1);          
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I2);            
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		stackableItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void submarineMiningMachineClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__INSERT_I1);          
		s->SetNull(DB_INDEX_ITEMS__INSERT_I2);            
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		stackableItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void undergroundDrillingMachineClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	stackableItemClass :: DB_Load(ID);
}

// --------------------------------

void undergroundDrillingMachineClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I1);          
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I2);            
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		stackableItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void undergroundDrillingMachineClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__INSERT_I1);          
		s->SetNull(DB_INDEX_ITEMS__INSERT_I2);            
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		stackableItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void probeClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	int64_t data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I1, data);              level_         = (unsigned long) data;

	separateItemClass :: DB_Load(ID);
}

// --------------------------------

void probeClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->Set(DB_INDEX_ITEMS__UPDATE_I1,          (int64_t)level_);                  
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I2);            
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		separateItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void probeClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->Set(DB_INDEX_ITEMS__INSERT_I1,          (int64_t)level_);                    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I2);            
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		separateItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void highResolutionSensorsClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	int64_t data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I1, data);              range_             = (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I2, data);              level_             = (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I3, data);              consumption_       = (unsigned long) data;

	separateItemClass :: DB_Load(ID);
}

// --------------------------------

void highResolutionSensorsClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->Set(DB_INDEX_ITEMS__UPDATE_I1,          (int64_t)range_);          
		s->Set(DB_INDEX_ITEMS__UPDATE_I2,          (int64_t)level_);            
		s->Set(DB_INDEX_ITEMS__UPDATE_I3,          (int64_t)consumption_);        
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		separateItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void highResolutionSensorsClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->Set(DB_INDEX_ITEMS__INSERT_I1,          (int64_t)range_);          
		s->Set(DB_INDEX_ITEMS__INSERT_I2,          (int64_t)level_);            
		s->Set(DB_INDEX_ITEMS__INSERT_I3,          (int64_t)consumption_);       
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		separateItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void longRangeSensorsClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	int64_t data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I1, data);              range_             = (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I2, data);              level_             = (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I3, data);              consumption_       = (unsigned long) data;

	separateItemClass :: DB_Load(ID);
}

// --------------------------------

void longRangeSensorsClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->Set(DB_INDEX_ITEMS__UPDATE_I1,          (int64_t)range_);          
		s->Set(DB_INDEX_ITEMS__UPDATE_I2,          (int64_t)level_);            
		s->Set(DB_INDEX_ITEMS__UPDATE_I3,          (int64_t)consumption_);        
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		separateItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void longRangeSensorsClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->Set(DB_INDEX_ITEMS__INSERT_I1,          (int64_t)range_);          
		s->Set(DB_INDEX_ITEMS__INSERT_I2,          (int64_t)level_);            
		s->Set(DB_INDEX_ITEMS__INSERT_I3,          (int64_t)consumption_);     
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		separateItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void cloakingDeviceClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	int64_t data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I1, data);              level_             = (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I2, data);              consumption_       = (unsigned long) data;

	separateItemClass :: DB_Load(ID);
}

// --------------------------------

void cloakingDeviceClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->Set(DB_INDEX_ITEMS__UPDATE_I1,          (int64_t)level_);          
		s->Set(DB_INDEX_ITEMS__UPDATE_I2,          (int64_t)consumption_);                       
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		separateItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void cloakingDeviceClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->Set(DB_INDEX_ITEMS__INSERT_I1,          (int64_t)level_);          
		s->Set(DB_INDEX_ITEMS__INSERT_I2,          (int64_t)consumption_);                        
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		separateItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void androidsClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	stackableItemClass :: DB_Load(ID);
}

// --------------------------------

void androidsClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I1);          
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I2);            
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		stackableItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void androidsClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__INSERT_I1);          
		s->SetNull(DB_INDEX_ITEMS__INSERT_I2);            
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		stackableItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}


// --------------------------------
// --------------------------------

void magneticalGridClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	stackableItemClass :: DB_Load(ID);
}

// --------------------------------

void magneticalGridClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I1);          
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I2);            
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		stackableItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void magneticalGridClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__INSERT_I1);          
		s->SetNull(DB_INDEX_ITEMS__INSERT_I2);            
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		stackableItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void transportContainerClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	stackableItemClass :: DB_Load(ID);
}

// --------------------------------

void transportContainerClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I1);          
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I2);            
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		stackableItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void transportContainerClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__INSERT_I1);          
		s->SetNull(DB_INDEX_ITEMS__INSERT_I2);            
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		stackableItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void energeticCellClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	stackableItemClass :: DB_Load(ID);
}

// --------------------------------

void energeticCellClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I1);          
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I2);            
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		stackableItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void energeticCellClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__INSERT_I1);          
		s->SetNull(DB_INDEX_ITEMS__INSERT_I2);            
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		stackableItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void plasmaFilterClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	separateItemClass :: DB_Load(ID);
}

// --------------------------------

void plasmaFilterClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I1);          
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I2);            
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		separateItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void plasmaFilterClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__INSERT_I1);          
		s->SetNull(DB_INDEX_ITEMS__INSERT_I2);            
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		separateItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void scientificLabClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	int64_t data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I1, data);              level_             = (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I2, data);              capacity_          = (unsigned long) data;

	separateItemClass :: DB_Load(ID);
}

// --------------------------------

void scientificLabClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->Set(DB_INDEX_ITEMS__UPDATE_I1,          (int64_t)level_);          
		s->Set(DB_INDEX_ITEMS__UPDATE_I2,          (int64_t)capacity_);                       
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		separateItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void scientificLabClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->Set(DB_INDEX_ITEMS__INSERT_I1,          (int64_t)level_);          
		s->Set(DB_INDEX_ITEMS__INSERT_I2,          (int64_t)capacity_);                       
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		separateItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void lifeSupportClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	int64_t data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I1, data);              capacity_             = (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I2, data);              consumption_          = (unsigned long) data;

	separateItemClass :: DB_Load(ID);
}

// --------------------------------

void lifeSupportClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->Set(DB_INDEX_ITEMS__UPDATE_I1,          (int64_t)capacity_);          
		s->Set(DB_INDEX_ITEMS__UPDATE_I2,          (int64_t)consumption_);                      
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		separateItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void lifeSupportClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->Set(DB_INDEX_ITEMS__INSERT_I1,          (int64_t)capacity_);          
		s->Set(DB_INDEX_ITEMS__INSERT_I2,          (int64_t)consumption_);                       
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		separateItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void subspaceTransmitterClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	int64_t data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I1, data);              messageCost_           = (unsigned long) data;

	separateItemClass :: DB_Load(ID);
}

// --------------------------------

void subspaceTransmitterClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->Set(DB_INDEX_ITEMS__UPDATE_I1,          (int64_t)messageCost_);                  
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I2);            
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		separateItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void subspaceTransmitterClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->Set(DB_INDEX_ITEMS__INSERT_I1,          (int64_t)messageCost_);                   
		s->SetNull(DB_INDEX_ITEMS__INSERT_I2);            
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		separateItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void mainframeClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	int64_t data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I1, data);              bioNodes_            = (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I2, data);              prediction_          = (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I3, data);              timeReusability_     = (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I4, data);              consumption_         = (unsigned long) data;

	separateItemClass :: DB_Load(ID);
}

// --------------------------------

void mainframeClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->Set(DB_INDEX_ITEMS__UPDATE_I1,          (int64_t)bioNodes_);          
		s->Set(DB_INDEX_ITEMS__UPDATE_I2,          (int64_t)prediction_);            
		s->Set(DB_INDEX_ITEMS__UPDATE_I3,          (int64_t)timeReusability_);    
		s->Set(DB_INDEX_ITEMS__UPDATE_I4,          (int64_t)consumption_);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		separateItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void mainframeClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->Set(DB_INDEX_ITEMS__INSERT_I1,          (int64_t)bioNodes_);          
		s->Set(DB_INDEX_ITEMS__INSERT_I2,          (int64_t)prediction_);            
		s->Set(DB_INDEX_ITEMS__INSERT_I3,          (int64_t)timeReusability_);    
		s->Set(DB_INDEX_ITEMS__INSERT_I4,          (int64_t)consumption_);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		separateItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void hangarClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	int64_t data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I1, data);              level_                        = (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I2, data);              length_                       = (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I3, data);              width_                        = (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I4, data);              height_                       = (unsigned long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I5, data);              dockingShipID_                = (dtIdentifier) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I6, data);              newShipClassID_               = (dtIdentifier) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I7, data);              newItemPatternID_             = (dtIdentifier) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I8, data);              pointsConstructed_            = (unsigned long long) data;
	s->Get(DB_INDEX_ITEMS__SELECT_GET_I9, data);              newItemDimensions_.weight_    = (unsigned long long) data;
    s->Get(DB_INDEX_ITEMS__SELECT_GET_I10, data);             newItemsCount_                = (unsigned long) data;
    s->Get(DB_INDEX_ITEMS__SELECT_GET_I11, data);             mainframeForBaseID_           = (dtIdentifier) data;
    s->Get(DB_INDEX_ITEMS__SELECT_GET_D2, newItemDimensions_.length_); 
    s->Get(DB_INDEX_ITEMS__SELECT_GET_D3, newItemDimensions_.height_);             
    s->Get(DB_INDEX_ITEMS__SELECT_GET_D4, newItemDimensions_.width_);          

	separateItemClass :: DB_Load(ID);
}

// --------------------------------

void hangarClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->Set(DB_INDEX_ITEMS__UPDATE_I1,           (int64_t)level_);          
		s->Set(DB_INDEX_ITEMS__UPDATE_I2,           (int64_t)length_);            
		s->Set(DB_INDEX_ITEMS__UPDATE_I3,           (int64_t)width_);    
		s->Set(DB_INDEX_ITEMS__UPDATE_I4,           (int64_t)height_);
	    s->Set(DB_INDEX_ITEMS__UPDATE_I5,           (int64_t)dockingShipID_);                            
	    s->Set(DB_INDEX_ITEMS__UPDATE_I6,           (int64_t)newShipClassID_);                            
	    s->Set(DB_INDEX_ITEMS__UPDATE_I7,           (int64_t)newItemPatternID_);                           
	    s->Set(DB_INDEX_ITEMS__UPDATE_I8,           (int64_t)pointsConstructed_);                        
	    s->Set(DB_INDEX_ITEMS__UPDATE_I9,           (int64_t)newItemDimensions_.weight_ );                 
        s->Set(DB_INDEX_ITEMS__UPDATE_I10,          (int64_t)newItemsCount_);                         
        s->Set(DB_INDEX_ITEMS__UPDATE_I11,          (int64_t)mainframeForBaseID_);                  
        s->Set(DB_INDEX_ITEMS__UPDATE_D2,           newItemDimensions_.length_); 
        s->Set(DB_INDEX_ITEMS__UPDATE_D3,           newItemDimensions_.height_);             
        s->Set(DB_INDEX_ITEMS__UPDATE_D4,           newItemDimensions_.width_);  

        s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);                       
        s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);                        
        s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);                         
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);

		separateItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void hangarClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->Set(DB_INDEX_ITEMS__INSERT_I1,           (int64_t)level_);          
		s->Set(DB_INDEX_ITEMS__INSERT_I2,           (int64_t)length_);            
		s->Set(DB_INDEX_ITEMS__INSERT_I3,           (int64_t)width_);    
		s->Set(DB_INDEX_ITEMS__INSERT_I4,           (int64_t)height_);
	    s->Set(DB_INDEX_ITEMS__INSERT_I5,           (int64_t)dockingShipID_);                            
	    s->Set(DB_INDEX_ITEMS__INSERT_I6,           (int64_t)newShipClassID_);                            
	    s->Set(DB_INDEX_ITEMS__INSERT_I7,           (int64_t)newItemPatternID_);                           
	    s->Set(DB_INDEX_ITEMS__INSERT_I8,           (int64_t)pointsConstructed_);                        
	    s->Set(DB_INDEX_ITEMS__INSERT_I9,           (int64_t)newItemDimensions_.weight_ );                 
        s->Set(DB_INDEX_ITEMS__INSERT_I10,          (int64_t)newItemsCount_);                         
        s->Set(DB_INDEX_ITEMS__INSERT_I11,          (int64_t)mainframeForBaseID_);                  
        s->Set(DB_INDEX_ITEMS__INSERT_D2,           newItemDimensions_.length_); 
        s->Set(DB_INDEX_ITEMS__INSERT_D3,           newItemDimensions_.height_);             
        s->Set(DB_INDEX_ITEMS__INSERT_D4,           newItemDimensions_.width_);  

        s->SetNull(DB_INDEX_ITEMS__INSERT_I12);                       
        s->SetNull(DB_INDEX_ITEMS__INSERT_I13);                        
        s->SetNull(DB_INDEX_ITEMS__INSERT_I14);                         
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);

		separateItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void magneticalFilterClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	stackableItemClass :: DB_Load(ID);
}

// --------------------------------

void magneticalFilterClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I1);          
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I2);            
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		stackableItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void magneticalFilterClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__INSERT_I1);          
		s->SetNull(DB_INDEX_ITEMS__INSERT_I2);            
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		stackableItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void deuteriumDecomposerClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	stackableItemClass :: DB_Load(ID);
}

// --------------------------------

void deuteriumDecomposerClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I1);          
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I2);            
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		stackableItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void deuteriumDecomposerClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__INSERT_I1);          
		s->SetNull(DB_INDEX_ITEMS__INSERT_I2);            
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		stackableItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void zirconiumReactorClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	stackableItemClass :: DB_Load(ID);
}

// --------------------------------

void zirconiumReactorClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I1);          
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I2);            
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		stackableItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void zirconiumReactorClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__INSERT_I1);          
		s->SetNull(DB_INDEX_ITEMS__INSERT_I2);            
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		stackableItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------
// --------------------------------

void ilmeniteFurnaceClass :: DB_Load( unsigned long ID )
{
	/* nahraj data do patternu */
	IBPP :: Statement& s = actx->db.getItemsQuerySELECT();

	stackableItemClass :: DB_Load(ID);
}

// --------------------------------

void ilmeniteFurnaceClass :: DB_Save(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryUPDATE();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I1);          
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I2);            
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I3);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I4);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I5);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I6);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I7);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I8);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I9);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I10);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I11);    
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I12);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I13);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_I14);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D1);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D2);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D3);
		s->SetNull(DB_INDEX_ITEMS__UPDATE_D4);

		stackableItemClass :: DB_Save(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------

void ilmeniteFurnaceClass :: DB_Insert(unsigned long ID)
{
	/* uloz data uzlu */
	IBPP :: Statement& s = actx->db.getItemsQueryINSERT();

	try
	{
		s->SetNull(DB_INDEX_ITEMS__INSERT_I1);          
		s->SetNull(DB_INDEX_ITEMS__INSERT_I2);            
		s->SetNull(DB_INDEX_ITEMS__INSERT_I3);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I4);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I5);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I6);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I7);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I8);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I9);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I10);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I11);    
		s->SetNull(DB_INDEX_ITEMS__INSERT_I12);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I13);
		s->SetNull(DB_INDEX_ITEMS__INSERT_I14);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D1);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D2);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D3);
		s->SetNull(DB_INDEX_ITEMS__INSERT_D4);

		stackableItemClass :: DB_Insert(ID);
	
		s->Execute();
	}
	catch (IBPP :: Exception& e)
	{
		errExceptionError( e.what());
	}
}

// --------------------------------