/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
- using System;
- using System.Data;
- using System.Xml;
- using System.Collections;
- using System.Runtime.Serialization;
- using System.ComponentModel;
- using Acme.TestModel.Business.Rules;
- using Acme.TestModel.Business.SelectCommands;
- using Acme.TestModel.Domain.Objects;
- using Widgetsphere.Core.DataAccess;
- using Widgetsphere.Core.Util;
- using Widgetsphere.Core.Logging;
- using Widgetsphere.Core.Exceptions;
- using Acme.TestModel.Business.LINQ;
- using System.IO;
- using System.Collections.Generic;
- using System.Linq.Expressions;
- using System.Data.Linq;
- using System.Linq;
- using System.Text;
- using Widgetsphere.Core.EventArgs;
- using System.Text.RegularExpressions;
-
- namespace Acme.TestModel.Business.Objects
- {
- /// <summary>
- /// The collection to hold 'DoubleLinkOneOneChild' entities
- /// </summary>
- [Serializable()]
- 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
- {
- #region Member Variables
-
- internal DomainDoubleLinkOneOneChildCollection wrappedClass;
-
- /// <summary>
- /// The parent subdomain object
- /// </summary>
- protected SubDomain _subDomain = null;
-
- #endregion
-
- #region Constructor / Initialize
-
- internal DoubleLinkOneOneChildCollection(DomainDoubleLinkOneOneChildCollection classToWrap)
- {
- _subDomain = classToWrap.SubDomain;
- wrappedClass = classToWrap;
- }
-
- /// <summary>
- /// Constructor that enables you to specify a modifier
- /// </summary>
- /// <param name="modifier">Used in audit operations to track changes</param>
- public DoubleLinkOneOneChildCollection(string modifier)
- {
- _subDomain = new SubDomain(modifier);
- ResetWrappedClass((DomainDoubleLinkOneOneChildCollection)_subDomain.GetDomainCollection(Collections.DoubleLinkOneOneChildCollection));
- }
-
- /// <summary>
- /// The default constructor
- /// </summary>
- public DoubleLinkOneOneChildCollection()
- {
- _subDomain = new SubDomain(ConfigurationValues.GetInstance().Modifier);
- ResetWrappedClass((DomainDoubleLinkOneOneChildCollection)_subDomain.GetDomainCollection(Collections.DoubleLinkOneOneChildCollection));
- }
-
- #endregion
-
- #region Property Implementations
-
- /// <summary>
- /// Returns the internal object that this object wraps
- /// </summary>
- [System.ComponentModel.Browsable(false)]
- internal virtual object WrappedClass
- {
- get { return wrappedClass ; }
- set { wrappedClass = (DomainDoubleLinkOneOneChildCollection)value ; }
- }
-
- //WrappingClass Interface
- object Widgetsphere.Core.DataAccess.IWrappingClass.WrappedClass
- {
- get { return this.WrappedClass; }
- set { this.WrappedClass = value; }
- }
-
- /// <summary>
- /// Specifies a modifier string to be used in the audit functionality
- /// </summary>
- public string Modifier
- {
- get
- {
- try
- {
- return wrappedClass.Modifier;
- }
- catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
- 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; }
- catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
- }
- internal set { wrappedClass.Modifier = value; }
- }
-
- /// <summary>
- /// A reference to the SubDomain that holds this collection
- /// </summary>
- public SubDomain SubDomain
- {
- get
- {
- try
- {
- return wrappedClass.SubDomain;
- }
- catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
- 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; }
- catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
- }
- }
-
- /// <summary>
- /// Returns the number of items in this collection
- /// </summary>
- public override int Count
- {
- get
- {
- try
- {
- lock (wrappedClass.SubDomain)
- {
- DataTable dt = wrappedClass.GetChanges(DataRowState.Deleted);
- if (dt == null) return wrappedClass.Count;
- else return wrappedClass.Count - dt.Rows.Count;
- }
- }
- catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
- 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; }
- catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
- }
- }
-
- /// <summary>
- /// Determines the type of object contained by this collection.
- /// </summary>
- public virtual Type ContainedType
- {
- get { return typeof(DoubleLinkOneOneChild); }
- }
-
- /// <summary>
- /// Determines the type of collection for this object.
- /// </summary>
- public virtual Collections Collection
- {
- get { return Collections.DoubleLinkOneOneChildCollection; }
- }
-
- #endregion
-
- #region Enumerator
-
- /// <summary>
- /// Gets or sets the element at the specified index.
- /// </summary>
- /// <param name="index">The zero-based index of the element to get or set. </param>
- /// <returns>The element at the specified index.</returns>
- public virtual DoubleLinkOneOneChild this[int index]
- {
- get
- {
- try
- {
- var internalEnumerator = this.GetEnumerator();
- internalEnumerator.Reset();
- int ii = -1;
- while(ii < index)
- {
- internalEnumerator.MoveNext();
- ii++;
- }
- var retval = (DoubleLinkOneOneChild)internalEnumerator.Current;
- if (retval.wrappedClass == null)
- {
- if (!((0 <= index) && (index < this.Count)))
- throw new IndexOutOfRangeException();
- else
- throw new Exception("The item is null. This is not a valid state.");
- }
- else return (DoubleLinkOneOneChild)internalEnumerator.Current;
- }
- catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
- 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; }
- catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
- }
- }
-
- #endregion
-
- #region Methods
-
- /// <summary>
- /// Create a new object to later add to this collection
- /// </summary>
- public virtual DoubleLinkOneOneChild NewItem(int DoubleLinkChildKey1, int DoubleLinkChildKey2)
- {
- try
- {
- lock (wrappedClass.SubDomain)
- {
- return new DoubleLinkOneOneChild(wrappedClass.NewItem(DoubleLinkChildKey1, DoubleLinkChildKey2));
- }
- }
- catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
- 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; }
- catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
- }
-
- /// <summary>
- /// Create a new object to later add to this collection
- /// </summary>
- public virtual DoubleLinkOneOneChild NewItem()
- {
- try
- {
- lock (wrappedClass.SubDomain)
- {
- return new DoubleLinkOneOneChild(wrappedClass.NewItem());
- }
- }
- catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
- 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; }
- catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
- }
-
- /// <summary>
- /// Add a newly created entity to this collection.
- /// </summary>
- public virtual void AddItem(DoubleLinkOneOneChild item)
- {
- try
- {
- lock (wrappedClass.SubDomain)
- {
- wrappedClass.AddItem((DomainDoubleLinkOneOneChild)item.WrappedClass);
- }
- }
- catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
- 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; }
- catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
- }
-
- /// <summary>
- /// Determines if the specified item exists in this list
- /// </summary>
- /// <param name="item"></param>
- /// <returns></returns>
- public virtual bool Contains(Acme.TestModel.Business.Objects.DoubleLinkOneOneChild item)
- {
- foreach (var o in this)
- {
- if (o == item) return true;
- }
- return false;
- }
-
- /// <summary>
- /// Determines the position in the list of the specified item, if it exists
- /// </summary>
- /// <param name="item"></param>
- /// <returns></returns>
- public virtual int IndexOf(Acme.TestModel.Business.Objects.DoubleLinkOneOneChild item)
- {
- int index = 0;
- foreach (var o in this)
- {
- if (o == item) return index;
- index++;
- }
- return -1;
- }
-
- #region IListSource Members
-
- bool System.ComponentModel.IListSource.ContainsListCollection
- {
- get { return true; }
- }
-
- System.Collections.IList System.ComponentModel.IListSource.GetList()
- {
- var list = new System.Collections.Generic.List<Acme.TestModel.Business.Objects.DoubleLinkOneOneChild>();
- list.AddRange(this);
- return list;
- }
-
- #endregion
-
- #region IList Members
-
- int System.Collections.IList.Add(object value)
- {
- if (!(value is Acme.TestModel.Business.Objects.DoubleLinkOneOneChild))
- throw new System.Exception("The specified type is not valid!");
- var item = value as Acme.TestModel.Business.Objects.DoubleLinkOneOneChild;
- this.AddItem(item);
- return this.Count;
- }
-
- void System.Collections.IList.Clear()
- {
- throw new System.NotImplementedException();
- }
-
- bool System.Collections.IList.Contains(object value)
- {
- if (!(value is Acme.TestModel.Business.Objects.DoubleLinkOneOneChild))
- throw new System.Exception("The specified type is not valid!");
- var item = value as Acme.TestModel.Business.Objects.DoubleLinkOneOneChild;
- return this.Contains(item);
- }
-
- int System.Collections.IList.IndexOf(object value)
- {
- if (!(value is Acme.TestModel.Business.Objects.DoubleLinkOneOneChild))
- throw new System.Exception("The specified type is not valid!");
- var item = value as Acme.TestModel.Business.Objects.DoubleLinkOneOneChild;
- return this.IndexOf(item);
- }
-
- void System.Collections.IList.Insert(int index, object value)
- {
- throw new System.NotImplementedException();
- }
-
- bool System.Collections.IList.IsFixedSize
- {
- get { return false; }
- }
-
- bool System.Collections.IList.IsReadOnly
- {
- get { return false; }
- }
-
- void System.Collections.IList.Remove(object value)
- {
- if (!(value is Acme.TestModel.Business.Objects.DoubleLinkOneOneChild))
- throw new System.Exception("The specified type is not valid!");
- var item = value as Acme.TestModel.Business.Objects.DoubleLinkOneOneChild;
- if (this.Contains(item))
- item.Delete();
- }
-
- void System.Collections.IList.RemoveAt(int index)
- {
- if ((0 <= index) && (index < this.Count))
- this[index].Delete();
- }
-
- object System.Collections.IList.this[int index]
- {
- get { return this[index]; }
- set { throw new System.NotImplementedException(); }
- }
-
- #endregion
-
- /// <summary>
- /// Takes an IVisitor object and iterates through each item in this collection
- /// </summary>
- /// <param name="visitor">The object that processes each collection item</param>
- public virtual void ProcessVisitor(IVisitor visitor)
- {
- if (visitor == null) throw new Exception("This object cannot be null.");
- lock(this)
- {
- foreach (IBusinessObject item in this)
- {
- visitor.Visit(item);
- }
- }
- }
-
- #region Static SQL Methods
-
- internal static string GetFieldAliasFromFieldNameSqlMapping(string alias)
- {
- alias = alias.Replace("[", string.Empty).Replace("]", string.Empty);
- switch (alias.ToLower())
- {
- case "double_link_child_key1": return "doublelinkchildkey1";
- case "double_link_child_key2": return "doublelinkchildkey2";
- case "double_link_parent_key1": return "doublelinkparentkey1";
- case "double_link_parent_key2": return "doublelinkparentkey2";
- case "qqq": return "qqq";
- case "created_date": return "createddate";
- case "created_by": return "createdby";
- case "modified_date": return "modifieddate";
- case "modified_by": return "modifiedby";
- case "time_stamp": return "timestamp";
- default: throw new Exception("The select clause is not valid.");
- }
- }
-
- internal static string GetTableFromFieldAliasSqlMapping(string alias)
- {
- switch (alias.ToLower())
- {
- case "doublelinkchildkey1": return "DOUBLE_LINK_ONE_ONE_CHILD";
- case "doublelinkchildkey2": return "DOUBLE_LINK_ONE_ONE_CHILD";
- case "doublelinkparentkey1": return "DOUBLE_LINK_ONE_ONE_CHILD";
- case "doublelinkparentkey2": return "DOUBLE_LINK_ONE_ONE_CHILD";
- case "qqq": return "DOUBLE_LINK_ONE_ONE_CHILD";
- case "createdby": return "DOUBLE_LINK_ONE_ONE_CHILD";
- case "createddate": return "DOUBLE_LINK_ONE_ONE_CHILD";
- case "modifiedby": return "DOUBLE_LINK_ONE_ONE_CHILD";
- case "modifieddate": return "DOUBLE_LINK_ONE_ONE_CHILD";
- case "timestamp": return "DOUBLE_LINK_ONE_ONE_CHILD";
- default: throw new Exception("The select clause is not valid.");
- }
- }
-
- internal static string GetTableFromFieldNameSqlMapping(string field)
- {
- switch (field.ToLower())
- {
- case "double_link_child_key1": return "DOUBLE_LINK_ONE_ONE_CHILD";
- case "double_link_child_key2": return "DOUBLE_LINK_ONE_ONE_CHILD";
- case "double_link_parent_key1": return "DOUBLE_LINK_ONE_ONE_CHILD";
- case "double_link_parent_key2": return "DOUBLE_LINK_ONE_ONE_CHILD";
- case "qqq": return "DOUBLE_LINK_ONE_ONE_CHILD";
- case "created_by": return "DOUBLE_LINK_ONE_ONE_CHILD";
- case "created_date": return "DOUBLE_LINK_ONE_ONE_CHILD";
- case "modified_by": return "DOUBLE_LINK_ONE_ONE_CHILD";
- case "modified_date": return "DOUBLE_LINK_ONE_ONE_CHILD";
- case "time_stamp": return "DOUBLE_LINK_ONE_ONE_CHILD";
- default: throw new Exception("The select clause is not valid.");
- }
- }
-
- internal static string GetRemappedLinqSql(string sql, string parentAlias, LinqSQLFromClauseCollection childTables)
- {
- 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);
- 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);
- 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);
- 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);
- sql = System.Text.RegularExpressions.Regex.Replace(sql, "\\[" + parentAlias + "\\]\\.\\[qqq\\]", "[" + childTables.GetBaseAliasTable(parentAlias, "DOUBLE_LINK_ONE_ONE_CHILD") + "].[qqq]", RegexOptions.IgnoreCase);
- sql = System.Text.RegularExpressions.Regex.Replace(sql, "\\[" + parentAlias + "\\]\\.\\[createdby\\]", "[" + childTables.GetBaseAliasTable(parentAlias, "DOUBLE_LINK_ONE_ONE_CHILD") + "].[createdby]", RegexOptions.IgnoreCase);
- sql = System.Text.RegularExpressions.Regex.Replace(sql, "\\[" + parentAlias + "\\]\\.\\[createddate\\]", "[" + childTables.GetBaseAliasTable(parentAlias, "DOUBLE_LINK_ONE_ONE_CHILD") + "].[createddate]", RegexOptions.IgnoreCase);
- sql = System.Text.RegularExpressions.Regex.Replace(sql, "\\[" + parentAlias + "\\]\\.\\[modifiedby\\]", "[" + childTables.GetBaseAliasTable(parentAlias, "DOUBLE_LINK_ONE_ONE_CHILD") + "].[modifiedby]", RegexOptions.IgnoreCase);
- sql = System.Text.RegularExpressions.Regex.Replace(sql, "\\[" + parentAlias + "\\]\\.\\[modifieddate\\]", "[" + childTables.GetBaseAliasTable(parentAlias, "DOUBLE_LINK_ONE_ONE_CHILD") + "].[modifieddate]", RegexOptions.IgnoreCase);
- sql = System.Text.RegularExpressions.Regex.Replace(sql, "\\[" + parentAlias + "\\]\\.\\[timestamp\\]", "[" + childTables.GetBaseAliasTable(parentAlias, "DOUBLE_LINK_ONE_ONE_CHILD") + "].[timestamp]", RegexOptions.IgnoreCase);
- return sql;
- }
-
- internal static string GetPagedSQL(List<LinqSQLField> fieldList, LinqSQLFromClauseCollection fromLinkList, string whereClause, object paging, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- var sb = new StringBuilder();
- var paging2 = (DoubleLinkOneOneChildPaging)paging;
-
- //Calculate the SELECT clause
- sb.Append("SELECT ");
- int index = 0;
- foreach (LinqSQLField field in fieldList)
- {
- sb.Append("[t0].[" + field.Name + "]");
- if (index < fieldList.Count - 1) sb.Append(", ");
- index++;
- }
- sb.AppendLine();
- sb.AppendLine("FROM (");
-
- //Calculate the Inner SELECT clause
- sb.Append("SELECT ");
- index = 0;
- foreach (var field in fieldList)
- {
- sb.Append(field.GetSQL(false));
- if (index < fieldList.Count - 1) sb.Append(", ");
- index++;
- }
- sb.AppendLine();
-
- //If there is no sort then add primary key
- if (paging2.OrderByList.Count == 0)
- {
- paging2.OrderByList.Add(new DoubleLinkOneOneChildPagingFieldItem(DoubleLinkOneOneChild.FieldNameConstants.DoubleLinkChildKey1));
- paging2.OrderByList.Add(new DoubleLinkOneOneChildPagingFieldItem(DoubleLinkOneOneChild.FieldNameConstants.DoubleLinkChildKey2));
- }
-
- //Determine the paging sort
- var isPrimary = false;
- var orderByClause = string.Empty;
- foreach (var fieldItem in paging2.OrderByList)
- {
- if (!string.IsNullOrEmpty(orderByClause)) orderByClause += ", ";
- switch (fieldItem.Field.ToString().ToLower())
- {
- 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;
- 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;
- 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;
- 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;
- 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;
- case "createddate": orderByClause += "[t0].[created_date]" + (fieldItem.Ascending ? string.Empty : " DESC"); break;
- case "createdby": orderByClause += "[t0].[created_by]" + (fieldItem.Ascending ? string.Empty : " DESC"); break;
- case "modifieddate": orderByClause += "[t0].[modified_date]" + (fieldItem.Ascending ? string.Empty : " DESC"); break;
- case "modifiedby": orderByClause += "[t0].[modified_by]" + (fieldItem.Ascending ? string.Empty : " DESC"); break;
- case "timestamp": orderByClause += "[t0].[time_stamp]" + (fieldItem.Ascending ? string.Empty : " DESC"); break;
- default: throw new Exception("The order by clause is not valid.");
- }
- }
-
- //Get the primary key for predictable sorts
- string primarySortKey = string.Empty;
-
- sb.AppendLine(", ROW_NUMBER() OVER (ORDER BY " + orderByClause + ((primarySortKey == string.Empty) || ((isPrimary && (!string.IsNullOrEmpty(primarySortKey)))) ? string.Empty : ", " + primarySortKey) + ") AS Row");
- //Calculate the FROM clause
- index = 0;
- sb.Append("FROM ");
- foreach (LinqSQLFromClause fromClause in fromLinkList)
- {
- sb.Append("[" + fromClause.Schema + "].[" + fromClause.TableName + "] AS [" + fromClause.Alias + "] ");
- if (optimizer.NoLocking) sb.Append("WITH (NOLOCK)");
- if (!string.IsNullOrEmpty(fromClause.LinkClause)) sb.Append(fromClause.LinkClause + " ");
-
- if (index < fromLinkList.Count - 1)
- {
- sb.AppendLine();
- sb.Append("LEFT OUTER JOIN ");
- }
-
- index++;
- }
- sb.AppendLine();
-
- //Calculate the WHERE clause
- if (!string.IsNullOrEmpty(whereClause))
- {
- foreach (LinqSQLFromClause fromClause in fromLinkList)
- {
- //Only process table that were original and not inserted above
- if (fromClause.AnchorAlias == string.Empty)
- {
- whereClause = LinqSQLParser.GetRemappedLinqSql(fromClause, whereClause, fromLinkList, LinqSQLParser.ObjectTypeConstants.Table);
- }
- }
- sb.Append("WHERE " + whereClause);
- }
-
- sb.AppendLine(") AS [t0]");
- sb.AppendLine("WHERE (Row >= " + (((paging2.PageIndex - 1) * paging2.RecordsperPage) + 1) + ") AND (Row <= " + (paging2.PageIndex * paging2.RecordsperPage) + ")");
-
- return sb.ToString();
- }
-
- #endregion
-
- /// <summary>
- /// Persists this collection to store.
- /// </summary>
- public override void Persist()
- {
- try
- {
- foreach (DoubleLinkOneOneChild item in this)
- {
- if (item.wrappedClass.RowState != DataRowState.Unchanged)
- item.OnValidate(new BusinessObjectEventArgs(item));
- }
-
- lock (wrappedClass.SubDomain)
- {
- wrappedClass.Persist();
- }
- }
- catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
- 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; }
- catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
- }
-
- /// <summary>
- /// Select all objects from store.
- /// </summary>
- public static DoubleLinkOneOneChildCollection RunSelect()
- {
- return RunSelect(ConfigurationValues.GetInstance().Modifier);
- }
-
- /// <summary>
- /// Select all objects from store.
- /// </summary>
- public static DoubleLinkOneOneChildCollection RunSelect(string modifier)
- {
- try
- {
- var returnVal = new DoubleLinkOneOneChildCollection(DomainDoubleLinkOneOneChildCollection.RunSelect(modifier));
- return returnVal;
- }
- catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
- 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; }
- catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
- }
-
- /// <summary>
- /// Using the specified Where expression, execute a query against the database to return a result set
- /// </summary>
- /// <param name="where">The expression that determines the records selected</param>
- public static DoubleLinkOneOneChildCollection RunSelect(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
- {
- return RunSelect(where, ConfigurationValues.GetInstance().Modifier);
- }
-
- /// <summary>
- /// Using the specified Where expression, execute a query against the database to return a result set
- /// </summary>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="modifier">The modified audit trail</param>
- public static DoubleLinkOneOneChildCollection RunSelect(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, string modifier)
- {
- return RunSelect(where, new QueryOptimizer(), modifier);
- }
-
- /// <summary>
- /// Using the specified Where expression, execute a query against the database to return a result set
- /// </summary>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- /// <param name="modifier">The modified audit trail</param>
- public static DoubleLinkOneOneChildCollection RunSelect(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer, string modifier)
- {
- var subDomain = new SubDomain(modifier);
- var dc = new DataContext(ConfigurationValues.GetInstance().ConnectionString);
- var template = dc.GetTable<DoubleLinkOneOneChildQuery>();
- var cmd = BusinessCollectionPersistableBase.GetCommand<DoubleLinkOneOneChildQuery>(dc, template, where);
- cmd.CommandTimeout = ConfigurationValues.GetInstance().DefaultTimeOut;
- var parser = LinqSQLParser.Create(cmd.CommandText, LinqSQLParser.ObjectTypeConstants.Table);
- cmd.CommandText = parser.GetSQL(optimizer);
- dc.Connection.Open();
- var startTime = DateTime.Now;
- var result = dc.Translate<DoubleLinkOneOneChildQuery>(cmd.ExecuteReader());
- var endTime = DateTime.Now;
- optimizer.TotalMilliseconds = (long)endTime.Subtract(startTime).TotalMilliseconds;
- var retval = subDomain.GetCollection<DoubleLinkOneOneChildCollection>();
- var pkList = new HashSet<string>();
- foreach (var item in result)
- {
- var pk = item.SinglePrimaryKeyValue();
- if (!pkList.Contains(pk))
- {
- pkList.Add(pk);
- var newItem = retval.NewItem(item.DoubleLinkChildKey1, item.DoubleLinkChildKey2);
- LoadDataRow(item, newItem);
- retval.AddItem(newItem);
- }
- }
- retval.wrappedClass.AcceptChanges();
- retval.wrappedClass.EndLoadData();
- dc.Connection.Close();
- return retval;
- }
-
- /// <summary>
- /// Using the specified Where expression, execute a query against the database to return a result set
- /// </summary>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="paging">The paging object to determine how the results are paged.</param>
- public static DoubleLinkOneOneChildCollection RunSelect(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Acme.TestModel.Business.Objects.DoubleLinkOneOneChildPaging paging)
- {
- return RunSelect(where, paging, ConfigurationValues.GetInstance().Modifier);
- }
-
- /// <summary>
- /// Using the specified Where expression, execute a query against the database to return a result set
- /// </summary>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="paging">The paging object to determine how the results are paged.</param>
- /// <param name="modifier">The modified audit trail</param>
- public static DoubleLinkOneOneChildCollection RunSelect(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Acme.TestModel.Business.Objects.DoubleLinkOneOneChildPaging paging, string modifier)
- {
- return RunSelect(where, paging, new QueryOptimizer(), modifier);
- }
-
- /// <summary>
- /// Using the specified Where expression, execute a query against the database to return a result set
- /// </summary>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="paging">The paging object to determine how the results are paged.</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- /// <param name="modifier">The modified audit trail</param>
- 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)
- {
- if (paging == null) throw new Exception("The paging object cannot be null.");
- var subDomain = new SubDomain(modifier);
-
- var dc = new DataContext(ConfigurationValues.GetInstance().ConnectionString);
- var template = dc.GetTable<DoubleLinkOneOneChildQuery>();
- var cmd = BusinessCollectionPersistableBase.GetCommand<DoubleLinkOneOneChildQuery>(dc, template, where);
- cmd.CommandTimeout = ConfigurationValues.GetInstance().DefaultTimeOut;
- var parser = LinqSQLParser.Create(cmd.CommandText, paging, LinqSQLParser.ObjectTypeConstants.Table);
- cmd.CommandText = parser.GetSQL(optimizer);
- dc.Connection.Open();
- var startTime = DateTime.Now;
- var result = dc.Translate<DoubleLinkOneOneChildQuery>(cmd.ExecuteReader());
- var endTime = DateTime.Now;
- optimizer.TotalMilliseconds = (long)endTime.Subtract(startTime).TotalMilliseconds;
- var retval = subDomain.GetCollection<DoubleLinkOneOneChildCollection>();
- var pkList = new HashSet<string>();
- foreach (var item in result)
- {
- var pk = item.SinglePrimaryKeyValue();
- if (!pkList.Contains(pk))
- {
- pkList.Add(pk);
- var newItem = retval.NewItem(item.DoubleLinkChildKey1, item.DoubleLinkChildKey2);
- LoadDataRow(item, newItem);
- retval.AddItem(newItem);
- }
- }
- retval.wrappedClass.AcceptChanges();
- retval.wrappedClass.EndLoadData();
- dc.Connection.Close();
- paging.RecordCount = GetCount(where);
- return retval;
- }
-
- private static void LoadDataRow(DoubleLinkOneOneChildQuery item, DoubleLinkOneOneChild newItem)
- {
- newItem.wrappedClass["double_link_parent_key1"] = item.DoubleLinkParentKey1;
- newItem.wrappedClass["double_link_child_key2"] = item.DoubleLinkChildKey2;
- newItem.wrappedClass["double_link_parent_key2"] = item.DoubleLinkParentKey2;
- newItem.wrappedClass["double_link_child_key1"] = item.DoubleLinkChildKey1;
- newItem.wrappedClass["qqq"] = StringHelper.ConvertToDatabase(item.Qqq);
- newItem.wrappedClass["CreatedDate"] = StringHelper.ConvertToDatabase(item.CreatedDate);
- newItem.wrappedClass["CreatedBy"] = StringHelper.ConvertToDatabase(item.CreatedBy);
- newItem.wrappedClass["ModifiedDate"] = StringHelper.ConvertToDatabase(item.ModifiedDate);
- newItem.wrappedClass["ModifiedBy"] = StringHelper.ConvertToDatabase(item.ModifiedBy);
- newItem.wrappedClass["TimeStamp"] = item.TimeStamp;
- }
-
- /// <summary>
- /// Get the maximum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static int? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, int>> select)
- {
- return GetMax(select, x => true);
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static int? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, int>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
- {
- return GetMax(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- 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)
- {
- return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, int>.GetMax(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the maximum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static int? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, int?>> select)
- {
- return GetMax(select, x => true);
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static int? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, int?>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
- {
- return GetMax(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- 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)
- {
- return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, int?>.GetMax(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the maximum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static Single? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, Single>> select)
- {
- return GetMax(select, x => true);
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static Single? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, Single>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
- {
- return GetMax(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- 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)
- {
- return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, Single>.GetMax(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the maximum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static Single? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, Single?>> select)
- {
- return GetMax(select, x => true);
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static Single? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, Single?>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
- {
- return GetMax(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- 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)
- {
- return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, Single?>.GetMax(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the maximum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static double? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, double>> select)
- {
- return GetMax(select, x => true);
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static double? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, double>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
- {
- return GetMax(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- 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)
- {
- return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, double>.GetMax(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the maximum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static double? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, double?>> select)
- {
- return GetMax(select, x => true);
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static double? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, double?>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
- {
- return GetMax(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- 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)
- {
- return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, double?>.GetMax(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the maximum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static decimal? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, decimal>> select)
- {
- return GetMax(select, x => true);
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static decimal? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, decimal>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
- {
- return GetMax(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- 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)
- {
- return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, decimal>.GetMax(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the maximum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static decimal? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, decimal?>> select)
- {
- return GetMax(select, x => true);
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static decimal? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, decimal?>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
- {
- return GetMax(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- 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)
- {
- return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, decimal?>.GetMax(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the maximum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static string GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, string>> select)
- {
- return GetMax(select, x => true);
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static string GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, string>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
- {
- return GetMax(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- 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)
- {
- return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, string>.GetMax(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the maximum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static DateTime? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, DateTime>> select)
- {
- return GetMax(select, x => true);
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static DateTime? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, DateTime>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
- {
- return GetMax(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static DateTime? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, DateTime>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, DateTime>.GetMax(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the maximum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static DateTime? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, DateTime?>> select)
- {
- return GetMax(select, x => true);
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static DateTime? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, DateTime?>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
- {
- return GetMax(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static DateTime? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, DateTime?>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, DateTime?>.GetMax(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the minimum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static int? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, int>> select)
- {
- return GetMin(select, x => true);
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static int? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, int>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
- {
- return GetMin(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static int? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, int>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, int>.GetMin(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the minimum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static int? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, int?>> select)
- {
- return GetMin(select, x => true);
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static int? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, int?>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
- {
- return GetMin(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static int? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, int?>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, int?>.GetMin(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the minimum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static Single? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, Single>> select)
- {
- return GetMin(select, x => true);
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static Single? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, Single>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
- {
- return GetMin(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static Single? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, Single>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, Single>.GetMin(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the minimum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static Single? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, Single?>> select)
- {
- return GetMin(select, x => true);
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static Single? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, Single?>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
- {
- return GetMin(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static Single? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, Single?>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, Single?>.GetMin(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the minimum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static double? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, double>> select)
- {
- return GetMin(select, x => true);
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static double? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, double>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
- {
- return GetMin(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static double? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, double>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, double>.GetMin(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the minimum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static double? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, double?>> select)
- {
- return GetMin(select, x => true);
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static double? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, double?>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
- {
- return GetMin(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static double? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, double?>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, double?>.GetMin(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the minimum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static decimal? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, decimal>> select)
- {
- return GetMin(select, x => true);
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static decimal? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, decimal>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
- {
- return GetMin(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static decimal? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, decimal>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<DoubleLinkOneOneChild, DoubleLinkOneOneChildQuery, decimal>.GetMin(select, where, optimizer, "DOUBLE_LINK_ONE_ONE_CHILD", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the minimum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static decimal? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, decimal?>> select)
- {
- return GetMin(select, x => true);
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static decimal? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, decimal?>> select, Expression<Func<Acme.TestModel.Business.LINQ.DoubleLinkOneOneChildQuery, bool>> where)
- {
- return GetMin(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- //