/
TransactionHistoryArchiveEntity.cs
495 lines (429 loc) · 23.1 KB
/
TransactionHistoryArchiveEntity.cs
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 5.3
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Xml.Serialization;
using AdventureWorks.Dal.Adapter.v53;
using AdventureWorks.Dal.Adapter.v53.HelperClasses;
using AdventureWorks.Dal.Adapter.v53.FactoryClasses;
using AdventureWorks.Dal.Adapter.v53.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace AdventureWorks.Dal.Adapter.v53.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TransactionHistoryArchive'.<br/><br/></summary>
[Serializable]
public partial class TransactionHistoryArchiveEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TransactionHistoryArchiveEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TransactionHistoryArchiveEntity():base("TransactionHistoryArchiveEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TransactionHistoryArchiveEntity(IEntityFields2 fields):base("TransactionHistoryArchiveEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TransactionHistoryArchiveEntity</param>
public TransactionHistoryArchiveEntity(IValidator validator):base("TransactionHistoryArchiveEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="transactionId">PK value for TransactionHistoryArchive which data should be fetched into this TransactionHistoryArchive object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TransactionHistoryArchiveEntity(System.Int32 transactionId):base("TransactionHistoryArchiveEntity")
{
InitClassEmpty(null, null);
this.TransactionId = transactionId;
}
/// <summary> CTor</summary>
/// <param name="transactionId">PK value for TransactionHistoryArchive which data should be fetched into this TransactionHistoryArchive object</param>
/// <param name="validator">The custom validator object for this TransactionHistoryArchiveEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TransactionHistoryArchiveEntity(System.Int32 transactionId, IValidator validator):base("TransactionHistoryArchiveEntity")
{
InitClassEmpty(validator, null);
this.TransactionId = transactionId;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TransactionHistoryArchiveEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
default:
break;
}
return toReturn;
}
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TransactionHistoryArchiveRelations().GetAllRelations();
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TransactionHistoryArchiveEntityFactory));
}
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
}
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ActualCost", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ModifiedDate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ProductId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Quantity", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ReferenceOrderId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ReferenceOrderLineId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("TransactionDate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("TransactionId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("TransactionType", fieldHashtable);
}
#endregion
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TransactionHistoryArchiveEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TransactionHistoryArchiveRelations Relations
{
get { return new TransactionHistoryArchiveRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The ActualCost property of the Entity TransactionHistoryArchive<br/><br/></summary>
/// <remarks>Mapped on table field: "TransactionHistoryArchive"."ActualCost"<br/>
/// Table field type characteristics (type, precision, scale, length): Money, 19, 4, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.Decimal ActualCost
{
get { return (System.Decimal)GetValue((int)TransactionHistoryArchiveFieldIndex.ActualCost, true); }
set { SetValue((int)TransactionHistoryArchiveFieldIndex.ActualCost, value); }
}
/// <summary> The ModifiedDate property of the Entity TransactionHistoryArchive<br/><br/></summary>
/// <remarks>Mapped on table field: "TransactionHistoryArchive"."ModifiedDate"<br/>
/// Table field type characteristics (type, precision, scale, length): DateTime, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.DateTime ModifiedDate
{
get { return (System.DateTime)GetValue((int)TransactionHistoryArchiveFieldIndex.ModifiedDate, true); }
set { SetValue((int)TransactionHistoryArchiveFieldIndex.ModifiedDate, value); }
}
/// <summary> The ProductId property of the Entity TransactionHistoryArchive<br/><br/></summary>
/// <remarks>Mapped on table field: "TransactionHistoryArchive"."ProductID"<br/>
/// Table field type characteristics (type, precision, scale, length): Int, 10, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.Int32 ProductId
{
get { return (System.Int32)GetValue((int)TransactionHistoryArchiveFieldIndex.ProductId, true); }
set { SetValue((int)TransactionHistoryArchiveFieldIndex.ProductId, value); }
}
/// <summary> The Quantity property of the Entity TransactionHistoryArchive<br/><br/></summary>
/// <remarks>Mapped on table field: "TransactionHistoryArchive"."Quantity"<br/>
/// Table field type characteristics (type, precision, scale, length): Int, 10, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.Int32 Quantity
{
get { return (System.Int32)GetValue((int)TransactionHistoryArchiveFieldIndex.Quantity, true); }
set { SetValue((int)TransactionHistoryArchiveFieldIndex.Quantity, value); }
}
/// <summary> The ReferenceOrderId property of the Entity TransactionHistoryArchive<br/><br/></summary>
/// <remarks>Mapped on table field: "TransactionHistoryArchive"."ReferenceOrderID"<br/>
/// Table field type characteristics (type, precision, scale, length): Int, 10, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.Int32 ReferenceOrderId
{
get { return (System.Int32)GetValue((int)TransactionHistoryArchiveFieldIndex.ReferenceOrderId, true); }
set { SetValue((int)TransactionHistoryArchiveFieldIndex.ReferenceOrderId, value); }
}
/// <summary> The ReferenceOrderLineId property of the Entity TransactionHistoryArchive<br/><br/></summary>
/// <remarks>Mapped on table field: "TransactionHistoryArchive"."ReferenceOrderLineID"<br/>
/// Table field type characteristics (type, precision, scale, length): Int, 10, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.Int32 ReferenceOrderLineId
{
get { return (System.Int32)GetValue((int)TransactionHistoryArchiveFieldIndex.ReferenceOrderLineId, true); }
set { SetValue((int)TransactionHistoryArchiveFieldIndex.ReferenceOrderLineId, value); }
}
/// <summary> The TransactionDate property of the Entity TransactionHistoryArchive<br/><br/></summary>
/// <remarks>Mapped on table field: "TransactionHistoryArchive"."TransactionDate"<br/>
/// Table field type characteristics (type, precision, scale, length): DateTime, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.DateTime TransactionDate
{
get { return (System.DateTime)GetValue((int)TransactionHistoryArchiveFieldIndex.TransactionDate, true); }
set { SetValue((int)TransactionHistoryArchiveFieldIndex.TransactionDate, value); }
}
/// <summary> The TransactionId property of the Entity TransactionHistoryArchive<br/><br/></summary>
/// <remarks>Mapped on table field: "TransactionHistoryArchive"."TransactionID"<br/>
/// Table field type characteristics (type, precision, scale, length): Int, 10, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.Int32 TransactionId
{
get { return (System.Int32)GetValue((int)TransactionHistoryArchiveFieldIndex.TransactionId, true); }
set { SetValue((int)TransactionHistoryArchiveFieldIndex.TransactionId, value); }
}
/// <summary> The TransactionType property of the Entity TransactionHistoryArchive<br/><br/></summary>
/// <remarks>Mapped on table field: "TransactionHistoryArchive"."TransactionType"<br/>
/// Table field type characteristics (type, precision, scale, length): NChar, 0, 0, 1<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.String TransactionType
{
get { return (System.String)GetValue((int)TransactionHistoryArchiveFieldIndex.TransactionType, true); }
set { SetValue((int)TransactionHistoryArchiveFieldIndex.TransactionType, value); }
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the AdventureWorks.Dal.Adapter.v53.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)AdventureWorks.Dal.Adapter.v53.EntityType.TransactionHistoryArchiveEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}