PageRenderTime 57ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 1ms

/examples/EFTester/Acme.TestModel/Business/Objects/DoubleLinkOneOneChildCollection.Generated.cs

#
C# | 1306 lines | 784 code | 131 blank | 391 comment | 95 complexity | f1c9a0323202ff8bd9271dfe74076778 MD5 | raw file
Possible License(s): JSON, CC-BY-SA-3.0

Large files files are truncated, but you can click here to view the full file

  1. using System;
  2. using System.Data;
  3. using System.Xml;
  4. using System.Collections;
  5. using System.Runtime.Serialization;
  6. using System.ComponentModel;
  7. using Acme.TestModel.Business.Rules;
  8. using Acme.TestModel.Business.SelectCommands;
  9. using Acme.TestModel.Domain.Objects;
  10. using Widgetsphere.Core.DataAccess;
  11. using Widgetsphere.Core.Util;
  12. using Widgetsphere.Core.Logging;
  13. using Widgetsphere.Core.Exceptions;
  14. using Acme.TestModel.Business.LINQ;
  15. using System.IO;
  16. using System.Collections.Generic;
  17. using System.Linq.Expressions;
  18. using System.Data.Linq;
  19. using System.Linq;
  20. using System.Text;
  21. using Widgetsphere.Core.EventArgs;
  22. using System.Text.RegularExpressions;
  23. namespace Acme.TestModel.Business.Objects
  24. {
  25. /// <summary>
  26. /// The collection to hold 'DoubleLinkOneOneChild' entities
  27. /// </summary>
  28. [Serializable()]
  29. public partial class DoubleLinkOneOneChildCollection : Widgetsphere.Core.DataAccess.BusinessCollectionPersistableBase, Widgetsphere.Core.DataAccess.IPersistableBusinessCollection, System.IDisposable, System.ComponentModel.IListSource, System.Collections.IList, System.Collections.IEnumerator, System.Collections.Generic.IEnumerable<Acme.TestModel.Business.Objects.DoubleLinkOneOneChild>, Widgetsphere.Core.DataAccess.IWrappingClass
  30. {
  31. #region Member Variables
  32. internal DomainDoubleLinkOneOneChildCollection wrappedClass;
  33. /// <summary>
  34. /// The parent subdomain object
  35. /// </summary>
  36. protected SubDomain _subDomain = null;
  37. #endregion
  38. #region Constructor / Initialize
  39. internal DoubleLinkOneOneChildCollection(DomainDoubleLinkOneOneChildCollection classToWrap)
  40. {
  41. _subDomain = classToWrap.SubDomain;
  42. wrappedClass = classToWrap;
  43. }
  44. /// <summary>
  45. /// Constructor that enables you to specify a modifier
  46. /// </summary>
  47. /// <param name="modifier">Used in audit operations to track changes</param>
  48. public DoubleLinkOneOneChildCollection(string modifier)
  49. {
  50. _subDomain = new SubDomain(modifier);
  51. ResetWrappedClass((DomainDoubleLinkOneOneChildCollection)_subDomain.GetDomainCollection(Collections.DoubleLinkOneOneChildCollection));
  52. }
  53. /// <summary>
  54. /// The default constructor
  55. /// </summary>
  56. public DoubleLinkOneOneChildCollection()
  57. {
  58. _subDomain = new SubDomain(ConfigurationValues.GetInstance().Modifier);
  59. ResetWrappedClass((DomainDoubleLinkOneOneChildCollection)_subDomain.GetDomainCollection(Collections.DoubleLinkOneOneChildCollection));
  60. }
  61. #endregion
  62. #region Property Implementations
  63. /// <summary>
  64. /// Returns the internal object that this object wraps
  65. /// </summary>
  66. [System.ComponentModel.Browsable(false)]
  67. internal virtual object WrappedClass
  68. {
  69. get { return wrappedClass ; }
  70. set { wrappedClass = (DomainDoubleLinkOneOneChildCollection)value ; }
  71. }
  72. //WrappingClass Interface
  73. object Widgetsphere.Core.DataAccess.IWrappingClass.WrappedClass
  74. {
  75. get { return this.WrappedClass; }
  76. set { this.WrappedClass = value; }
  77. }
  78. /// <summary>
  79. /// Specifies a modifier string to be used in the audit functionality
  80. /// </summary>
  81. public string Modifier
  82. {
  83. get
  84. {
  85. try
  86. {
  87. return wrappedClass.Modifier;
  88. }
  89. catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
  90. catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new Widgetsphere.Core.Exceptions.UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
  91. catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
  92. }
  93. internal set { wrappedClass.Modifier = value; }
  94. }
  95. /// <summary>
  96. /// A reference to the SubDomain that holds this collection
  97. /// </summary>
  98. public SubDomain SubDomain
  99. {
  100. get
  101. {
  102. try
  103. {
  104. return wrappedClass.SubDomain;
  105. }
  106. catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
  107. catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new Widgetsphere.Core.Exceptions.UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
  108. catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
  109. }
  110. }
  111. /// <summary>
  112. /// Returns the number of items in this collection
  113. /// </summary>
  114. public override int Count
  115. {
  116. get
  117. {
  118. try
  119. {
  120. lock (wrappedClass.SubDomain)
  121. {
  122. DataTable dt = wrappedClass.GetChanges(DataRowState.Deleted);
  123. if (dt == null) return wrappedClass.Count;
  124. else return wrappedClass.Count - dt.Rows.Count;
  125. }
  126. }
  127. catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
  128. catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new Widgetsphere.Core.Exceptions.UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
  129. catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
  130. }
  131. }
  132. /// <summary>
  133. /// Determines the type of object contained by this collection.
  134. /// </summary>
  135. public virtual Type ContainedType
  136. {
  137. get { return typeof(DoubleLinkOneOneChild); }
  138. }
  139. /// <summary>
  140. /// Determines the type of collection for this object.
  141. /// </summary>
  142. public virtual Collections Collection
  143. {
  144. get { return Collections.DoubleLinkOneOneChildCollection; }
  145. }
  146. #endregion
  147. #region Enumerator
  148. /// <summary>
  149. /// Gets or sets the element at the specified index.
  150. /// </summary>
  151. /// <param name="index">The zero-based index of the element to get or set. </param>
  152. /// <returns>The element at the specified index.</returns>
  153. public virtual DoubleLinkOneOneChild this[int index]
  154. {
  155. get
  156. {
  157. try
  158. {
  159. var internalEnumerator = this.GetEnumerator();
  160. internalEnumerator.Reset();
  161. int ii = -1;
  162. while(ii < index)
  163. {
  164. internalEnumerator.MoveNext();
  165. ii++;
  166. }
  167. var retval = (DoubleLinkOneOneChild)internalEnumerator.Current;
  168. if (retval.wrappedClass == null)
  169. {
  170. if (!((0 <= index) && (index < this.Count)))
  171. throw new IndexOutOfRangeException();
  172. else
  173. throw new Exception("The item is null. This is not a valid state.");
  174. }
  175. else return (DoubleLinkOneOneChild)internalEnumerator.Current;
  176. }
  177. catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
  178. catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new Widgetsphere.Core.Exceptions.UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
  179. catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
  180. }
  181. }
  182. #endregion
  183. #region Methods
  184. /// <summary>
  185. /// Create a new object to later add to this collection
  186. /// </summary>
  187. public virtual DoubleLinkOneOneChild NewItem(int DoubleLinkChildKey1, int DoubleLinkChildKey2)
  188. {
  189. try
  190. {
  191. lock (wrappedClass.SubDomain)
  192. {
  193. return new DoubleLinkOneOneChild(wrappedClass.NewItem(DoubleLinkChildKey1, DoubleLinkChildKey2));
  194. }
  195. }
  196. catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
  197. catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new Widgetsphere.Core.Exceptions.UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
  198. catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
  199. }
  200. /// <summary>
  201. /// Create a new object to later add to this collection
  202. /// </summary>
  203. public virtual DoubleLinkOneOneChild NewItem()
  204. {
  205. try
  206. {
  207. lock (wrappedClass.SubDomain)
  208. {
  209. return new DoubleLinkOneOneChild(wrappedClass.NewItem());
  210. }
  211. }
  212. catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
  213. catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new Widgetsphere.Core.Exceptions.UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
  214. catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
  215. }
  216. /// <summary>
  217. /// Add a newly created entity to this collection.
  218. /// </summary>
  219. public virtual void AddItem(DoubleLinkOneOneChild item)
  220. {
  221. try
  222. {
  223. lock (wrappedClass.SubDomain)
  224. {
  225. wrappedClass.AddItem((DomainDoubleLinkOneOneChild)item.WrappedClass);
  226. }
  227. }
  228. catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
  229. catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new Widgetsphere.Core.Exceptions.UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
  230. catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
  231. }
  232. /// <summary>
  233. /// Determines if the specified item exists in this list
  234. /// </summary>
  235. /// <param name="item"></param>
  236. /// <returns></returns>
  237. public virtual bool Contains(Acme.TestModel.Business.Objects.DoubleLinkOneOneChild item)
  238. {
  239. foreach (var o in this)
  240. {
  241. if (o == item) return true;
  242. }
  243. return false;
  244. }
  245. /// <summary>
  246. /// Determines the position in the list of the specified item, if it exists
  247. /// </summary>
  248. /// <param name="item"></param>
  249. /// <returns></returns>
  250. public virtual int IndexOf(Acme.TestModel.Business.Objects.DoubleLinkOneOneChild item)
  251. {
  252. int index = 0;
  253. foreach (var o in this)
  254. {
  255. if (o == item) return index;
  256. index++;
  257. }
  258. return -1;
  259. }
  260. #region IListSource Members
  261. bool System.ComponentModel.IListSource.ContainsListCollection
  262. {
  263. get { return true; }
  264. }
  265. System.Collections.IList System.ComponentModel.IListSource.GetList()
  266. {
  267. var list = new System.Collections.Generic.List<Acme.TestModel.Business.Objects.DoubleLinkOneOneChild>();
  268. list.AddRange(this);
  269. return list;
  270. }
  271. #endregion
  272. #region IList Members
  273. int System.Collections.IList.Add(object value)
  274. {
  275. if (!(value is Acme.TestModel.Business.Objects.DoubleLinkOneOneChild))
  276. throw new System.Exception("The specified type is not valid!");
  277. var item = value as Acme.TestModel.Business.Objects.DoubleLinkOneOneChild;
  278. this.AddItem(item);
  279. return this.Count;
  280. }
  281. void System.Collections.IList.Clear()
  282. {
  283. throw new System.NotImplementedException();
  284. }
  285. bool System.Collections.IList.Contains(object value)
  286. {
  287. if (!(value is Acme.TestModel.Business.Objects.DoubleLinkOneOneChild))
  288. throw new System.Exception("The specified type is not valid!");
  289. var item = value as Acme.TestModel.Business.Objects.DoubleLinkOneOneChild;
  290. return this.Contains(item);
  291. }
  292. int System.Collections.IList.IndexOf(object value)
  293. {
  294. if (!(value is Acme.TestModel.Business.Objects.DoubleLinkOneOneChild))
  295. throw new System.Exception("The specified type is not valid!");
  296. var item = value as Acme.TestModel.Business.Objects.DoubleLinkOneOneChild;
  297. return this.IndexOf(item);
  298. }
  299. void System.Collections.IList.Insert(int index, object value)
  300. {
  301. throw new System.NotImplementedException();
  302. }
  303. bool System.Collections.IList.IsFixedSize
  304. {
  305. get { return false; }
  306. }
  307. bool System.Collections.IList.IsReadOnly
  308. {
  309. get { return false; }
  310. }
  311. void System.Collections.IList.Remove(object value)
  312. {
  313. if (!(value is Acme.TestModel.Business.Objects.DoubleLinkOneOneChild))
  314. throw new System.Exception("The specified type is not valid!");
  315. var item = value as Acme.TestModel.Business.Objects.DoubleLinkOneOneChild;
  316. if (this.Contains(item))
  317. item.Delete();
  318. }
  319. void System.Collections.IList.RemoveAt(int index)
  320. {
  321. if ((0 <= index) && (index < this.Count))
  322. this[index].Delete();
  323. }
  324. object System.Collections.IList.this[int index]
  325. {
  326. get { return this[index]; }
  327. set { throw new System.NotImplementedException(); }
  328. }
  329. #endregion
  330. /// <summary>
  331. /// Takes an IVisitor object and iterates through each item in this collection
  332. /// </summary>
  333. /// <param name="visitor">The object that processes each collection item</param>
  334. public virtual void ProcessVisitor(IVisitor visitor)
  335. {
  336. if (visitor == null) throw new Exception("This object cannot be null.");
  337. lock(this)
  338. {
  339. foreach (IBusinessObject item in this)
  340. {
  341. visitor.Visit(item);
  342. }
  343. }
  344. }
  345. #region Static SQL Methods
  346. internal static string GetFieldAliasFromFieldNameSqlMapping(string alias)
  347. {
  348. alias = alias.Replace("[", string.Empty).Replace("]", string.Empty);
  349. switch (alias.ToLower())
  350. {
  351. case "double_link_child_key1": return "doublelinkchildkey1";
  352. case "double_link_child_key2": return "doublelinkchildkey2";
  353. case "double_link_parent_key1": return "doublelinkparentkey1";
  354. case "double_link_parent_key2": return "doublelinkparentkey2";
  355. case "qqq": return "qqq";
  356. case "created_date": return "createddate";
  357. case "created_by": return "createdby";
  358. case "modified_date": return "modifieddate";
  359. case "modified_by": return "modifiedby";
  360. case "time_stamp": return "timestamp";
  361. default: throw new Exception("The select clause is not valid.");
  362. }
  363. }
  364. internal static string GetTableFromFieldAliasSqlMapping(string alias)
  365. {
  366. switch (alias.ToLower())
  367. {
  368. case "doublelinkchildkey1": return "DOUBLE_LINK_ONE_ONE_CHILD";
  369. case "doublelinkchildkey2": return "DOUBLE_LINK_ONE_ONE_CHILD";
  370. case "doublelinkparentkey1": return "DOUBLE_LINK_ONE_ONE_CHILD";
  371. case "doublelinkparentkey2": return "DOUBLE_LINK_ONE_ONE_CHILD";
  372. case "qqq": return "DOUBLE_LINK_ONE_ONE_CHILD";
  373. case "createdby": return "DOUBLE_LINK_ONE_ONE_CHILD";
  374. case "createddate": return "DOUBLE_LINK_ONE_ONE_CHILD";
  375. case "modifiedby": return "DOUBLE_LINK_ONE_ONE_CHILD";
  376. case "modifieddate": return "DOUBLE_LINK_ONE_ONE_CHILD";
  377. case "timestamp": return "DOUBLE_LINK_ONE_ONE_CHILD";
  378. default: throw new Exception("The select clause is not valid.");
  379. }
  380. }
  381. internal static string GetTableFromFieldNameSqlMapping(string field)
  382. {
  383. switch (field.ToLower())
  384. {
  385. case "double_link_child_key1": return "DOUBLE_LINK_ONE_ONE_CHILD";
  386. case "double_link_child_key2": return "DOUBLE_LINK_ONE_ONE_CHILD";
  387. case "double_link_parent_key1": return "DOUBLE_LINK_ONE_ONE_CHILD";
  388. case "double_link_parent_key2": return "DOUBLE_LINK_ONE_ONE_CHILD";
  389. case "qqq": return "DOUBLE_LINK_ONE_ONE_CHILD";
  390. case "created_by": return "DOUBLE_LINK_ONE_ONE_CHILD";
  391. case "created_date": return "DOUBLE_LINK_ONE_ONE_CHILD";
  392. case "modified_by": return "DOUBLE_LINK_ONE_ONE_CHILD";
  393. case "modified_date": return "DOUBLE_LINK_ONE_ONE_CHILD";
  394. case "time_stamp": return "DOUBLE_LINK_ONE_ONE_CHILD";
  395. default: throw new Exception("The select clause is not valid.");
  396. }
  397. }
  398. internal static string GetRemappedLinqSql(string sql, string parentAlias, LinqSQLFromClauseCollection childTables)
  399. {
  400. sql = System.Text.RegularExpressions.Regex.Replace(sql, "\\[" + parentAlias + "\\]\\.\\[double_link_child_key1\\]", "[" + childTables.GetBaseAliasTable(parentAlias, "DOUBLE_LINK_ONE_ONE_CHILD") + "].[double_link_child_key1]", RegexOptions.IgnoreCase);
  401. sql = System.Text.RegularExpressions.Regex.Replace(sql, "\\[" + parentAlias + "\\]\\.\\[double_link_child_key2\\]", "[" + childTables.GetBaseAliasTable(parentAlias, "DOUBLE_LINK_ONE_ONE_CHILD") + "].[double_link_child_key2]", RegexOptions.IgnoreCase);
  402. sql = System.Text.RegularExpressions.Regex.Replace(sql, "\\[" + parentAlias + "\\]\\.\\[double_link_parent_key1\\]", "[" + childTables.GetBaseAliasTable(parentAlias, "DOUBLE_LINK_ONE_ONE_CHILD") + "].[double_link_parent_key1]", RegexOptions.IgnoreCase);
  403. sql = System.Text.RegularExpressions.Regex.Replace(sql, "\\[" + parentAlias + "\\]\\.\\[double_link_parent_key2\\]", "[" + childTables.GetBaseAliasTable(parentAlias, "DOUBLE_LINK_ONE_ONE_CHILD") + "].[double_link_parent_key2]", RegexOptions.IgnoreCase);
  404. sql = System.Text.RegularExpressions.Regex.Replace(sql, "\\[" + parentAlias + "\\]\\.\\[qqq\\]", "[" + childTables.GetBaseAliasTable(parentAlias, "DOUBLE_LINK_ONE_ONE_CHILD") + "].[qqq]", RegexOptions.IgnoreCase);
  405. sql = System.Text.RegularExpressions.Regex.Replace(sql, "\\[" + parentAlias + "\\]\\.\\[createdby\\]", "[" + childTables.GetBaseAliasTable(parentAlias, "DOUBLE_LINK_ONE_ONE_CHILD") + "].[createdby]", RegexOptions.IgnoreCase);
  406. sql = System.Text.RegularExpressions.Regex.Replace(sql, "\\[" + parentAlias + "\\]\\.\\[createddate\\]", "[" + childTables.GetBaseAliasTable(parentAlias, "DOUBLE_LINK_ONE_ONE_CHILD") + "].[createddate]", RegexOptions.IgnoreCase);
  407. sql = System.Text.RegularExpressions.Regex.Replace(sql, "\\[" + parentAlias + "\\]\\.\\[modifiedby\\]", "[" + childTables.GetBaseAliasTable(parentAlias, "DOUBLE_LINK_ONE_ONE_CHILD") + "].[modifiedby]", RegexOptions.IgnoreCase);
  408. sql = System.Text.RegularExpressions.Regex.Replace(sql, "\\[" + parentAlias + "\\]\\.\\[modifieddate\\]", "[" + childTables.GetBaseAliasTable(parentAlias, "DOUBLE_LINK_ONE_ONE_CHILD") + "].[modifieddate]", RegexOptions.IgnoreCase);
  409. sql = System.Text.RegularExpressions.Regex.Replace(sql, "\\[" + parentAlias + "\\]\\.\\[timestamp\\]", "[" + childTables.GetBaseAliasTable(parentAlias, "DOUBLE_LINK_ONE_ONE_CHILD") + "].[timestamp]", RegexOptions.IgnoreCase);
  410. return sql;
  411. }
  412. internal static string GetPagedSQL(List<LinqSQLField> fieldList, LinqSQLFromClauseCollection fromLinkList, string whereClause, object paging, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
  413. {
  414. var sb = new StringBuilder();
  415. var paging2 = (DoubleLinkOneOneChildPaging)paging;
  416. //Calculate the SELECT clause
  417. sb.Append("SELECT ");
  418. int index = 0;
  419. foreach (LinqSQLField field in fieldList)
  420. {
  421. sb.Append("[t0].[" + field.Name + "]");
  422. if (index < fieldList.Count - 1) sb.Append(", ");
  423. index++;
  424. }
  425. sb.AppendLine();
  426. sb.AppendLine("FROM (");
  427. //Calculate the Inner SELECT clause
  428. sb.Append("SELECT ");
  429. index = 0;
  430. foreach (var field in fieldList)
  431. {
  432. sb.Append(field.GetSQL(false));
  433. if (index < fieldList.Count - 1) sb.Append(", ");
  434. index++;
  435. }
  436. sb.AppendLine();
  437. //If there is no sort then add primary key
  438. if (paging2.OrderByList.Count == 0)
  439. {
  440. paging2.OrderByList.Add(new DoubleLinkOneOneChildPagingFieldItem(DoubleLinkOneOneChild.FieldNameConstants.DoubleLinkChildKey1));
  441. paging2.OrderByList.Add(new DoubleLinkOneOneChildPagingFieldItem(DoubleLinkOneOneChild.FieldNameConstants.DoubleLinkChildKey2));
  442. }
  443. //Determine the paging sort
  444. var isPrimary = false;
  445. var orderByClause = string.Empty;
  446. foreach (var fieldItem in paging2.OrderByList)
  447. {
  448. if (!string.IsNullOrEmpty(orderByClause)) orderByClause += ", ";
  449. switch (fieldItem.Field.ToString().ToLower())
  450. {
  451. case "doublelinkchildkey1": orderByClause += "[" + (from x in fieldList where x.Alias.ToLower() == fieldItem.Field.ToString().ToLower() select x).FirstOrDefault().Table + "].[double_link_child_key1]" + (fieldItem.Ascending ? string.Empty : " DESC"); break;
  452. case "doublelinkchildkey2": orderByClause += "[" + (from x in fieldList where x.Alias.ToLower() == fieldItem.Field.ToString().ToLower() select x).FirstOrDefault().Table + "].[double_link_child_key2]" + (fieldItem.Ascending ? string.Empty : " DESC"); break;
  453. case "doublelinkparentkey1": orderByClause += "[" + (from x in fieldList where x.Alias.ToLower() == fieldItem.Field.ToString().ToLower() select x).FirstOrDefault().Table + "].[double_link_parent_key1]" + (fieldItem.Ascending ? string.Empty : " DESC"); break;
  454. case "doublelinkparentkey2": orderByClause += "[" + (from x in fieldList where x.Alias.ToLower() == fieldItem.Field.ToString().ToLower() select x).FirstOrDefault().Table + "].[double_link_parent_key2]" + (fieldItem.Ascending ? string.Empty : " DESC"); break;
  455. case "qqq": orderByClause += "[" + (from x in fieldList where x.Alias.ToLower() == fieldItem.Field.ToString().ToLower() select x).FirstOrDefault().Table + "].[qqq]" + (fieldItem.Ascending ? string.Empty : " DESC"); break;
  456. case "createddate": orderByClause += "[t0].[created_date]" + (fieldItem.Ascending ? string.Empty : " DESC"); break;
  457. case "createdby": orderByClause += "[t0].[created_by]" + (fieldItem.Ascending ? string.Empty : " DESC"); break;
  458. case "modifieddate": orderByClause += "[t0].[modified_date]" + (fieldItem.Ascending ? string.Empty : " DESC"); break;
  459. case "modifiedby": orderByClause += "[t0].[modified_by]" + (fieldItem.Ascending ? string.Empty : " DESC"); break;
  460. case "timestamp": orderByClause += "[t0].[time_stamp]" + (fieldItem.Ascending ? string.Empty : " DESC"); break;
  461. default: throw new Exception("The order by clause is not valid.");
  462. }
  463. }
  464. //Get the primary key for predictable sorts
  465. string primarySortKey = string.Empty;
  466. sb.AppendLine(", ROW_NUMBER() OVER (ORDER BY " + orderByClause + ((primarySortKey == string.Empty) || ((isPrimary && (!string.IsNullOrEmpty(primarySortKey)))) ? string.Empty : ", " + primarySortKey) + ") AS Row");
  467. //Calculate the FROM clause
  468. index = 0;
  469. sb.Append("FROM ");
  470. foreach (LinqSQLFromClause fromClause in fromLinkList)
  471. {
  472. sb.Append("[" + fromClause.Schema + "].[" + fromClause.TableName + "] AS [" + fromClause.Alias + "] ");
  473. if (optimizer.NoLocking) sb.Append("WITH (NOLOCK)");
  474. if (!string.IsNullOrEmpty(fromClause.LinkClause)) sb.Append(fromClause.LinkClause + " ");
  475. if (index < fromLinkList.Count - 1)
  476. {
  477. sb.AppendLine();
  478. sb.Append("LEFT OUTER JOIN ");
  479. }
  480. index++;
  481. }
  482. sb.AppendLine();
  483. //Calculate the WHERE clause
  484. if (!string.IsNullOrEmpty(whereClause))
  485. {
  486. foreach (LinqSQLFromClause fromClause in fromLinkList)
  487. {
  488. //Only process table that were original and not inserted above
  489. if (fromClause.AnchorAlias == string.Empty)
  490. {
  491. whereClause = LinqSQLParser.GetRemappedLinqSql(fromClause, whereClause, fromLinkList, LinqSQLParser.ObjectTypeConstants.Table);
  492. }
  493. }
  494. sb.Append("WHERE " + whereClause);
  495. }
  496. sb.AppendLine(") AS [t0]");
  497. sb.AppendLine("WHERE (Row >= " + (((paging2.PageIndex - 1) * paging2.RecordsperPage) + 1) + ") AND (Row <= " + (paging2.PageIndex * paging2.RecordsperPage) + ")");
  498. return sb.ToString();
  499. }
  500. #endregion
  501. /// <summary>
  502. /// Persists this collection to store.
  503. /// </summary>
  504. public override void Persist()
  505. {
  506. try
  507. {
  508. foreach (DoubleLinkOneOneChild item in this)
  509. {
  510. if (item.wrappedClass.RowState != DataRowState.Unchanged)
  511. item.OnValidate(new BusinessObjectEventArgs(item));
  512. }
  513. lock (wrappedClass.SubDomain)
  514. {
  515. wrappedClass.Persist();
  516. }
  517. }
  518. catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
  519. catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new Widgetsphere.Core.Exceptions.UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
  520. catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
  521. }
  522. /// <summary>
  523. /// Select all objects from store.
  524. /// </summary>
  525. public static DoubleLinkOneOneChildCollection RunSelect()
  526. {
  527. return RunSelect(ConfigurationValues.GetInstance().Modifier);
  528. }
  529. /// <summary>
  530. /// Select all objects from store.
  531. /// </summary>
  532. public static DoubleLinkOneOneChildCollection RunSelect(string modifier)
  533. {
  534. try
  535. {
  536. var returnVal = new DoubleLinkOneOneChildCollection(DomainDoubleLinkOneOneChildCollection.RunSelect(modifier));
  537. return returnVal;
  538. }
  539. catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
  540. catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new Widgetsphere.Core.Exceptions.UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
  541. catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
  542. }
  543. /// <summary>
  544. /// Using the specified Where expression, execute a query against the database to return a result set
  545. /// </summary>
  546. /// <param name="where">The expression that determines the records selected</param>
  547. public static DoubleLinkOneOneChildCollection RunSelect(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
  548. {
  549. return RunSelect(where, ConfigurationValues.GetInstance().Modifier);
  550. }
  551. /// <summary>
  552. /// Using the specified Where expression, execute a query against the database to return a result set
  553. /// </summary>
  554. /// <param name="where">The expression that determines the records selected</param>
  555. /// <param name="modifier">The modified audit trail</param>
  556. public static DoubleLinkOneOneChildCollection RunSelect(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, string modifier)
  557. {
  558. return RunSelect(where, new QueryOptimizer(), modifier);
  559. }
  560. /// <summary>
  561. /// Using the specified Where expression, execute a query against the database to return a result set
  562. /// </summary>
  563. /// <param name="where">The expression that determines the records selected</param>
  564. /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
  565. /// <param name="modifier">The modified audit trail</param>
  566. public static DoubleLinkOneOneChildCollection RunSelect(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer, string modifier)
  567. {
  568. var subDomain = new SubDomain(modifier);
  569. var dc = new DataContext(ConfigurationValues.GetInstance().ConnectionString);
  570. var template = dc.GetTable<DoubleLinkOneOneChildQuery>();
  571. var cmd = BusinessCollectionPersistableBase.GetCommand<DoubleLinkOneOneChildQuery>(dc, template, where);
  572. cmd.CommandTimeout = ConfigurationValues.GetInstance().DefaultTimeOut;
  573. var parser = LinqSQLParser.Create(cmd.CommandText, LinqSQLParser.ObjectTypeConstants.Table);
  574. cmd.CommandText = parser.GetSQL(optimizer);
  575. dc.Connection.Open();
  576. var startTime = DateTime.Now;
  577. var result = dc.Translate<DoubleLinkOneOneChildQuery>(cmd.ExecuteReader());
  578. var endTime = DateTime.Now;
  579. optimizer.TotalMilliseconds = (long)endTime.Subtract(startTime).TotalMilliseconds;
  580. var retval = subDomain.GetCollection<DoubleLinkOneOneChildCollection>();
  581. var pkList = new HashSet<string>();
  582. foreach (var item in result)
  583. {
  584. var pk = item.SinglePrimaryKeyValue();
  585. if (!pkList.Contains(pk))
  586. {
  587. pkList.Add(pk);
  588. var newItem = retval.NewItem(item.DoubleLinkChildKey1, item.DoubleLinkChildKey2);
  589. LoadDataRow(item, newItem);
  590. retval.AddItem(newItem);
  591. }
  592. }
  593. retval.wrappedClass.AcceptChanges();
  594. retval.wrappedClass.EndLoadData();
  595. dc.Connection.Close();
  596. return retval;
  597. }
  598. /// <summary>
  599. /// Using the specified Where expression, execute a query against the database to return a result set
  600. /// </summary>
  601. /// <param name="where">The expression that determines the records selected</param>
  602. /// <param name="paging">The paging object to determine how the results are paged.</param>
  603. public static DoubleLinkOneOneChildCollection RunSelect(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Acme.TestModel.Business.Objects.DoubleLinkOneOneChildPaging paging)
  604. {
  605. return RunSelect(where, paging, ConfigurationValues.GetInstance().Modifier);
  606. }
  607. /// <summary>
  608. /// Using the specified Where expression, execute a query against the database to return a result set
  609. /// </summary>
  610. /// <param name="where">The expression that determines the records selected</param>
  611. /// <param name="paging">The paging object to determine how the results are paged.</param>
  612. /// <param name="modifier">The modified audit trail</param>
  613. public static DoubleLinkOneOneChildCollection RunSelect(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Acme.TestModel.Business.Objects.DoubleLinkOneOneChildPaging paging, string modifier)
  614. {
  615. return RunSelect(where, paging, new QueryOptimizer(), modifier);
  616. }
  617. /// <summary>
  618. /// Using the specified Where expression, execute a query against the database to return a result set
  619. /// </summary>
  620. /// <param name="where">The expression that determines the records selected</param>
  621. /// <param name="paging">The paging object to determine how the results are paged.</param>
  622. /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
  623. /// <param name="modifier">The modified audit trail</param>
  624. public static DoubleLinkOneOneChildCollection RunSelect(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Acme.TestModel.Business.Objects.DoubleLinkOneOneChildPaging paging, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer, string modifier)
  625. {
  626. if (paging == null) throw new Exception("The paging object cannot be null.");
  627. var subDomain = new SubDomain(modifier);
  628. var dc = new DataContext(ConfigurationValues.GetInstance().ConnectionString);
  629. var template = dc.GetTable<DoubleLinkOneOneChildQuery>();
  630. var cmd = BusinessCollectionPersistableBase.GetCommand<DoubleLinkOneOneChildQuery>(dc, template, where);
  631. cmd.CommandTimeout = ConfigurationValues.GetInstance().DefaultTimeOut;
  632. var parser = LinqSQLParser.Create(cmd.CommandText, paging, LinqSQLParser.ObjectTypeConstants.Table);
  633. cmd.CommandText = parser.GetSQL(optimizer);
  634. dc.Connection.Open();
  635. var startTime = DateTime.Now;
  636. var result = dc.Translate<DoubleLinkOneOneChildQuery>(cmd.ExecuteReader());
  637. var endTime = DateTime.Now;
  638. optimizer.TotalMilliseconds = (long)endTime.Subtract(startTime).TotalMilliseconds;
  639. var retval = subDomain.GetCollection<DoubleLinkOneOneChildCollection>();
  640. var pkList = new HashSet<string>();
  641. foreach (var item in result)
  642. {
  643. var pk = item.SinglePrimaryKeyValue();
  644. if (!pkList.Contains(pk))
  645. {
  646. pkList.Add(pk);
  647. var newItem = retval.NewItem(item.DoubleLinkChildKey1, item.DoubleLinkChildKey2);
  648. LoadDataRow(item, newItem);
  649. retval.AddItem(newItem);
  650. }
  651. }
  652. retval.wrappedClass.AcceptChanges();
  653. retval.wrappedClass.EndLoadData();
  654. dc.Connection.Close();
  655. paging.RecordCount = GetCount(where);
  656. return retval;
  657. }
  658. private static void LoadDataRow(DoubleLinkOneOneChildQuery item, DoubleLinkOneOneChild newItem)
  659. {
  660. newItem.wrappedClass["double_link_parent_key1"] = item.DoubleLinkParentKey1;
  661. newItem.wrappedClass["double_link_child_key2"] = item.DoubleLinkChildKey2;
  662. newItem.wrappedClass["double_link_parent_key2"] = item.DoubleLinkParentKey2;
  663. newItem.wrappedClass["double_link_child_key1"] = item.DoubleLinkChildKey1;
  664. newItem.wrappedClass["qqq"] = StringHelper.ConvertToDatabase(item.Qqq);
  665. newItem.wrappedClass["CreatedDate"] = StringHelper.ConvertToDatabase(item.CreatedDate);
  666. newItem.wrappedClass["CreatedBy"] = StringHelper.ConvertToDatabase(item.CreatedBy);
  667. newItem.wrappedClass["ModifiedDate"] = StringHelper.ConvertToDatabase(item.ModifiedDate);
  668. newItem.wrappedClass["ModifiedBy"] = StringHelper.ConvertToDatabase(item.ModifiedBy);
  669. newItem.wrappedClass["TimeStamp"] = item.TimeStamp;
  670. }
  671. /// <summary>
  672. /// Get the maximum value of the field for all objects
  673. /// </summary>
  674. /// <param name="select">The field to aggregate</param>
  675. public static int? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, int>> select)
  676. {
  677. return GetMax(select, x => true);
  678. }
  679. /// <summary>
  680. /// Get the maximum value of the field in the set of records that match the Where condition
  681. /// </summary>
  682. /// <param name="select">The field to aggregate</param>
  683. /// <param name="where">The expression that determines the records selected</param>
  684. public static int? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, int>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
  685. {
  686. return GetMax(select, where, new QueryOptimizer());
  687. }
  688. /// <summary>
  689. /// Get the maximum value of the field in the set of records that match the Where condition
  690. /// </summary>
  691. /// <param name="select">The field to aggregate</param>
  692. /// <param name="where">The expression that determines the records selected</param>
  693. /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
  694. public static int? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, int>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
  695. {
  696. return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, int>.GetMax(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
  697. }
  698. /// <summary>
  699. /// Get the maximum value of the field for all objects
  700. /// </summary>
  701. /// <param name="select">The field to aggregate</param>
  702. public static int? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, int?>> select)
  703. {
  704. return GetMax(select, x => true);
  705. }
  706. /// <summary>
  707. /// Get the maximum value of the field in the set of records that match the Where condition
  708. /// </summary>
  709. /// <param name="select">The field to aggregate</param>
  710. /// <param name="where">The expression that determines the records selected</param>
  711. public static int? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, int?>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
  712. {
  713. return GetMax(select, where, new QueryOptimizer());
  714. }
  715. /// <summary>
  716. /// Get the maximum value of the field in the set of records that match the Where condition
  717. /// </summary>
  718. /// <param name="select">The field to aggregate</param>
  719. /// <param name="where">The expression that determines the records selected</param>
  720. /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
  721. public static int? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, int?>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
  722. {
  723. return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, int?>.GetMax(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
  724. }
  725. /// <summary>
  726. /// Get the maximum value of the field for all objects
  727. /// </summary>
  728. /// <param name="select">The field to aggregate</param>
  729. public static Single? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, Single>> select)
  730. {
  731. return GetMax(select, x => true);
  732. }
  733. /// <summary>
  734. /// Get the maximum value of the field in the set of records that match the Where condition
  735. /// </summary>
  736. /// <param name="select">The field to aggregate</param>
  737. /// <param name="where">The expression that determines the records selected</param>
  738. public static Single? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, Single>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
  739. {
  740. return GetMax(select, where, new QueryOptimizer());
  741. }
  742. /// <summary>
  743. /// Get the maximum value of the field in the set of records that match the Where condition
  744. /// </summary>
  745. /// <param name="select">The field to aggregate</param>
  746. /// <param name="where">The expression that determines the records selected</param>
  747. /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
  748. public static Single? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, Single>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
  749. {
  750. return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, Single>.GetMax(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
  751. }
  752. /// <summary>
  753. /// Get the maximum value of the field for all objects
  754. /// </summary>
  755. /// <param name="select">The field to aggregate</param>
  756. public static Single? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, Single?>> select)
  757. {
  758. return GetMax(select, x => true);
  759. }
  760. /// <summary>
  761. /// Get the maximum value of the field in the set of records that match the Where condition
  762. /// </summary>
  763. /// <param name="select">The field to aggregate</param>
  764. /// <param name="where">The expression that determines the records selected</param>
  765. public static Single? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, Single?>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
  766. {
  767. return GetMax(select, where, new QueryOptimizer());
  768. }
  769. /// <summary>
  770. /// Get the maximum value of the field in the set of records that match the Where condition
  771. /// </summary>
  772. /// <param name="select">The field to aggregate</param>
  773. /// <param name="where">The expression that determines the records selected</param>
  774. /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
  775. public static Single? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, Single?>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
  776. {
  777. return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, Single?>.GetMax(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
  778. }
  779. /// <summary>
  780. /// Get the maximum value of the field for all objects
  781. /// </summary>
  782. /// <param name="select">The field to aggregate</param>
  783. public static double? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, double>> select)
  784. {
  785. return GetMax(select, x => true);
  786. }
  787. /// <summary>
  788. /// Get the maximum value of the field in the set of records that match the Where condition
  789. /// </summary>
  790. /// <param name="select">The field to aggregate</param>
  791. /// <param name="where">The expression that determines the records selected</param>
  792. public static double? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, double>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
  793. {
  794. return GetMax(select, where, new QueryOptimizer());
  795. }
  796. /// <summary>
  797. /// Get the maximum value of the field in the set of records that match the Where condition
  798. /// </summary>
  799. /// <param name="select">The field to aggregate</param>
  800. /// <param name="where">The expression that determines the records selected</param>
  801. /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
  802. public static double? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, double>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
  803. {
  804. return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, double>.GetMax(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
  805. }
  806. /// <summary>
  807. /// Get the maximum value of the field for all objects
  808. /// </summary>
  809. /// <param name="select">The field to aggregate</param>
  810. public static double? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, double?>> select)
  811. {
  812. return GetMax(select, x => true);
  813. }
  814. /// <summary>
  815. /// Get the maximum value of the field in the set of records that match the Where condition
  816. /// </summary>
  817. /// <param name="select">The field to aggregate</param>
  818. /// <param name="where">The expression that determines the records selected</param>
  819. public static double? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, double?>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
  820. {
  821. return GetMax(select, where, new QueryOptimizer());
  822. }
  823. /// <summary>
  824. /// Get the maximum value of the field in the set of records that match the Where condition
  825. /// </summary>
  826. /// <param name="select">The field to aggregate</param>
  827. /// <param name="where">The expression that determines the records selected</param>
  828. /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
  829. public static double? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, double?>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
  830. {
  831. return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, double?>.GetMax(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
  832. }
  833. /// <summary>
  834. /// Get the maximum value of the field for all objects
  835. /// </summary>
  836. /// <param name="select">The field to aggregate</param>
  837. public static decimal? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, decimal>> select)
  838. {
  839. return GetMax(select, x => true);
  840. }
  841. /// <summary>
  842. /// Get the maximum value of the field in the set of records that match the Where condition
  843. /// </summary>
  844. /// <param name="select">The field to aggregate</param>
  845. /// <param name="where">The expression that determines the records selected</param>
  846. public static decimal? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, decimal>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
  847. {
  848. return GetMax(select, where, new QueryOptimizer());
  849. }
  850. /// <summary>
  851. /// Get the maximum value of the field in the set of records that match the Where condition
  852. /// </summary>
  853. /// <param name="select">The field to aggregate</param>
  854. /// <param name="where">The expression that determines the records selected</param>
  855. /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
  856. public static decimal? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, decimal>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
  857. {
  858. return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, decimal>.GetMax(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
  859. }
  860. /// <summary>
  861. /// Get the maximum value of the field for all objects
  862. /// </summary>
  863. /// <param name="select">The field to aggregate</param>
  864. public static decimal? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, decimal?>> select)
  865. {
  866. return GetMax(select, x => true);
  867. }
  868. /// <summary>
  869. /// Get the maximum value of the field in the set of records that match the Where condition
  870. /// </summary>
  871. /// <param name="select">The field to aggregate</param>
  872. /// <param name="where">The expression that determines the records selected</param>
  873. public static decimal? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, decimal?>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
  874. {
  875. return GetMax(select, where, new QueryOptimizer());
  876. }
  877. /// <summary>
  878. /// Get the maximum value of the field in the set of records that match the Where condition
  879. /// </summary>
  880. /// <param name="select">The field to aggregate</param>
  881. /// <param name="where">The expression that determines the records selected</param>
  882. /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
  883. public static decimal? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, decimal?>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
  884. {
  885. return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, decimal?>.GetMax(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
  886. }
  887. /// <summary>
  888. /// Get the maximum value of the field for all objects
  889. /// </summary>
  890. /// <param name="select">The field to aggregate</param>
  891. public static string GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, string>> select)
  892. {
  893. return GetMax(select, x => true);
  894. }
  895. /// <summary>
  896. /// Get the maximum value of the field in the set of records that match the Where condition
  897. /// </summary>
  898. /// <param name="select">The field to aggregate</param>
  899. /// <param name="where">The expression that determines the records selected</param>
  900. public static string GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, string>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
  901. {
  902. return GetMax(select, where, new QueryOptimizer());
  903. }
  904. /// <summary>
  905. /// Get the maximum value of the field in the set of records that match the Where condition
  906. /// </summary>
  907. /// <param name="select">The field to aggregate</param>
  908. /// <param name="where">The expression that determines the records selected</param>
  909. /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
  910. public static string GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, string>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
  911. {
  912. return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, string>.GetMax(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
  913. }
  914. /// <summary>
  915. /// Get the maximum value of the field for all objects
  916. /// </summary>
  917. /// <param name="select">The field to aggregate</param>
  918. public static DateTime? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, DateTime>> select)
  919. {
  920. return GetMax(select, x => true);
  921. }
  922. /// <summary>
  923. /// Get the maximum value of the field in the set of records that match the Where condition
  924. /// </summary>
  925. /// <param name="select">The field to aggregate</param>
  926. /// <param name="where">The expression that determines the records selected</param>
  927. public static DateTime? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, DateTime>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
  928. {
  929. return GetMax(select, where, new QueryOptimizer());
  930. }
  931. /// <summary>
  932. /// Get the maximum value of the field in the set of records that match the Where condition
  933. /// </summary>
  934. /// <param name="select">The field to aggregate</param>
  935. /// <param name="where">The expression that determines the records selected</param>
  936. /// <param name="optimizer">An object…

Large files files are truncated, but you can click here to view the full file