Beispiel #1
0
	void User::FromBson(const mongo::BSONObj  & __obj)
	{
		mongo::BSONObjIterator  iter(__obj); 
		while(iter.more())
		{
			mongo::BSONElement __be = iter.next(); 
			const char* fieldName = __be.fieldName();
			INT64 hash = CUtil::BKDRHashSum(fieldName);
			switch(hash)
			{
			case 768799158513: // _T
				{
					assert(CUtil::strcmp(__be.valuestr(),TableName()) == 0);
				}
				break;
			case 1791250331439: // name type: string
				{
					CUtil::BsonToCpp(name,__be);
				}
				break;
			case 1915809189412: // pswd type: string
				{
					CUtil::BsonToCpp(pswd,__be);
				}
				break;
			case 3427387595580: // sysuser type: bool
				{
					CUtil::BsonToCpp(sysuser,__be);
				}
				break;
			}
		}
		__hash = HashMake(0);
	}
Beispiel #2
0
	void User::ToBson(mongo::BSONObj  & __obj)
	{
		mongo::BSONObjBuilder __builder;
		__builder.append("_T",TableName());
		if(name != "")
			__builder.append("name",name);
		if(pswd != "")
			__builder.append("pswd",pswd);
		if(sysuser != false)
			__builder.append("sysuser",sysuser);
		__obj = __builder.obj();
	}
void HistogramTablesFormatter::openTable(enum TableKind table, bool needWrite, casacore::Table **tablePtr)
{
	if(*tablePtr == 0)
	{
		openMainTable(false);
		*tablePtr = new casacore::Table(_measurementSet->keywordSet().asTable(TableName(table)));
		if(needWrite)
			(*tablePtr)->reopenRW();
	} else {
		if(needWrite && !(*tablePtr)->isWritable())
			(*tablePtr)->reopenRW();
	}
}
void TypeStateWriterDatabase::Next()
{
    if( AtEnd() )
        return;

    ++m_Count;

    if( m_Size <= m_Count )
    {
        Stop();
        return;
    }

    QStringList tmp = m_Database->GetRecord(
                          TableName(), FieldName(), QString::number( Count() ) );
    tmp.pop_front();
    m_Data = tmp;
}
Beispiel #5
0
int SQLDeleteCommand :: Execute( ALib::CommandLine & cmd ) {

	GetCommonValues( cmd );
	BuildWhereCols( cmd );
	MustHaveWhereNames();

	IOManager io( cmd );
	CSVRow row;

	while( io.ReadCSV( row ) ) {
		if ( ! Skip( row ) ) {
			io.Out() << CreateDeleteSQL( TableName(), row );
			io.Out() << Separator();
		}
	}

	return 0;
}
Beispiel #6
0
int SQLInsertCommand ::	Execute( ALib::CommandLine & cmd ) {

	GetCommonValues( cmd );
	BuildDataCols( cmd );
	MustHaveDataNames();	// need col names too

	IOManager io( cmd );
	CSVRow row;

	while( io.ReadCSV( row ) ) {
		if ( ! Skip( row ) ) {
			io.Out() << CreateInsertSQL( TableName(), row );
			io.Out() << Separator();
		}
	}

	return 0;
}
TypeStateWriterDatabase::TypeStateWriterDatabase( TypeDatabase& database,
        QString table_name, QString field_name, long size, long flags, TypeVariant* parent ):
    TypeStateWriter( flags, parent )
{
    m_Database = &database;
    m_TableName = table_name;
    m_FieldName = field_name;
    m_Size = size;

    if( m_Size < 1 )
    {
        Stop();
        return;
    }

    QStringList tmp = m_Database->GetRecord(
                          TableName(), FieldName(), QString::number( Count() ) );
    tmp.pop_front();
    m_Data = tmp;
}
Beispiel #8
0
/**
Return current table name in the cursor

*/	
const TDesC& CDbStructure::TableName()
	{
	return TableName(iTablesIndex);
	}