/
DatabaseObjectsMultipleSubclassUsingAttributes.vb
executable file
·130 lines (85 loc) · 4.17 KB
/
DatabaseObjectsMultipleSubclassUsingAttributes.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
' ___________________________________________________
'
' © Hi-Integrity Systems 2010. All rights reserved.
' www.hisystems.com.au - Toby Wicks
' ___________________________________________________
'
Option Strict On
Option Explicit On
Namespace Generic
Public MustInherit Class DatabaseObjectsMultipleSubclassUsingAttributes(Of T As IDatabaseObject)
Inherits DatabaseObjectsMultipleSubclass(Of T)
Private pobjAttributeHelper As DatabaseObjectsUsingAttributesHelper
''' --------------------------------------------------------------------------------
''' <summary>
''' Initializes a new DatabaseObjects with it's associated database.
''' </summary>
'''
''' <param name="objDatabase">
''' The database that this collection is associated with.
''' </param>
''' --------------------------------------------------------------------------------
Protected Sub New(ByVal objDatabase As Database)
MyBase.New(objDatabase)
pobjAttributeHelper = New DatabaseObjectsUsingAttributesHelper(Me)
End Sub
''' --------------------------------------------------------------------------------
''' <summary>
''' Initializes with it the associated root container and database.
''' </summary>
'''
''' <param name="rootContainer">
''' The root object that this collection is associated with.
''' </param>
''' --------------------------------------------------------------------------------
Protected Sub New(ByVal rootContainer As RootContainer)
MyBase.New(rootContainer)
pobjAttributeHelper = New DatabaseObjectsUsingAttributesHelper(Me)
End Sub
''' --------------------------------------------------------------------------------
''' <summary>
''' Initializes a new DatabaseObjects with it's associated parent object.
''' The Parent property can be used to access the parent variable passed into this constructor.
''' </summary>
'''
''' <param name="objParent">
''' The parent object that this collection is associated with.
''' </param>
''' --------------------------------------------------------------------------------
Protected Sub New(ByVal objParent As DatabaseObject)
MyBase.New(objParent)
pobjAttributeHelper = New DatabaseObjectsUsingAttributesHelper(Me)
End Sub
#If UseAutoAssignment Then
Protected Overrides Function DistinctFieldAutoAssignment() As SQL.FieldValueAutoAssignmentType
Return pobjAttributeHelper.DistinctFieldAutoAssignment
End Function
#Else
Protected Overrides Function DistinctFieldAutoIncrements() As Boolean
Return pobjAttributeHelper.DistinctFieldAutoIncrements
End Function
#End If
Protected Overrides Function DistinctFieldName() As String
Return pobjAttributeHelper.DistinctFieldName
End Function
Protected Overrides Function KeyFieldName() As String
Return pobjAttributeHelper.KeyFieldName
End Function
Protected Overrides Function OrderBy() As SQL.SQLSelectOrderByFields
Return pobjAttributeHelper.OrderBy
End Function
Protected Overrides Function Subset() As SQL.SQLConditions
Return pobjAttributeHelper.Subset
End Function
Protected Overrides Function TableJoins(ByVal objPrimaryTable As SQL.SQLSelectTable, ByVal objTables As SQL.SQLSelectTables) As SQL.SQLSelectTableJoins
Return pobjAttributeHelper.TableJoins(objPrimaryTable, objTables)
End Function
Protected Overrides Function TableName() As String
Return pobjAttributeHelper.TableName
End Function
Protected Overrides Function ItemInstance_() As T
Throw New NotSupportedException("ItemInstance_ is not supported for IDatabaseObjectsMultipleSubclass objects")
End Function
End Class
End Namespace