Sample.Company
persistent class Sample.Company extends %Library.Persistent, %Library.Populate, %XML.Adaptor
SQL Table Name: Sample.Company
This sample persistent class represents a company.Property Inventory
Method Inventory
Properties
relationship Employees as array of Employee [ InitialExpression = $listbuild("Sample.Employee","Company",+$this,"many",1,1) , Transient , Inverse = Company , Cardinality = many ];
The Employee objects associated with this Company.
Property methods: EmployeesGet(), EmployeesGetObject(), EmployeesGetObjectId(), EmployeesGetSwizzled(), EmployeesIsEmpty(), EmployeesIsValid(), EmployeesNewObject(), EmployeesRClose(), EmployeesRExec(), EmployeesRFetch(), EmployeesRelate(), EmployeesSQLCompute(), EmployeesSet(), EmployeesUnRelate()
property Mission as %String (MAXLEN = 200, POPSPEC = "Mission()");
The company's mission statement.
Property methods: MissionDisplayToLogical(), MissionGet(), MissionGetStored(), MissionIsValid(), MissionLogicalToDisplay(), MissionLogicalToOdbc(), MissionNormalize(), MissionSet()
property Name as %String (MAXLEN = 80, POPSPEC = "Company()") [ Required ];
The company's name.
Property methods: NameDisplayToLogical(), NameGet(), NameGetStored(), NameIsValid(), NameLogicalToDisplay(), NameLogicalToOdbc(), NameNormalize(), NameSet()
property Revenue as %Integer;
The last reported revenue for the company.
Property methods: RevenueDisplayToLogical(), RevenueGet(), RevenueGetStored(), RevenueIsValid(), RevenueLogicalToDisplay(), RevenueNormalize(), RevenueSet(), RevenueXSDToLogical()
property TaxID as %String [ Required ];
The unique Tax ID number for the company.
Property methods: TaxIDDisplayToLogical(), TaxIDGet(), TaxIDGetStored(), TaxIDIsValid(), TaxIDLogicalToDisplay(), TaxIDLogicalToOdbc(), TaxIDNormalize(), TaxIDSet()
Methods
method PrintPayroll()
This method prints out the payroll for this company by iterating over
all the Employee objects related to it and printing
their names and salaries.
You can try this out from the Caché command line by opening an instance of Company object and invoking this method:
You can try this out from the Caché command line by opening an instance of Company object and invoking this method:
Set company = ##class(Sample.Company).%OpenId(1) Do company.PrintPayroll()
Indexes
index (IDKEY on ) [IdKey, Type = key];
Index methods: IDKEYCheck(), IDKEYDelete(), IDKEYExists(), IDKEYOpen(), IDKEYSQLCheckUnique(), IDKEYSQLExists(), IDKEYSQLFindPKeyByConstraint(), IDKEYSQLFindRowIDByConstraint()
index (NameIdx on Name);
Define an index for Name.
Index methods: NameIdxExists()
index (TaxIDIdx on TaxID) [Unique];
Define a unique index for TaxID.
Index methods: TaxIDIdxCheck(), TaxIDIdxCheckUnique(), TaxIDIdxDelete(), TaxIDIdxExists(), TaxIDIdxOpen(), TaxIDIdxSQLCheckUnique(), TaxIDIdxSQLExists(), TaxIDIdxSQLFindPKeyByConstraint(), TaxIDIdxSQLFindRowIDByConstraint()
Inherited Members
Inherited Methods
- %AddToSaveSet()
- %AddToSyncSet()
- %BMEBuilt()
- %CheckConstraints()
- %CheckConstraintsForExtent()
- %ClassIsLatestVersion()
- %ClassName()
- %ComposeOid()
- %ConstructClone()
- %Delete()
- %DeleteExtent()
- %DeleteId()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %Exists()
- %ExistsId()
- %Extends()
- %GUID()
- %GUIDSet()
- %GetLock()
- %GetParameter()
- %GetSwizzleObject()
- %Id()
- %InsertBatch()
- %IsA()
- %IsModified()
- %IsNull()
- %KillExtent()
- %KillExtentData()
- %LoadFromMemory()
- %LockExtent()
- %LockId()
- %New()
- %NormalizeObject()
- %ObjectIsNull()
- %ObjectModified()
- %Oid()
- %OnBeforeAddToSync()
- %OnDetermineClass()
- %Open()
- %OpenId()
- %OriginalNamespace()
- %PackageName()
- %PhysicalAddress()
- %PurgeIndices()
- %Reload()
- %RemoveFromSaveSet()
- %ResolveConcurrencyConflict()
- %RollBack()
- %Save()
- %SaveDirect()
- %SaveIndices()
- %SerializeObject()
- %SetModified()
- %SortBegin()
- %SortEnd()
- %SyncObjectIn()
- %SyncTransport()
- %UnlockExtent()
- %UnlockId()
- %ValidateIndices()
- %ValidateObject()
- OnPopulate()
- Populate()
- PopulateSerial()
- XMLDTD()
- XMLExport()
- XMLExportToStream()
- XMLExportToString()
- XMLNew()
- XMLSchema()
- XMLSchemaNamespace()
- XMLSchemaType()
Storage
Storage Model: CacheStorage (Sample.Company)
^Sample.CompanyD(ID) | = | %%CLASSNAME
Mission
Name
Revenue
TaxID
|