PARTONS  
PARtonic Tomography Of Nucleon Software
Static Public Member Functions | Static Public Attributes | List of all members
PARTONS::Database Class Reference

Basic object storing database information. More...

Static Public Member Functions

static int getNumberOfRows (const QSqlQuery &query)
 If position in given query is set to the last record, return number of records and set position to -1. More...
 
static int execSelectQuery (QSqlQuery &query)
 Execute SQL SELECT-like query. More...
 
static std::string getLastExecutedQuery (const QSqlQuery &query)
 Get the last executed query. More...
 
static bool checkUniqueResult (const std::string &className, const std::string &funcName, const unsigned int resultSize, const QSqlQuery &query)
 Check if the result of given query contains only one record. More...
 
static bool checkManyResults (const std::string &className, const std::string &funcName, const unsigned int resultSize, const QSqlQuery &query)
 Check if the result of given query contains any record. More...
 
static std::string getPreFormatedColumnNamesFromVector (const std::vector< std::string > &columnNames)
 Get pre-formated string containing column names. More...
 
static std::string getPreFormatedColumnValuesFromVector (const std::vector< std::string > &columnValues)
 Get pre-formated string containing column values. More...
 

Static Public Attributes

static const std::string TABLE_NAME_COMPUTATION = "computation"
 
static const std::string COLUMN_NAME_COMPUTATION_ID = "computation_id"
 
static const std::string COLUMN_NAME_COMPUTATION_MODULE_NAME
 
static const std::string TABLE_NAME_SCENARIO = "scenario"
 
static const std::string COLUMN_NAME_SCENARIO_ID = "scenario_id"
 
static const std::string COLUMN_NAME_SCENARIO_STORE_DATE
 
static const std::string COLUMN_NAME_SCENARIO_DESCRIPTION
 
static const std::string COLUMN_NAME_SCENARIO_XML_FILE = "scenario_xml_file"
 
static const std::string COLUMN_NAME_SCENARIO_HASH_SUM = "scenario_hash_sum"
 
static const std::string TABLE_NAME_ENVIRONMENT_CONFIGURATION
 
static const std::string COLUMN_NAME_ENVIRONMENT_CONFIGURATION_ID
 
static const std::string COLUMN_NAME_ENVIRONMENT_CONFIGURATION_STORE_DATE
 
static const std::string COLUMN_NAME_ENVIRONMENT_CONFIGURATION_CONFIGURATION
 
static const std::string COLUMN_NAME_ENVIRONMENT_CONFIGURATION_HASH_SUM
 
static const std::string TABLE_NAME_GPD_KINEMATIC = "gpd_kinematic"
 
static const std::string COLUMN_NAME_GPD_KINEMATIC_ID = "gpd_kinematic_id"
 
static const std::string TABLE_NAME_GPD_RESULT = "gpd_result"
 
static const std::string COLUMN_NAME_GPD_RESULT_ID = "gpd_result_id"
 
static const std::string TABLE_NAME_COLLINEAR_DISTRIBUTION_KINEMATIC = "collinear_distribution_kinematic"
 
static const std::string COLUMN_NAME_COLLINEAR_DISTRIBUTION_KINEMATIC_ID = "collinear_distribution_kinematic_id"
 
static const std::string TABLE_NAME_COLLINEAR_DISTRIBUTION_RESULT = "collinear_distribution_result"
 
static const std::string COLUMN_NAME_COLLINEAR_DISTRIBUTION_RESULT_ID = "collinear_distribution_result_id"
 
static const std::string COLUMN_NAME_PARTON_DISTRIBUTION_ID
 
static const std::string TABLE_NAME_OBSERVABLE_KINEMATIC
 
static const std::string COLUMN_NAME_OBSERVABLE_KINEMATIC_ID
 
static const std::string TABLE_NAME_OBSERVABLE_RESULT = "observable_result"
 
static const std::string COLUMN_NAME_OBSERVABLE_RESULT_ID
 
static const std::string COLUMN_NAME_OBSERVABLE_NAME = "observable_name"
 
static const std::string COLUMN_NAME_OBSERVABLE_VALUE = "observable_value"
 
