CodeTableMap¶
CodeTableMap is the sole public class in SAIF.Framework.CodeGen. It connects directly to an Oracle data layer, queries a caller-supplied "code table" for code/code_descr reference rows, and generates VB.NET source-code text — either Case statement blocks or Enum member lists — for a developer to paste into hand-written code.
Purpose¶
- Owns the Oracle connection lifecycle, SQL execution, and source-text generation for code-table-driven VB source generation.
- Is a standalone tooling class, not a
clsBusinessBase/clsBusinessCollectionBasebusiness object.
Context¶
- Namespace:
SAIF.Framework.CodeGen - Assembly/package:
SAIF.Framework.CodeGen(bundled into theSAIF.BOF.FrameworkNuGet package via theSAIF.Framework.Corenuspec glob)
Public members¶
| Member | Signature | Purpose |
|---|---|---|
| New | Public Sub New(dbUser As String, database As String) |
Constructor; calls Connect to establish the Oracle data-portal connection |
| CreateCaseStatement | Public Function CreateCaseStatement(table As String, enumName As String, rowItem As String, Optional useDescriptionAsCode As Boolean = True, Optional tabIndex As Integer = 0) As String |
Generates a VB Case statement block from a code table's rows |
| CreateEnumStatement | Public Function CreateEnumStatement(table As String, enumName As String, includeNull As Boolean, Optional useDescriptionAsCode As Boolean = True, Optional tabIndex As Integer = 0) As String |
Generates a VB Enum member list from a code table's rows |
| Connect | Protected Sub Connect(dbUser As String, database As String) |
Establishes or refreshes the Oracle data-layer connection (m_dpi); only reconnects when dbUser/database differ from the current connection |
Behavioral notes¶
CreateCaseStatementandCreateEnumStatementboth call the privateGetResult(table)helper, which builds and executesselect code, code_descr from {table}viaSqlHelper.ResultSetQuery(m_dpi).Execute(sql).- The private
GetEnumValuehelper derives a unique, legal VB identifier from each row'scode/code_descrvalues: it strips non-alphabetic characters fromcode_descrwhenuseDescriptionAsCodeis true (default), prefixes purely numeric identifiers with"Code", and appends the rawcodevalue to disambiguate duplicate identifiers within a generated block — see BR-001, BR-002, and BR-003. Connectonly reconstructsclsMSOracleDataLayerwhendbUserordatabasediffer from the current connection — see BR-004.- No callers of
CodeTableMapwere found anywhere in this repository; it appears to be invoked interactively/manually rather than as part of any runtime request pipeline**.
Constraints and usage notes¶
- The
tableparameter is interpolated directly into SQL text viaString.Format, not passed as a bound parameter; callers are responsible for supplying a valid, trusted table name. - Only a read (
SELECT) operation is supported; this class has no write/insert/update/delete capability. - Requires an Oracle connection reachable via
clsMSOracleDataLayer(dbUser, database); no configuration-file-driven connection settings exist in this library.
Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.
Sources¶
- SAIF.Framework.CodeGen\CodeTableMap.vb