34 lines
903 B
Python
34 lines
903 B
Python
from .StoredProcedureOperation import StoredProcedureOperation
|
|
from ..Guid import Guid
|
|
from ..SQLParameter import SQLParameter
|
|
from ..SQLFunctionCall import SQLFunctionCall
|
|
|
|
class PrepareInstanceOperation(StoredProcedureOperation):
|
|
|
|
def __init__(self, globalIdentifier : Guid, classIndex : int, instanceIndex : int):
|
|
self.globalIdentifier = globalIdentifier
|
|
self.classIndex = classIndex
|
|
self.instanceIndex = instanceIndex
|
|
|
|
def get_sp_name(self):
|
|
return "mocha_prepare_instance"
|
|
|
|
def get_sp_parameters(self):
|
|
parms = []
|
|
|
|
globalId = None
|
|
if self.globalIdentifier is not None:
|
|
globalId = self.globalIdentifier
|
|
|
|
strCid = None
|
|
if self.classIndex is not None:
|
|
strCid = self.classIndex
|
|
else:
|
|
strCid = 1
|
|
|
|
strIid = None
|
|
if self.instanceIndex is not None:
|
|
strIid = self.instanceIndex
|
|
|
|
return [strCid, strIid, globalId, None, None, SQLParameter("p_assigned_inst_id")]
|