static const std::string COLUMN_NAME_GPD_TYPE_ID = "gpd_type_id"
 
static const std::string COLUMN_NAME_COLLINEAR_DISTRIBUTION_TYPE_ID = "collinear_distribution_type_id"
 
static const std::string COLUMN_NAME_GLUON_DISTRIBUTION
 
static const std::string COLUMN_NAME_QUARK_FLAVOR_ID = "quark_flavor_id"
 
static const std::string COLUMN_NAME_QUARK_DISTRIBUTION
 
static const std::string COLUMN_NAME_QUARK_DISTRIBUTION_PLUS
 
static const std::string COLUMN_NAME_QUARK_DISTRIBUTION_MINUS
 
static const std::string TABLE_NAME_CCF_KINEMATIC = "ccf_kinematic"
 
static const std::string COLUMN_NAME_CCF_KINEMATIC_ID = "ccf_kinematic_id"
 
static const std::string TABLE_NAME_CCF_RESULT = "ccf_result"
 
static const std::string COLUMN_NAME_CCF_RESULT_ID = "ccf_result_id"
 

Detailed Description

Basic object storing database information.

It stores names of tables and columns used in all kinds of database queries. In addition, it provides a set of useful tools for handling the queries.

Member Function Documentation

◆ checkManyResults()

bool PARTONS::Database::checkManyResults ( const std::string &  className,
const std::string &  funcName,
const unsigned int  resultSize,
const QSqlQuery &  query 
)
static

Check if the result of given query contains any record.

Parameters
classNameName of class to be used in eventual exception.
funcNameName of function to be used in eventual exception.
resultSizeNumber of records returned by given query.
queryInput QSqlQuery query.

◆ checkUniqueResult()

bool PARTONS::Database::checkUniqueResult ( const std::string &  className,
const std::string &  funcName,
const unsigned int  resultSize,
const QSqlQuery &  query 
)
static

Check if the result of given query contains only one record.

If 0 or 1 result returns false or true, respectively, if >1 throw exception.

Parameters
classNameName of class to be used in eventual exception.
funcNameName of function to be used in eventual exception.
resultSizeNumber of records returned by given query.
queryInput QSqlQuery query.

◆ execSelectQuery()

int PARTONS::Database::execSelectQuery ( QSqlQuery &  query)
static

Execute SQL SELECT-like query.

Parameters
queryInput QSqlQuery query.
Returns
Number of selected records.

◆ getLastExecutedQuery()

std::string PARTONS::Database::getLastExecutedQuery ( const QSqlQuery &  query)
static

Get the last executed query.

Parameters
queryInput QSqlQuery query.
Returns
String containing the last executed SQL query.

◆ getNumberOfRows()

int PARTONS::Database::getNumberOfRows ( const QSqlQuery &  query)
static

If position in given query is set to the last record, return number of records and set position to -1.

Otherwise, return 0.

Parameters
queryInput QSqlQuery query.
Returns
Number of records or 0 if position in query is not set to the last record.

◆ getPreFormatedColumnNamesFromVector()

std::string PARTONS::Database::getPreFormatedColumnNamesFromVector ( const std::vector< std::string > &  columnNames)
static

Get pre-formated string containing column names.

Parameters
columnNamesVector containing column names.
Returns
Pre-formated string containing columns names as "(name1,name2,...)"

◆ getPreFormatedColumnValuesFromVector()

std::string PARTONS::Database::getPreFormatedColumnValuesFromVector ( const std::vector< std::string > &  columnValues)
static

Get pre-formated string containing column values.

Parameters
columnValuesVector containing column values.
Returns
Pre-formated string containing columns values as "VALUES (value1,value2,...)"

Member Data Documentation

◆ COLUMN_NAME_CCF_KINEMATIC_ID

const std::string PARTONS::Database::COLUMN_NAME_CCF_KINEMATIC_ID = "ccf_kinematic_id"
static

◆ COLUMN_NAME_CCF_RESULT_ID

const std::string PARTONS::Database::COLUMN_NAME_CCF_RESULT_ID = "ccf_result_id"
static

