MetaDataTable.py revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
## @file
#
# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
##
# Import Modules
#
import os
from CommonDataClass import DataClass
## Convert to SQL required string format
def ConvertToSqlString(StringList):
## TableFile
#
# This class defined a common table
#
# @param object: Inherited from object class
#
# @param Cursor: Cursor of the database
# @param TableName: Name of the table
#
_COLUMN_ = ''
_ID_STEP_ = 1
_ID_MAX_ = 0x80000000
_DUMMY_ = 0
## Create table
#
# Create a table
#
if NewTable:
else:
## Insert table
#
# Insert a record into a table
#
## Query table
#
# Query all records of the table
#
## Drop a table
#
# Drop the table
#
try:
## Get count
#
# Get a count of all records of the table
#
# @retval Count: Total count of all records
#
if Id == None:
return Id
## Init the ID of the table
#
# Init the ID of the table
#
## Exec
#
# Exec Sql Command, return result
#
# @param SqlCommand: The SqlCommand to be executed
#
# @retval RecordSet: The result after executed
#
return RecordSet
def SetEndFlag(self):
pass
def IsIntegral(self):
return False
return True
## TableDataModel
#
# This class defined a table used for data model
#
# @param object: Inherited from object class
#
#
class TableDataModel(Table):
_COLUMN_ = """
ID INTEGER PRIMARY KEY,
CrossIndex INTEGER NOT NULL,
Name VARCHAR NOT NULL,
Description VARCHAR
"""
## Insert table
#
# Insert a record into table DataModel
#
# @param ID: ID of a ModelType
# @param CrossIndex: CrossIndex of a ModelType
# @param Name: Name of a ModelType
# @param Description: Description of a ModelType
#
## Init table
#
# Create all default records of table DataModel
#
return
## Get CrossIndex
#
# Get a model's cross index from its name
#
# @param ModelName: Name of the model
# @retval CrossIndex: CrossIndex of the model
#
CrossIndex = -1
return CrossIndex