◆ COLUMN_NAME_COLLINEAR_DISTRIBUTION_KINEMATIC_ID

const std::string PARTONS::Database::COLUMN_NAME_COLLINEAR_DISTRIBUTION_KINEMATIC_ID = "collinear_distribution_kinematic_id"
static

◆ COLUMN_NAME_COLLINEAR_DISTRIBUTION_RESULT_ID

const std::string PARTONS::Database::COLUMN_NAME_COLLINEAR_DISTRIBUTION_RESULT_ID = "collinear_distribution_result_id"
static

◆ COLUMN_NAME_COLLINEAR_DISTRIBUTION_TYPE_ID

const std::string PARTONS::Database::COLUMN_NAME_COLLINEAR_DISTRIBUTION_TYPE_ID = "collinear_distribution_type_id"
static

◆ COLUMN_NAME_COMPUTATION_ID

const std::string PARTONS::Database::COLUMN_NAME_COMPUTATION_ID = "computation_id"
static

◆ COLUMN_NAME_COMPUTATION_MODULE_NAME

const std::string PARTONS::Database::COLUMN_NAME_COMPUTATION_MODULE_NAME
static
Initial value:
=
"computation_module_name"

◆ COLUMN_NAME_ENVIRONMENT_CONFIGURATION_CONFIGURATION

const std::string PARTONS::Database::COLUMN_NAME_ENVIRONMENT_CONFIGURATION_CONFIGURATION
static
Initial value:
=
"env_conf_configuration"

◆ COLUMN_NAME_ENVIRONMENT_CONFIGURATION_HASH_SUM

const std::string PARTONS::Database::COLUMN_NAME_ENVIRONMENT_CONFIGURATION_HASH_SUM
static
Initial value:
=
"env_conf_hash_sum"

◆ COLUMN_NAME_ENVIRONMENT_CONFIGURATION_ID

const std::string PARTONS::Database::COLUMN_NAME_ENVIRONMENT_CONFIGURATION_ID
static
Initial value:
=
"env_conf_id"

◆ COLUMN_NAME_ENVIRONMENT_CONFIGURATION_STORE_DATE

const std::string PARTONS::Database::COLUMN_NAME_ENVIRONMENT_CONFIGURATION_STORE_DATE
static
Initial value:
=
"env_conf_store_date"

◆ COLUMN_NAME_GLUON_DISTRIBUTION

const std::string PARTONS::Database::COLUMN_NAME_GLUON_DISTRIBUTION
static
Initial value:
=
"gluon_distribution_value"

◆ COLUMN_NAME_GPD_KINEMATIC_ID

const std::string PARTONS::Database::COLUMN_NAME_GPD_KINEMATIC_ID = "gpd_kinematic_id"
static

◆ COLUMN_NAME_GPD_RESULT_ID

const std::string PARTONS::Database::COLUMN_NAME_GPD_RESULT_ID = "gpd_result_id"
static

◆ COLUMN_NAME_GPD_TYPE_ID

const std::string PARTONS::Database::COLUMN_NAME_GPD_TYPE_ID = "gpd_type_id"
static

◆ COLUMN_NAME_OBSERVABLE_KINEMATIC_ID

const std::string PARTONS::Database::COLUMN_NAME_OBSERVABLE_KINEMATIC_ID
static
Initial value:
=
"observable_kinematic_id"

◆ COLUMN_NAME_OBSERVABLE_NAME

const std::string PARTONS::Database::COLUMN_NAME_OBSERVABLE_NAME = "observable_name"
static

◆ COLUMN_NAME_OBSERVABLE_RESULT_ID

const std::string PARTONS::Database::COLUMN_NAME_OBSERVABLE_RESULT_ID
static
Initial value:
=
"observable_result_id"

◆ COLUMN_NAME_OBSERVABLE_VALUE

const std::string PARTONS::Database::COLUMN_NAME_OBSERVABLE_VALUE = "observable_value"
static

◆ COLUMN_NAME_PARTON_DISTRIBUTION_ID

const std::string PARTONS::Database::COLUMN_NAME_PARTON_DISTRIBUTION_ID
static
Initial value:
=
"parton_distribution_id"

◆ COLUMN_NAME_QUARK_DISTRIBUTION

const std::string PARTONS::Database::COLUMN_NAME_QUARK_DISTRIBUTION
static
Initial value:
=
"quark_distribution"

◆ COLUMN_NAME_QUARK_DISTRIBUTION_MINUS

const std::string PARTONS::Database::COLUMN_NAME_QUARK_DISTRIBUTION_MINUS
static
Initial value:
=
"quark_distribution_minus"

◆ COLUMN_NAME_QUARK_DISTRIBUTION_PLUS

const std::string PARTONS::Database::COLUMN_NAME_QUARK_DISTRIBUTION_PLUS
static
Initial value:
=
"quark_distribution_plus"

◆ COLUMN_NAME_QUARK_FLAVOR_ID

const std::string PARTONS::Database::COLUMN_NAME_QUARK_FLAVOR_ID = "quark_flavor_id"
static

◆ COLUMN_NAME_SCENARIO_DESCRIPTION

const std::string PARTONS::Database::COLUMN_NAME_SCENARIO_DESCRIPTION
static
Initial value:
=
"scenario_description"

◆ COLUMN_NAME_SCENARIO_HASH_SUM

const std::string PARTONS::Database::COLUMN_NAME_SCENARIO_HASH_SUM = "scenario_hash_sum"
static

◆ COLUMN_NAME_SCENARIO_ID

const std::string PARTONS::Database::COLUMN_NAME_SCENARIO_ID = "scenario_id"
static

◆ COLUMN_NAME_SCENARIO_STORE_DATE

const std::string PARTONS::Database::COLUMN_NAME_SCENARIO_STORE_DATE
static
Initial value:
=
"scenario_store_date"

◆ COLUMN_NAME_SCENARIO_XML_FILE

const std::string PARTONS::Database::COLUMN_NAME_SCENARIO_XML_FILE = "scenario_xml_file"
static

◆ TABLE_NAME_CCF_KINEMATIC

const std::string PARTONS::Database::TABLE_NAME_CCF_KINEMATIC = "ccf_kinematic"
static

◆ TABLE_NAME_CCF_RESULT

const std::string PARTONS::Database::TABLE_NAME_CCF_RESULT = "ccf_result"
static

◆ TABLE_NAME_COLLINEAR_DISTRIBUTION_KINEMATIC

const std::string PARTONS::Database::TABLE_NAME_COLLINEAR_DISTRIBUTION_KINEMATIC = "collinear_distribution_kinematic"
static

◆ TABLE_NAME_COLLINEAR_DISTRIBUTION_RESULT

const std::string PARTONS::Database::TABLE_NAME_COLLINEAR_DISTRIBUTION_RESULT = "collinear_distribution_result"
static

◆ TABLE_NAME_COMPUTATION

const std::string PARTONS::Database::TABLE_NAME_COMPUTATION = "computation"
static

◆ TABLE_NAME_ENVIRONMENT_CONFIGURATION

const std::string PARTONS::Database::TABLE_NAME_ENVIRONMENT_CONFIGURATION
static
Initial value:
=
"environment_configuration"

◆ TABLE_NAME_GPD_KINEMATIC

const std::string PARTONS::Database::TABLE_NAME_GPD_KINEMATIC = "gpd_kinematic"
static

◆ TABLE_NAME_GPD_RESULT

const std::string PARTONS::Database::TABLE_NAME_GPD_RESULT = "gpd_result"
static

◆ TABLE_NAME_OBSERVABLE_KINEMATIC

const std::string PARTONS::Database::TABLE_NAME_OBSERVABLE_KINEMATIC
static
Initial value:
=
"observable_kinematic"

◆ TABLE_NAME_OBSERVABLE_RESULT

const std::string PARTONS::Database::TABLE_NAME_OBSERVABLE_RESULT = "observable_result"
static

◆ TABLE_NAME_SCENARIO

const std::string PARTONS::Database::TABLE_NAME_SCENARIO = "scenario"
static

The documentation for this class was generated from the following files: