//---------------------------------------------------------------------------------------------------
// <auto-generated>
//    This code was generated by T4Model template for T4 (https://github.com/linq2db/linq2db).
//    Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
// </auto-generated>
//---------------------------------------------------------------------------------------------------

#pragma warning disable 1573, 1591
#nullable enable

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;

using LinqToDB;
using LinqToDB.Common;
using LinqToDB.Configuration;
using LinqToDB.Data;
using LinqToDB.Mapping;

namespace OracleDataContext
{
	public partial class XeDB : LinqToDB.Data.DataConnection
	{
		public ITable<AllType>             AllTypes            { get { return this.GetTable<AllType>(); } }
		public ITable<BINARYDATA>          Binarydatas         { get { return this.GetTable<BINARYDATA>(); } }
		public ITable<Child>               Children            { get { return this.GetTable<Child>(); } }
		public ITable<CollatedTable>       CollatedTables      { get { return this.GetTable<CollatedTable>(); } }
		public ITable<DataTypeTest>        DataTypeTests       { get { return this.GetTable<DataTypeTest>(); } }
		public ITable<DecimalOverflow>     DecimalOverflows    { get { return this.GetTable<DecimalOverflow>(); } }
		public ITable<Doctor>              Doctors             { get { return this.GetTable<Doctor>(); } }
		public ITable<GrandChild>          GrandChildren       { get { return this.GetTable<GrandChild>(); } }
		public ITable<InheritanceChild>    InheritanceChildren { get { return this.GetTable<InheritanceChild>(); } }
		public ITable<InheritanceParent>   InheritanceParents  { get { return this.GetTable<InheritanceParent>(); } }
		public ITable<LinqDataType>        LinqDataTypes       { get { return this.GetTable<LinqDataType>(); } }
		public ITable<LINQDATATYPESBC>     Linqdatatypesbcs    { get { return this.GetTable<LINQDATATYPESBC>(); } }
		public ITable<LongRawTable>        LongRawTables       { get { return this.GetTable<LongRawTable>(); } }
		public ITable<Parent>              Parents             { get { return this.GetTable<Parent>(); } }
		public ITable<Patient>             Patients            { get { return this.GetTable<Patient>(); } }
		public ITable<Person>              People              { get { return this.GetTable<Person>(); } }
		/// <summary>
		/// This is matview
		/// </summary>
		public ITable<SchemaTestMatView>   SchemaTestMatViews  { get { return this.GetTable<SchemaTestMatView>(); } }
		/// <summary>
		/// This is table
		/// </summary>
		public ITable<SchemaTestTable>     SchemaTestTables    { get { return this.GetTable<SchemaTestTable>(); } }
		public ITable<SchemaTestView>      SchemaTestViews     { get { return this.GetTable<SchemaTestView>(); } }
		public ITable<SEQUENCETEST>        Sequencetests       { get { return this.GetTable<SEQUENCETEST>(); } }
		public ITable<StgTradeInformation> StgTradeInformation { get { return this.GetTable<StgTradeInformation>(); } }
		public ITable<StringTest>          StringTests         { get { return this.GetTable<StringTest>(); } }
		public ITable<TEntity>             TEntities           { get { return this.GetTable<TEntity>(); } }
		public ITable<TestIdentity>        TestIdentities      { get { return this.GetTable<TestIdentity>(); } }
		public ITable<TestMerge1>          TestMerge1          { get { return this.GetTable<TestMerge1>(); } }
		public ITable<TestMerge2>          TestMerge2          { get { return this.GetTable<TestMerge2>(); } }
		public ITable<TTestUser>           TTestUsers          { get { return this.GetTable<TTestUser>(); } }
		public ITable<TTestUserContract>   TTestUserContracts  { get { return this.GetTable<TTestUserContract>(); } }

		public XeDB()
		{
			InitDataContext();
			InitMappingSchema();
		}

		public XeDB(string configuration)
			: base(configuration)
		{
			InitDataContext();
			InitMappingSchema();
		}

		public XeDB(DataOptions options)
			: base(options)
		{
			InitDataContext();
			InitMappingSchema();
		}

		public XeDB(DataOptions<XeDB> options)
			: base(options.Options)
		{
			InitDataContext();
			InitMappingSchema();
		}

		partial void InitDataContext  ();
		partial void InitMappingSchema();

		#region Table Functions

		#region TestPACKAGE1TestTableFunction

		[Sql.TableFunction(Schema="MANAGED", Package="TEST_PACKAGE1", Name="TEST_TABLE_FUNCTION")]
		public ITable<TestTableFUNCTIONResult> TestPACKAGE1TestTableFunction(decimal? i)
		{
			return this.GetTable<TestTableFUNCTIONResult>(this, (MethodInfo)MethodBase.GetCurrentMethod()!,
				i);
		}

		public partial class TestTableFUNCTIONResult
		{
			public decimal? O { get; set; }
		}

		#endregion

		#region TestPACKAGE2TestTableFunction

		[Sql.TableFunction(Schema="MANAGED", Package="TEST_PACKAGE2", Name="TEST_TABLE_FUNCTION")]
		public ITable<TestTableFUNCTIONResult0> TestPACKAGE2TestTableFunction(decimal? i)
		{
			return this.GetTable<TestTableFUNCTIONResult0>(this, (MethodInfo)MethodBase.GetCurrentMethod()!,
				i);
		}

		public partial class TestTableFUNCTIONResult0
		{
			public decimal? O { get; set; }
		}

		#endregion

		#region TestTableFunction

		[Sql.TableFunction(Schema="MANAGED", Name="TEST_TABLE_FUNCTION")]
		public ITable<TestTableFUNCTIONResult1> TestTableFunction(decimal? i)
		{
			return this.GetTable<TestTableFUNCTIONResult1>(this, (MethodInfo)MethodBase.GetCurrentMethod()!,
				i);
		}

		public partial class TestTableFUNCTIONResult1
		{
			public decimal? O { get; set; }
		}

		#endregion

		#endregion
	}

	[Table(Schema="MANAGED", Name="AllTypes")]
	public partial class AllType
	{
		[Column(                          DbType="NUMBER",                            DataType=LinqToDB.DataType.Decimal,        Length=22, Scale=0),               PrimaryKey,  NotNull] public decimal         ID                     { get; set; } // NUMBER
		[Column("bigintDataType",         DbType="NUMBER (20,0)",                     DataType=LinqToDB.DataType.Decimal,        Length=22, Precision=20, Scale=0),    Nullable         ] public decimal?        BigintDataType         { get; set; } // NUMBER (20,0)
		[Column("numericDataType",        DbType="NUMBER",                            DataType=LinqToDB.DataType.Decimal,        Length=22, Scale=0),                  Nullable         ] public decimal?        NumericDataType        { get; set; } // NUMBER
		[Column("bitDataType",            DbType="NUMBER (1,0)",                      DataType=LinqToDB.DataType.Decimal,        Length=22, Precision=1, Scale=0),     Nullable         ] public sbyte?          BitDataType            { get; set; } // NUMBER (1,0)
		[Column("smallintDataType",       DbType="NUMBER (5,0)",                      DataType=LinqToDB.DataType.Decimal,        Length=22, Precision=5, Scale=0),     Nullable         ] public int?            SmallintDataType       { get; set; } // NUMBER (5,0)
		[Column("decimalDataType",        DbType="NUMBER",                            DataType=LinqToDB.DataType.Decimal,        Length=22, Scale=6),                  Nullable         ] public decimal?        DecimalDataType        { get; set; } // NUMBER
		[Column("smallmoneyDataType",     DbType="NUMBER (10,4)",                     DataType=LinqToDB.DataType.Decimal,        Length=22, Precision=10, Scale=4),    Nullable         ] public decimal?        SmallmoneyDataType     { get; set; } // NUMBER (10,4)
		[Column("intDataType",            DbType="NUMBER (10,0)",                     DataType=LinqToDB.DataType.Decimal,        Length=22, Precision=10, Scale=0),    Nullable         ] public long?           IntDataType            { get; set; } // NUMBER (10,0)
		[Column("tinyintDataType",        DbType="NUMBER (3,0)",                      DataType=LinqToDB.DataType.Decimal,        Length=22, Precision=3, Scale=0),     Nullable         ] public short?          TinyintDataType        { get; set; } // NUMBER (3,0)
		[Column("moneyDataType",          DbType="NUMBER",                            DataType=LinqToDB.DataType.Decimal,        Length=22),                           Nullable         ] public decimal?        MoneyDataType          { get; set; } // NUMBER
		[Column("floatDataType",          DbType="BINARY_DOUBLE",                     DataType=LinqToDB.DataType.Double,         Length=8),                            Nullable         ] public double?         FloatDataType          { get; set; } // BINARY_DOUBLE
		[Column("realDataType",           DbType="BINARY_FLOAT",                      DataType=LinqToDB.DataType.Single,         Length=4),                            Nullable         ] public float?          RealDataType           { get; set; } // BINARY_FLOAT
		[Column("datetimeDataType",       DbType="DATE",                              DataType=LinqToDB.DataType.DateTime,       Length=7),                            Nullable         ] public DateTime?       DatetimeDataType       { get; set; } // DATE
		[Column("datetime2DataType",      DbType="TIMESTAMP(6)",                      DataType=LinqToDB.DataType.DateTime2,      Length=11, Scale=6),                  Nullable         ] public DateTime?       Datetime2DataType      { get; set; } // TIMESTAMP(6)
		[Column("datetimeoffsetDataType", DbType="TIMESTAMP(6) WITH TIME ZONE",       DataType=LinqToDB.DataType.DateTimeOffset, Length=13, Scale=6),                  Nullable         ] public DateTimeOffset? DatetimeoffsetDataType { get; set; } // TIMESTAMP(6) WITH TIME ZONE
		[Column("localZoneDataType",      DbType="TIMESTAMP(6) WITH LOCAL TIME ZONE", DataType=LinqToDB.DataType.DateTimeOffset, Length=11, Scale=6),                  Nullable         ] public DateTimeOffset? LocalZoneDataType      { get; set; } // TIMESTAMP(6) WITH LOCAL TIME ZONE
		[Column("charDataType",           DbType="CHAR(1)",                           DataType=LinqToDB.DataType.Char,           Length=1),                            Nullable         ] public char?           CharDataType           { get; set; } // CHAR(1)
		[Column("char20DataType",         DbType="CHAR(20)",                          DataType=LinqToDB.DataType.Char,           Length=20),                           Nullable         ] public string?         Char20DataType         { get; set; } // CHAR(20)
		[Column("varcharDataType",        DbType="VARCHAR2(20)",                      DataType=LinqToDB.DataType.VarChar,        Length=20),                           Nullable         ] public string?         VarcharDataType        { get; set; } // VARCHAR2(20)
		[Column("textDataType",           DbType="CLOB",                              DataType=LinqToDB.DataType.Text,           Length=4000),                         Nullable         ] public string?         TextDataType           { get; set; } // CLOB
		[Column("ncharDataType",          DbType="NCHAR(20)",                         DataType=LinqToDB.DataType.NChar,          Length=20),                           Nullable         ] public string?         NcharDataType          { get; set; } // NCHAR(20)
		[Column("nvarcharDataType",       DbType="NVARCHAR2(20)",                     DataType=LinqToDB.DataType.NVarChar,       Length=20),                           Nullable         ] public string?         NvarcharDataType       { get; set; } // NVARCHAR2(20)
		[Column("ntextDataType",          DbType="NCLOB",                             DataType=LinqToDB.DataType.NText,          Length=4000),                         Nullable         ] public string?         NtextDataType          { get; set; } // NCLOB
		[Column("binaryDataType",         DbType="BLOB",                              DataType=LinqToDB.DataType.Blob,           Length=4000),                         Nullable         ] public byte[]?         BinaryDataType         { get; set; } // BLOB
		[Column("bfileDataType",          DbType="BFILE",                             DataType=LinqToDB.DataType.VarBinary,      Length=530),                          Nullable         ] public byte[]?         BfileDataType          { get; set; } // BFILE
		[Column("guidDataType",           DbType="RAW(16)",                           DataType=LinqToDB.DataType.Binary,         Length=16),                           Nullable         ] public byte[]?         GuidDataType           { get; set; } // RAW(16)
		[Column("longDataType",           DbType="LONG",                              DataType=LinqToDB.DataType.Long,           Length=0),                            Nullable         ] public string?         LongDataType           { get; set; } // LONG
		[Column("xmlDataType",            DbType="XMLTYPE",                           DataType=LinqToDB.DataType.Xml,            Length=2000),                         Nullable         ] public string?         XmlDataType            { get; set; } // XMLTYPE
	}

	[Table(Schema="MANAGED", Name="BINARYDATA")]
	public partial class BINARYDATA
	{
		[Column(DbType="NUMBER",       DataType=LinqToDB.DataType.Decimal,   Length=22),          PrimaryKey, NotNull] public decimal  BINARYDATAID { get; set; } // NUMBER
		[Column(DbType="TIMESTAMP(6)", DataType=LinqToDB.DataType.DateTime2, Length=11, Scale=6),             NotNull] public DateTime STAMP        { get; set; } // TIMESTAMP(6)
		[Column(DbType="BLOB",         DataType=LinqToDB.DataType.Blob,      Length=4000),                    NotNull] public byte[]   DATA         { get; set; } = null!; // BLOB
	}

	[Table(Schema="MANAGED", Name="Child")]
	public partial class Child
	{
		[Column(DbType="NUMBER", DataType=LinqToDB.DataType.Decimal, Length=22, Scale=0), Nullable] public decimal? ParentID { get; set; } // NUMBER
		[Column(DbType="NUMBER", DataType=LinqToDB.DataType.Decimal, Length=22, Scale=0), Nullable] public decimal? ChildID  { get; set; } // NUMBER
	}

	[Table(Schema="MANAGED", Name="CollatedTable")]
	public partial class CollatedTable
	{
		[Column(DbType="NUMBER",       DataType=LinqToDB.DataType.Decimal, Length=22, Scale=0), NotNull] public decimal Id              { get; set; } // NUMBER
		[Column(DbType="VARCHAR2(20)", DataType=LinqToDB.DataType.VarChar, Length=20),          NotNull] public string  CaseSensitive   { get; set; } = null!; // VARCHAR2(20)
		[Column(DbType="VARCHAR2(20)", DataType=LinqToDB.DataType.VarChar, Length=20),          NotNull] public string  CaseInsensitive { get; set; } = null!; // VARCHAR2(20)
	}

	[Table(Schema="MANAGED", Name="DataTypeTest")]
	public partial class DataTypeTest
	{
		[Column(             DbType="NUMBER",        DataType=LinqToDB.DataType.Decimal,  Length=22, Scale=0),               PrimaryKey,  NotNull] public decimal   DataTypeID { get; set; } // NUMBER
		[Column("Binary_",   DbType="RAW(50)",       DataType=LinqToDB.DataType.Binary,   Length=50),                           Nullable         ] public byte[]?   Binary     { get; set; } // RAW(50)
		[Column("Boolean_",  DbType="NUMBER (1,0)",  DataType=LinqToDB.DataType.Decimal,  Length=22, Precision=1, Scale=0),     Nullable         ] public sbyte?    Boolean    { get; set; } // NUMBER (1,0)
		[Column("Byte_",     DbType="NUMBER (3,0)",  DataType=LinqToDB.DataType.Decimal,  Length=22, Precision=3, Scale=0),     Nullable         ] public short?    Byte       { get; set; } // NUMBER (3,0)
		[Column("Bytes_",    DbType="BLOB",          DataType=LinqToDB.DataType.Blob,     Length=4000),                         Nullable         ] public byte[]?   Bytes      { get; set; } // BLOB
		[Column("Char_",     DbType="NCHAR(1)",      DataType=LinqToDB.DataType.NChar,    Length=1),                            Nullable         ] public char?     Char       { get; set; } // NCHAR(1)
		[Column("DateTime_", DbType="DATE",          DataType=LinqToDB.DataType.DateTime, Length=7),                            Nullable         ] public DateTime? DateTime   { get; set; } // DATE
		[Column("Decimal_",  DbType="NUMBER (19,5)", DataType=LinqToDB.DataType.Decimal,  Length=22, Precision=19, Scale=5),    Nullable         ] public decimal?  Decimal    { get; set; } // NUMBER (19,5)
		[Column("Double_",   DbType="FLOAT(126)",    DataType=LinqToDB.DataType.Decimal,  Length=22, Precision=126),            Nullable         ] public decimal?  Double     { get; set; } // FLOAT(126)
		[Column("Guid_",     DbType="RAW(16)",       DataType=LinqToDB.DataType.Binary,   Length=16),                           Nullable         ] public byte[]?   Guid       { get; set; } // RAW(16)
		[Column("Int16_",    DbType="NUMBER (5,0)",  DataType=LinqToDB.DataType.Decimal,  Length=22, Precision=5, Scale=0),     Nullable         ] public int?      Int16      { get; set; } // NUMBER (5,0)
		[Column("Int32_",    DbType="NUMBER (10,0)", DataType=LinqToDB.DataType.Decimal,  Length=22, Precision=10, Scale=0),    Nullable         ] public long?     Int32      { get; set; } // NUMBER (10,0)
		[Column("Int64_",    DbType="NUMBER (20,0)", DataType=LinqToDB.DataType.Decimal,  Length=22, Precision=20, Scale=0),    Nullable         ] public decimal?  Int64      { get; set; } // NUMBER (20,0)
		[Column("Money_",    DbType="NUMBER",        DataType=LinqToDB.DataType.Decimal,  Length=22),                           Nullable         ] public decimal?  Money      { get; set; } // NUMBER
		[Column("SByte_",    DbType="NUMBER (3,0)",  DataType=LinqToDB.DataType.Decimal,  Length=22, Precision=3, Scale=0),     Nullable         ] public short?    SByte      { get; set; } // NUMBER (3,0)
		[Column("Single_",   DbType="FLOAT(126)",    DataType=LinqToDB.DataType.Decimal,  Length=22, Precision=126),            Nullable         ] public decimal?  Single     { get; set; } // FLOAT(126)
		[Column("Stream_",   DbType="BLOB",          DataType=LinqToDB.DataType.Blob,     Length=4000),                         Nullable         ] public byte[]?   Stream     { get; set; } // BLOB
		[Column("String_",   DbType="NVARCHAR2(50)", DataType=LinqToDB.DataType.NVarChar, Length=50),                           Nullable         ] public string?   String     { get; set; } // NVARCHAR2(50)
		[Column("UInt16_",   DbType="NUMBER (5,0)",  DataType=LinqToDB.DataType.Decimal,  Length=22, Precision=5, Scale=0),     Nullable         ] public int?      UInt16     { get; set; } // NUMBER (5,0)
		[Column("UInt32_",   DbType="NUMBER (10,0)", DataType=LinqToDB.DataType.Decimal,  Length=22, Precision=10, Scale=0),    Nullable         ] public long?     UInt32     { get; set; } // NUMBER (10,0)
		[Column("UInt64_",   DbType="NUMBER (20,0)", DataType=LinqToDB.DataType.Decimal,  Length=22, Precision=20, Scale=0),    Nullable         ] public decimal?  UInt64     { get; set; } // NUMBER (20,0)
		[Column("Xml_",      DbType="XMLTYPE",       DataType=LinqToDB.DataType.Xml,      Length=2000),                         Nullable         ] public string?   Xml        { get; set; } // XMLTYPE
	}

	[Table(Schema="MANAGED", Name="DecimalOverflow")]
	public partial class DecimalOverflow
	{
		[Column(DbType="NUMBER (38,20)", DataType=LinqToDB.DataType.Decimal, Length=22, Precision=38, Scale=20), Nullable] public decimal? Decimal1 { get; set; } // NUMBER (38,20)
		[Column(DbType="NUMBER (31,2)",  DataType=LinqToDB.DataType.Decimal, Length=22, Precision=31, Scale=2),  Nullable] public decimal? Decimal2 { get; set; } // NUMBER (31,2)
		[Column(DbType="NUMBER (38,36)", DataType=LinqToDB.DataType.Decimal, Length=22, Precision=38, Scale=36), Nullable] public decimal? Decimal3 { get; set; } // NUMBER (38,36)
		[Column(DbType="NUMBER (29,0)",  DataType=LinqToDB.DataType.Decimal, Length=22, Precision=29, Scale=0),  Nullable] public decimal? Decimal4 { get; set; } // NUMBER (29,0)
		[Column(DbType="NUMBER (38,38)", DataType=LinqToDB.DataType.Decimal, Length=22, Precision=38, Scale=38), Nullable] public decimal? Decimal5 { get; set; } // NUMBER (38,38)
	}

	[Table(Schema="MANAGED", Name="Doctor")]
	public partial class Doctor
	{
		[Column(DbType="NUMBER",        DataType=LinqToDB.DataType.Decimal,  Length=22), PrimaryKey, NotNull] public decimal PersonID { get; set; } // NUMBER
		[Column(DbType="NVARCHAR2(50)", DataType=LinqToDB.DataType.NVarChar, Length=50),             NotNull] public string  Taxonomy { get; set; } = null!; // NVARCHAR2(50)

		#region Associations

		/// <summary>
		/// Fk_Doctor_Person (MANAGED.Person)
		/// </summary>
		[Association(ThisKey="PersonID", OtherKey="PersonID", CanBeNull=false)]
		public Person Person { get; set; } = null!;

		#endregion
	}

	[Table(Schema="MANAGED", Name="GrandChild")]
	public partial class GrandChild
	{
		[Column(DbType="NUMBER", DataType=LinqToDB.DataType.Decimal, Length=22, Scale=0), Nullable] public decimal? ParentID     { get; set; } // NUMBER
		[Column(DbType="NUMBER", DataType=LinqToDB.DataType.Decimal, Length=22, Scale=0), Nullable] public decimal? ChildID      { get; set; } // NUMBER
		[Column(DbType="NUMBER", DataType=LinqToDB.DataType.Decimal, Length=22, Scale=0), Nullable] public decimal? GrandChildID { get; set; } // NUMBER
	}

	[Table(Schema="MANAGED", Name="InheritanceChild")]
	public partial class InheritanceChild
	{
		[Column(DbType="NUMBER",        DataType=LinqToDB.DataType.Decimal,  Length=22), PrimaryKey,  NotNull] public decimal  InheritanceChildId  { get; set; } // NUMBER
		[Column(DbType="NUMBER",        DataType=LinqToDB.DataType.Decimal,  Length=22),              NotNull] public decimal  InheritanceParentId { get; set; } // NUMBER
		[Column(DbType="NUMBER",        DataType=LinqToDB.DataType.Decimal,  Length=22),    Nullable         ] public decimal? TypeDiscriminator   { get; set; } // NUMBER
		[Column(DbType="NVARCHAR2(50)", DataType=LinqToDB.DataType.NVarChar, Length=50),    Nullable         ] public string?  Name                { get; set; } // NVARCHAR2(50)
	}

	[Table(Schema="MANAGED", Name="InheritanceParent")]
	public partial class InheritanceParent
	{
		[Column(DbType="NUMBER",        DataType=LinqToDB.DataType.Decimal,  Length=22), PrimaryKey,  NotNull] public decimal  InheritanceParentId { get; set; } // NUMBER
		[Column(DbType="NUMBER",        DataType=LinqToDB.DataType.Decimal,  Length=22),    Nullable         ] public decimal? TypeDiscriminator   { get; set; } // NUMBER
		[Column(DbType="NVARCHAR2(50)", DataType=LinqToDB.DataType.NVarChar, Length=50),    Nullable         ] public string?  Name                { get; set; } // NVARCHAR2(50)
	}

	[Table(Schema="MANAGED", Name="LinqDataTypes")]
	public partial class LinqDataType
	{
		[Column(DbType="NUMBER",        DataType=LinqToDB.DataType.Decimal,   Length=22, Scale=0),               Nullable] public decimal?  ID             { get; set; } // NUMBER
		[Column(DbType="NUMBER (10,4)", DataType=LinqToDB.DataType.Decimal,   Length=22, Precision=10, Scale=4), Nullable] public decimal?  MoneyValue     { get; set; } // NUMBER (10,4)
		[Column(DbType="TIMESTAMP(6)",  DataType=LinqToDB.DataType.DateTime2, Length=11, Scale=6),               Nullable] public DateTime? DateTimeValue  { get; set; } // TIMESTAMP(6)
		[Column(DbType="TIMESTAMP(6)",  DataType=LinqToDB.DataType.DateTime2, Length=11, Scale=6),               Nullable] public DateTime? DateTimeValue2 { get; set; } // TIMESTAMP(6)
		[Column(DbType="NUMBER",        DataType=LinqToDB.DataType.Decimal,   Length=22, Scale=0),               Nullable] public decimal?  BoolValue      { get; set; } // NUMBER
		[Column(DbType="RAW(16)",       DataType=LinqToDB.DataType.Binary,    Length=16),                        Nullable] public byte[]?   GuidValue      { get; set; } // RAW(16)
		[Column(DbType="BLOB",          DataType=LinqToDB.DataType.Blob,      Length=4000),                      Nullable] public byte[]?   BinaryValue    { get; set; } // BLOB
		[Column(DbType="NUMBER",        DataType=LinqToDB.DataType.Decimal,   Length=22, Scale=0),               Nullable] public decimal?  SmallIntValue  { get; set; } // NUMBER
		[Column(DbType="NUMBER",        DataType=LinqToDB.DataType.Decimal,   Length=22, Scale=0),               Nullable] public decimal?  IntValue       { get; set; } // NUMBER
		[Column(DbType="NUMBER (20,0)", DataType=LinqToDB.DataType.Decimal,   Length=22, Precision=20, Scale=0), Nullable] public decimal?  BigIntValue    { get; set; } // NUMBER (20,0)
		[Column(DbType="VARCHAR2(50)",  DataType=LinqToDB.DataType.VarChar,   Length=50),                        Nullable] public string?   StringValue    { get; set; } // VARCHAR2(50)
	}

	[Table(Schema="MANAGED", Name="LINQDATATYPESBC")]
	public partial class LINQDATATYPESBC
	{
		[Column(DbType="NUMBER",        DataType=LinqToDB.DataType.Decimal,   Length=22, Scale=0),               Nullable] public decimal?  ID             { get; set; } // NUMBER
		[Column(DbType="NUMBER (10,4)", DataType=LinqToDB.DataType.Decimal,   Length=22, Precision=10, Scale=4), Nullable] public decimal?  MONEYVALUE     { get; set; } // NUMBER (10,4)
		[Column(DbType="TIMESTAMP(6)",  DataType=LinqToDB.DataType.DateTime2, Length=11, Scale=6),               Nullable] public DateTime? DATETIMEVALUE  { get; set; } // TIMESTAMP(6)
		[Column(DbType="TIMESTAMP(6)",  DataType=LinqToDB.DataType.DateTime2, Length=11, Scale=6),               Nullable] public DateTime? DATETIMEVALUE2 { get; set; } // TIMESTAMP(6)
		[Column(DbType="NUMBER",        DataType=LinqToDB.DataType.Decimal,   Length=22, Scale=0),               Nullable] public decimal?  BOOLVALUE      { get; set; } // NUMBER
		[Column(DbType="RAW(16)",       DataType=LinqToDB.DataType.Binary,    Length=16),                        Nullable] public byte[]?   GUIDVALUE      { get; set; } // RAW(16)
		[Column(DbType="NUMBER",        DataType=LinqToDB.DataType.Decimal,   Length=22, Scale=0),               Nullable] public decimal?  SMALLINTVALUE  { get; set; } // NUMBER
		[Column(DbType="NUMBER",        DataType=LinqToDB.DataType.Decimal,   Length=22, Scale=0),               Nullable] public decimal?  INTVALUE       { get; set; } // NUMBER
		[Column(DbType="NUMBER (20,0)", DataType=LinqToDB.DataType.Decimal,   Length=22, Precision=20, Scale=0), Nullable] public decimal?  BIGINTVALUE    { get; set; } // NUMBER (20,0)
		[Column(DbType="VARCHAR2(50)",  DataType=LinqToDB.DataType.VarChar,   Length=50),                        Nullable] public string?   STRINGVALUE    { get; set; } // VARCHAR2(50)
	}

	[Table(Schema="MANAGED", Name="LongRawTable")]
	public partial class LongRawTable
	{
		[Column(                   DbType="NUMBER",   DataType=LinqToDB.DataType.Decimal, Length=22), PrimaryKey,  NotNull] public decimal ID              { get; set; } // NUMBER
		[Column("longRawDataType", DbType="LONG RAW", DataType=LinqToDB.DataType.LongRaw, Length=0),     Nullable         ] public byte[]? LongRawDataType { get; set; } // LONG RAW
	}

	[Table(Schema="MANAGED", Name="Parent")]
	public partial class Parent
	{
		[Column(DbType="NUMBER", DataType=LinqToDB.DataType.Decimal, Length=22, Scale=0), Nullable] public decimal? ParentID { get; set; } // NUMBER
		[Column(DbType="NUMBER", DataType=LinqToDB.DataType.Decimal, Length=22, Scale=0), Nullable] public decimal? Value1   { get; set; } // NUMBER
	}

	[Table(Schema="MANAGED", Name="Patient")]
	public partial class Patient
	{
		[Column(DbType="NUMBER",         DataType=LinqToDB.DataType.Decimal,  Length=22),  PrimaryKey, NotNull] public decimal PersonID  { get; set; } // NUMBER
		[Column(DbType="NVARCHAR2(256)", DataType=LinqToDB.DataType.NVarChar, Length=256),             NotNull] public string  Diagnosis { get; set; } = null!; // NVARCHAR2(256)

		#region Associations

		/// <summary>
		/// Fk_Patient_Person (MANAGED.Person)
		/// </summary>
		[Association(ThisKey="PersonID", OtherKey="PersonID", CanBeNull=false)]
		public Person Person { get; set; } = null!;

		#endregion
	}

	[Table(Schema="MANAGED", Name="Person")]
	public partial class Person
	{
		[Column(DbType="NUMBER",       DataType=LinqToDB.DataType.Decimal, Length=22), PrimaryKey,  NotNull] public decimal PersonID   { get; set; } // NUMBER
		[Column(DbType="VARCHAR2(50)", DataType=LinqToDB.DataType.VarChar, Length=50),              NotNull] public string  FirstName  { get; set; } = null!; // VARCHAR2(50)
		[Column(DbType="VARCHAR2(50)", DataType=LinqToDB.DataType.VarChar, Length=50),              NotNull] public string  LastName   { get; set; } = null!; // VARCHAR2(50)
		[Column(DbType="VARCHAR2(50)", DataType=LinqToDB.DataType.VarChar, Length=50),    Nullable         ] public string? MiddleName { get; set; } // VARCHAR2(50)
		[Column(DbType="CHAR(1)",      DataType=LinqToDB.DataType.Char,    Length=1),               NotNull] public char    Gender     { get; set; } // CHAR(1)

		#region Associations

		/// <summary>
		/// Fk_Doctor_Person_BackReference (MANAGED.Doctor)
		/// </summary>
		[Association(ThisKey="PersonID", OtherKey="PersonID", CanBeNull=true)]
		public Doctor? FkDoctor { get; set; }

		/// <summary>
		/// Fk_Patient_Person_BackReference (MANAGED.Patient)
		/// </summary>
		[Association(ThisKey="PersonID", OtherKey="PersonID", CanBeNull=true)]
		public Patient? FkPatient { get; set; }

		#endregion
	}

	/// <summary>
	/// This is matview
	/// </summary>
	[Table(Schema="MANAGED", Name="SchemaTestMatView", IsView=true)]
	public partial class SchemaTestMatView
	{
		/// <summary>
		/// This is matview column
		/// </summary>
		[Column(DbType="NUMBER", DataType=LinqToDB.DataType.Decimal, Length=22), PrimaryKey, NotNull] public decimal Id { get; set; } // NUMBER
	}

	/// <summary>
	/// This is table
	/// </summary>
	[Table(Schema="MANAGED", Name="SchemaTestTable")]
	public partial class SchemaTestTable
	{
		/// <summary>
		/// This is column
		/// </summary>
		[Column(DbType="NUMBER", DataType=LinqToDB.DataType.Decimal, Length=22), PrimaryKey, NotNull] public decimal Id { get; set; } // NUMBER
	}

	[Table(Schema="MANAGED", Name="SchemaTestView", IsView=true)]
	public partial class SchemaTestView
	{
		/// <summary>
		/// This is view column
		/// </summary>
		[Column(DbType="NUMBER", DataType=LinqToDB.DataType.Decimal, Length=22), NotNull] public decimal Id { get; set; } // NUMBER
	}

	[Table(Schema="MANAGED", Name="SEQUENCETEST")]
	public partial class SEQUENCETEST
	{
		[Column(DbType="NUMBER",       DataType=LinqToDB.DataType.Decimal, Length=22, Scale=0), PrimaryKey, NotNull] public decimal ID    { get; set; } // NUMBER
		[Column(DbType="VARCHAR2(50)", DataType=LinqToDB.DataType.VarChar, Length=50),                      NotNull] public string  VALUE { get; set; } = null!; // VARCHAR2(50)
	}

	[Table(Schema="MANAGED", Name="STG_TRADE_INFORMATION")]
	public partial class StgTradeInformation
	{
		[Column("STG_TRADE_ID",          DbType="NUMBER",         DataType=LinqToDB.DataType.Decimal,  Length=22),   NotNull    ] public decimal   StgTradeId          { get; set; } // NUMBER
		[Column("STG_TRADE_VERSION",     DbType="NUMBER",         DataType=LinqToDB.DataType.Decimal,  Length=22),   NotNull    ] public decimal   StgTradeVersion     { get; set; } // NUMBER
		[Column("INFORMATION_TYPE_ID",   DbType="NUMBER",         DataType=LinqToDB.DataType.Decimal,  Length=22),   NotNull    ] public decimal   InformationTypeId   { get; set; } // NUMBER
		[Column("INFORMATION_TYPE_NAME", DbType="VARCHAR2(50)",   DataType=LinqToDB.DataType.VarChar,  Length=50),      Nullable] public string?   InformationTypeName { get; set; } // VARCHAR2(50)
		[Column(                         DbType="VARCHAR2(4000)", DataType=LinqToDB.DataType.VarChar,  Length=4000),    Nullable] public string?   VALUE               { get; set; } // VARCHAR2(4000)
		[Column("VALUE_AS_INTEGER",      DbType="NUMBER",         DataType=LinqToDB.DataType.Decimal,  Length=22),      Nullable] public decimal?  ValueAsInteger      { get; set; } // NUMBER
		[Column("VALUE_AS_DATE",         DbType="DATE",           DataType=LinqToDB.DataType.DateTime, Length=7),       Nullable] public DateTime? ValueAsDate         { get; set; } // DATE
	}

	[Table(Schema="MANAGED", Name="StringTest")]
	public partial class StringTest
	{
		[Column(DbType="VARCHAR2(50)", DataType=LinqToDB.DataType.VarChar, Length=50),    Nullable] public string? StringValue1 { get; set; } // VARCHAR2(50)
		[Column(DbType="CHAR(50)",     DataType=LinqToDB.DataType.Char,    Length=50),    Nullable] public string? StringValue2 { get; set; } // CHAR(50)
		[Column(DbType="VARCHAR2(50)", DataType=LinqToDB.DataType.VarChar, Length=50), NotNull    ] public string  KeyValue     { get; set; } = null!; // VARCHAR2(50)
	}

	[Table(Schema="MANAGED", Name="t_entity")]
	public partial class TEntity
	{
		[Column("entity_id", DbType="NUMBER",                       DataType=LinqToDB.DataType.Decimal,  Length=22, Scale=0),              PrimaryKey,  NotNull] public decimal   EntityId { get; set; } // NUMBER
		[Column("time",      DbType="DATE",                         DataType=LinqToDB.DataType.DateTime, Length=7),                           Nullable         ] public DateTime? Time     { get; set; } // DATE
		[Column("duration",  DbType="INTERVAL DAY(3) TO SECOND(2)", DataType=LinqToDB.DataType.Time,     Length=11, Precision=3, Scale=2),    Nullable         ] public TimeSpan? Duration { get; set; } // INTERVAL DAY(3) TO SECOND(2)
	}

	[Table(Schema="MANAGED", Name="TestIdentity")]
	public partial class TestIdentity
	{
		[Column(DbType="NUMBER", DataType=LinqToDB.DataType.Decimal, Length=22), PrimaryKey, NotNull] public decimal ID { get; set; } // NUMBER
	}

	[Table(Schema="MANAGED", Name="TestMerge1")]
	public partial class TestMerge1
	{
		[Column(DbType="NUMBER",                      DataType=LinqToDB.DataType.Decimal,        Length=22),                         PrimaryKey,  NotNull] public decimal         Id              { get; set; } // NUMBER
		[Column(DbType="NUMBER",                      DataType=LinqToDB.DataType.Decimal,        Length=22),                            Nullable         ] public decimal?        Field1          { get; set; } // NUMBER
		[Column(DbType="NUMBER",                      DataType=LinqToDB.DataType.Decimal,        Length=22),                            Nullable         ] public decimal?        Field2          { get; set; } // NUMBER
		[Column(DbType="NUMBER",                      DataType=LinqToDB.DataType.Decimal,        Length=22),                            Nullable         ] public decimal?        Field3          { get; set; } // NUMBER
		[Column(DbType="NUMBER",                      DataType=LinqToDB.DataType.Decimal,        Length=22),                            Nullable         ] public decimal?        Field4          { get; set; } // NUMBER
		[Column(DbType="NUMBER",                      DataType=LinqToDB.DataType.Decimal,        Length=22),                            Nullable         ] public decimal?        Field5          { get; set; } // NUMBER
		[Column(DbType="NUMBER (20,0)",               DataType=LinqToDB.DataType.Decimal,        Length=22, Precision=20, Scale=0),     Nullable         ] public decimal?        FieldInt64      { get; set; } // NUMBER (20,0)
		[Column(DbType="NUMBER (1,0)",                DataType=LinqToDB.DataType.Decimal,        Length=22, Precision=1, Scale=0),      Nullable         ] public sbyte?          FieldBoolean    { get; set; } // NUMBER (1,0)
		[Column(DbType="VARCHAR2(20)",                DataType=LinqToDB.DataType.VarChar,        Length=20),                            Nullable         ] public string?         FieldString     { get; set; } // VARCHAR2(20)
		[Column(DbType="NVARCHAR2(20)",               DataType=LinqToDB.DataType.NVarChar,       Length=20),                            Nullable         ] public string?         FieldNString    { get; set; } // NVARCHAR2(20)
		[Column(DbType="CHAR(1)",                     DataType=LinqToDB.DataType.Char,           Length=1),                             Nullable         ] public char?           FieldChar       { get; set; } // CHAR(1)
		[Column(DbType="NCHAR(1)",                    DataType=LinqToDB.DataType.NChar,          Length=1),                             Nullable         ] public char?           FieldNChar      { get; set; } // NCHAR(1)
		[Column(DbType="BINARY_FLOAT",                DataType=LinqToDB.DataType.Single,         Length=4),                             Nullable         ] public float?          FieldFloat      { get; set; } // BINARY_FLOAT
		[Column(DbType="BINARY_DOUBLE",               DataType=LinqToDB.DataType.Double,         Length=8),                             Nullable         ] public double?         FieldDouble     { get; set; } // BINARY_DOUBLE
		[Column(DbType="DATE",                        DataType=LinqToDB.DataType.DateTime,       Length=7),                             Nullable         ] public DateTime?       FieldDateTime   { get; set; } // DATE
		[Column(DbType="TIMESTAMP(7) WITH TIME ZONE", DataType=LinqToDB.DataType.DateTimeOffset, Length=13, Scale=7),                   Nullable         ] public DateTimeOffset? FieldDateTime2  { get; set; } // TIMESTAMP(7) WITH TIME ZONE
		[Column(DbType="BLOB",                        DataType=LinqToDB.DataType.Blob,           Length=4000),                          Nullable         ] public byte[]?         FieldBinary     { get; set; } // BLOB
		[Column(DbType="RAW(16)",                     DataType=LinqToDB.DataType.Binary,         Length=16),                            Nullable         ] public byte[]?         FieldGuid       { get; set; } // RAW(16)
		[Column(DbType="NUMBER (24,10)",              DataType=LinqToDB.DataType.Decimal,        Length=22, Precision=24, Scale=10),    Nullable         ] public decimal?        FieldDecimal    { get; set; } // NUMBER (24,10)
		[Column(DbType="VARCHAR2(20)",                DataType=LinqToDB.DataType.VarChar,        Length=20),                            Nullable         ] public string?         FieldEnumString { get; set; } // VARCHAR2(20)
		[Column(DbType="NUMBER",                      DataType=LinqToDB.DataType.Decimal,        Length=22),                            Nullable         ] public decimal?        FieldEnumNumber { get; set; } // NUMBER
	}

	[Table(Schema="MANAGED", Name="TestMerge2")]
	public partial class TestMerge2
	{
		[Column(DbType="NUMBER",                      DataType=LinqToDB.DataType.Decimal,        Length=22),                         PrimaryKey,  NotNull] public decimal         Id              { get; set; } // NUMBER
		[Column(DbType="NUMBER",                      DataType=LinqToDB.DataType.Decimal,        Length=22),                            Nullable         ] public decimal?        Field1          { get; set; } // NUMBER
		[Column(DbType="NUMBER",                      DataType=LinqToDB.DataType.Decimal,        Length=22),                            Nullable         ] public decimal?        Field2          { get; set; } // NUMBER
		[Column(DbType="NUMBER",                      DataType=LinqToDB.DataType.Decimal,        Length=22),                            Nullable         ] public decimal?        Field3          { get; set; } // NUMBER
		[Column(DbType="NUMBER",                      DataType=LinqToDB.DataType.Decimal,        Length=22),                            Nullable         ] public decimal?        Field4          { get; set; } // NUMBER
		[Column(DbType="NUMBER",                      DataType=LinqToDB.DataType.Decimal,        Length=22),                            Nullable         ] public decimal?        Field5          { get; set; } // NUMBER
		[Column(DbType="NUMBER (20,0)",               DataType=LinqToDB.DataType.Decimal,        Length=22, Precision=20, Scale=0),     Nullable         ] public decimal?        FieldInt64      { get; set; } // NUMBER (20,0)
		[Column(DbType="NUMBER (1,0)",                DataType=LinqToDB.DataType.Decimal,        Length=22, Precision=1, Scale=0),      Nullable         ] public sbyte?          FieldBoolean    { get; set; } // NUMBER (1,0)
		[Column(DbType="VARCHAR2(20)",                DataType=LinqToDB.DataType.VarChar,        Length=20),                            Nullable         ] public string?         FieldString     { get; set; } // VARCHAR2(20)
		[Column(DbType="NVARCHAR2(20)",               DataType=LinqToDB.DataType.NVarChar,       Length=20),                            Nullable         ] public string?         FieldNString    { get; set; } // NVARCHAR2(20)
		[Column(DbType="CHAR(1)",                     DataType=LinqToDB.DataType.Char,           Length=1),                             Nullable         ] public char?           FieldChar       { get; set; } // CHAR(1)
		[Column(DbType="NCHAR(1)",                    DataType=LinqToDB.DataType.NChar,          Length=1),                             Nullable         ] public char?           FieldNChar      { get; set; } // NCHAR(1)
		[Column(DbType="BINARY_FLOAT",                DataType=LinqToDB.DataType.Single,         Length=4),                             Nullable         ] public float?          FieldFloat      { get; set; } // BINARY_FLOAT
		[Column(DbType="BINARY_DOUBLE",               DataType=LinqToDB.DataType.Double,         Length=8),                             Nullable         ] public double?         FieldDouble     { get; set; } // BINARY_DOUBLE
		[Column(DbType="DATE",                        DataType=LinqToDB.DataType.DateTime,       Length=7),                             Nullable         ] public DateTime?       FieldDateTime   { get; set; } // DATE
		[Column(DbType="TIMESTAMP(7) WITH TIME ZONE", DataType=LinqToDB.DataType.DateTimeOffset, Length=13, Scale=7),                   Nullable         ] public DateTimeOffset? FieldDateTime2  { get; set; } // TIMESTAMP(7) WITH TIME ZONE
		[Column(DbType="BLOB",                        DataType=LinqToDB.DataType.Blob,           Length=4000),                          Nullable         ] public byte[]?         FieldBinary     { get; set; } // BLOB
		[Column(DbType="RAW(16)",                     DataType=LinqToDB.DataType.Binary,         Length=16),                            Nullable         ] public byte[]?         FieldGuid       { get; set; } // RAW(16)
		[Column(DbType="NUMBER (24,10)",              DataType=LinqToDB.DataType.Decimal,        Length=22, Precision=24, Scale=10),    Nullable         ] public decimal?        FieldDecimal    { get; set; } // NUMBER (24,10)
		[Column(DbType="VARCHAR2(20)",                DataType=LinqToDB.DataType.VarChar,        Length=20),                            Nullable         ] public string?         FieldEnumString { get; set; } // VARCHAR2(20)
		[Column(DbType="NUMBER",                      DataType=LinqToDB.DataType.Decimal,        Length=22),                            Nullable         ] public decimal?        FieldEnumNumber { get; set; } // NUMBER
	}

	[Table(Schema="MANAGED", Name="t_test_user")]
	public partial class TTestUser
	{
		[Column("user_id", DbType="NUMBER",        DataType=LinqToDB.DataType.Decimal, Length=22),  PrimaryKey, NotNull] public decimal UserId { get; set; } // NUMBER
		[Column("name",    DbType="VARCHAR2(255)", DataType=LinqToDB.DataType.VarChar, Length=255),             NotNull] public string  Name   { get; set; } = null!; // VARCHAR2(255)

		#region Associations

		/// <summary>
		/// SYS_C007192_BackReference (MANAGED.t_test_user_contract)
		/// </summary>
		[Association(ThisKey="UserId", OtherKey="UserId", CanBeNull=true)]
		public IEnumerable<TTestUserContract> Syscs { get; set; } = null!;

		#endregion
	}

	[Table(Schema="MANAGED", Name="t_test_user_contract")]
	public partial class TTestUserContract
	{
		[Column("user_contract_id", DbType="NUMBER",        DataType=LinqToDB.DataType.Decimal, Length=22),  PrimaryKey, NotNull] public decimal UserContractId { get; set; } // NUMBER
		[Column("user_id",          DbType="NUMBER",        DataType=LinqToDB.DataType.Decimal, Length=22),              NotNull] public decimal UserId         { get; set; } // NUMBER
		[Column("contract_no",      DbType="NUMBER",        DataType=LinqToDB.DataType.Decimal, Length=22),              NotNull] public decimal ContractNo     { get; set; } // NUMBER
		[Column("name",             DbType="VARCHAR2(255)", DataType=LinqToDB.DataType.VarChar, Length=255),             NotNull] public string  Name           { get; set; } = null!; // VARCHAR2(255)

		#region Associations

		/// <summary>
		/// SYS_C007192 (MANAGED.t_test_user)
		/// </summary>
		[Association(ThisKey="UserId", OtherKey="UserId", CanBeNull=false)]
		public TTestUser User { get; set; } = null!;

		#endregion
	}

	public static partial class XeDBStoredProcedures
	{
		#region TestPACKAGE1TestProcedure

		public static int TestPACKAGE1TestProcedure(this XeDB dataConnection, decimal? i, out decimal? o)
		{
			var parameters = new []
			{
				new DataParameter("I", i, LinqToDB.DataType.Decimal)
				{
					Size = 22
				},
				new DataParameter("O", null, LinqToDB.DataType.Decimal)
				{
					Direction = ParameterDirection.Output,
					Size      = 22
				}
			};

			var ret = dataConnection.ExecuteProc("MANAGED.TEST_PACKAGE1.TEST_PROCEDURE", parameters);

			o = Converter.ChangeTypeTo<decimal?>(parameters[1].Value);

			return ret;
		}

		#endregion

		#region TestPACKAGE2TestProcedure

		public static int TestPACKAGE2TestProcedure(this XeDB dataConnection, decimal? i, out decimal? o)
		{
			var parameters = new []
			{
				new DataParameter("I", i, LinqToDB.DataType.Decimal)
				{
					Size = 22
				},
				new DataParameter("O", null, LinqToDB.DataType.Decimal)
				{
					Direction = ParameterDirection.Output,
					Size      = 22
				}
			};

			var ret = dataConnection.ExecuteProc("MANAGED.TEST_PACKAGE2.TEST_PROCEDURE", parameters);

			o = Converter.ChangeTypeTo<decimal?>(parameters[1].Value);

			return ret;
		}

		#endregion

		#region ADDISSUE792RECORD

		public static int ADDISSUE792RECORD(this XeDB dataConnection)
		{
			return dataConnection.ExecuteProc("MANAGED.ADDISSUE792RECORD");
		}

		#endregion

		#region OUTREFENUMTEST

		public static int OUTREFENUMTEST(this XeDB dataConnection, string? pSTR, out string? pOUTPUTSTR, ref string? pINPUTOUTPUTSTR)
		{
			var parameters = new []
			{
				new DataParameter("PSTR",            pSTR,            LinqToDB.DataType.NVarChar),
				new DataParameter("POUTPUTSTR", null,      LinqToDB.DataType.NVarChar)
				{
					Direction = ParameterDirection.Output
				},
				new DataParameter("PINPUTOUTPUTSTR", pINPUTOUTPUTSTR, LinqToDB.DataType.NVarChar)
				{
					Direction = ParameterDirection.InputOutput
				}
			};

			var ret = dataConnection.ExecuteProc("MANAGED.OUTREFENUMTEST", parameters);

			pOUTPUTSTR      = Converter.ChangeTypeTo<string?>(parameters[1].Value);
			pINPUTOUTPUTSTR = Converter.ChangeTypeTo<string?>(parameters[2].Value);

			return ret;
		}

		#endregion

		#region OUTREFTEST

		public static int OUTREFTEST(this XeDB dataConnection, decimal? pID, out decimal? pOUTPUTID, ref decimal? pINPUTOUTPUTID, string? pSTR, out string? pOUTPUTSTR, ref string? pINPUTOUTPUTSTR)
		{
			var parameters = new []
			{
				new DataParameter("PID",             pID,             LinqToDB.DataType.Decimal)
				{
					Size = 22
				},
				new DataParameter("POUTPUTID", null,       LinqToDB.DataType.Decimal)
				{
					Direction = ParameterDirection.Output,
					Size      = 22
				},
				new DataParameter("PINPUTOUTPUTID",  pINPUTOUTPUTID,  LinqToDB.DataType.Decimal)
				{
					Direction = ParameterDirection.InputOutput,
					Size      = 22
				},
				new DataParameter("PSTR",            pSTR,            LinqToDB.DataType.NVarChar),
				new DataParameter("POUTPUTSTR", null,      LinqToDB.DataType.NVarChar)
				{
					Direction = ParameterDirection.Output
				},
				new DataParameter("PINPUTOUTPUTSTR", pINPUTOUTPUTSTR, LinqToDB.DataType.NVarChar)
				{
					Direction = ParameterDirection.InputOutput
				}
			};

			var ret = dataConnection.ExecuteProc("MANAGED.OUTREFTEST", parameters);

			pOUTPUTID       = Converter.ChangeTypeTo<decimal?>(parameters[1].Value);
			pINPUTOUTPUTID  = Converter.ChangeTypeTo<decimal?>(parameters[2].Value);
			pOUTPUTSTR      = Converter.ChangeTypeTo<string?> (parameters[4].Value);
			pINPUTOUTPUTSTR = Converter.ChangeTypeTo<string?> (parameters[5].Value);

			return ret;
		}

		#endregion

		#region PersonDelete

		public static int PersonDelete(this XeDB dataConnection, decimal? pPERSONID)
		{
			var parameters = new []
			{
				new DataParameter("PPERSONID", pPERSONID, LinqToDB.DataType.Decimal)
				{
					Size = 22
				}
			};

			return dataConnection.ExecuteProc("MANAGED.PERSON_DELETE", parameters);
		}

		#endregion

		#region PersonUpdate

		public static int PersonUpdate(this XeDB dataConnection, decimal? pPERSONID, string? pFIRSTNAME, string? pLASTNAME, string? pMIDDLENAME, string? pGENDER)
		{
			var parameters = new []
			{
				new DataParameter("PPERSONID",   pPERSONID,   LinqToDB.DataType.Decimal)
				{
					Size = 22
				},
				new DataParameter("PFIRSTNAME",  pFIRSTNAME,  LinqToDB.DataType.NVarChar),
				new DataParameter("PLASTNAME",   pLASTNAME,   LinqToDB.DataType.NVarChar),
				new DataParameter("PMIDDLENAME", pMIDDLENAME, LinqToDB.DataType.NVarChar),
				new DataParameter("PGENDER",     pGENDER,     LinqToDB.DataType.Char)
			};

			return dataConnection.ExecuteProc("MANAGED.PERSON_UPDATE", parameters);
		}

		#endregion

		#region RESULTSETTEST

		public static IEnumerable<RESULTSETTESTResult> RESULTSETTEST(this XeDB dataConnection, out object? mR, out object? sR)
		{
			var parameters = new []
			{
				new DataParameter("MR", null, LinqToDB.DataType.Cursor)
				{
					Direction = ParameterDirection.Output
				},
				new DataParameter("SR", null, LinqToDB.DataType.Cursor)
				{
					Direction = ParameterDirection.Output
				}
			};

			var ret = dataConnection.QueryProc<RESULTSETTESTResult>("MANAGED.RESULTSETTEST", parameters).ToList();

			mR = Converter.ChangeTypeTo<object?>(parameters[0].Value);
			sR = Converter.ChangeTypeTo<object?>(parameters[1].Value);

			return ret;
		}

		public partial class RESULTSETTESTResult
		{
			public decimal? MASTERID { get; set; }
		}

		#endregion

		#region TestProcedure

		public static int TestProcedure(this XeDB dataConnection, decimal? i, out decimal? o)
		{
			var parameters = new []
			{
				new DataParameter("I", i, LinqToDB.DataType.Decimal)
				{
					Size = 22
				},
				new DataParameter("O", null, LinqToDB.DataType.Decimal)
				{
					Direction = ParameterDirection.Output,
					Size      = 22
				}
			};

			var ret = dataConnection.ExecuteProc("MANAGED.TEST_PROCEDURE", parameters);

			o = Converter.ChangeTypeTo<decimal?>(parameters[1].Value);

			return ret;
		}

		#endregion
	}

	public static partial class SqlFunctions
	{
		#region TestPACKAGE1TestFunction

		[Sql.Function(Name="MANAGED.TEST_PACKAGE1.TEST_FUNCTION", ServerSideOnly=true)]
		public static decimal? TestPACKAGE1TestFunction(decimal? i)
		{
			throw new InvalidOperationException();
		}

		#endregion

		#region TestPACKAGE2TestFunction

		[Sql.Function(Name="MANAGED.TEST_PACKAGE2.TEST_FUNCTION", ServerSideOnly=true)]
		public static decimal? TestPACKAGE2TestFunction(decimal? i)
		{
			throw new InvalidOperationException();
		}

		#endregion

		#region PatientSelectall

		[Sql.Function(Name="MANAGED.PATIENT_SELECTALL", ServerSideOnly=true)]
		public static object? PatientSelectall()
		{
			throw new InvalidOperationException();
		}

		#endregion

		#region PatientSelectbyname

		[Sql.Function(Name="MANAGED.PATIENT_SELECTBYNAME", ServerSideOnly=true)]
		public static object? PatientSelectbyname(string? pFIRSTNAME, string? pLASTNAME)
		{
			throw new InvalidOperationException();
		}

		#endregion

		#region PersonInsert

		[Sql.Function(Name="MANAGED.PERSON_INSERT", ServerSideOnly=true)]
		public static object? PersonInsert(string? pFIRSTNAME, string? pLASTNAME, string? pMIDDLENAME, string? pGENDER)
		{
			throw new InvalidOperationException();
		}

		#endregion

		#region PersonSelectall

		[Sql.Function(Name="MANAGED.PERSON_SELECTALL", ServerSideOnly=true)]
		public static object? PersonSelectall()
		{
			throw new InvalidOperationException();
		}

		#endregion

		#region PersonSelectallbygender

		[Sql.Function(Name="MANAGED.PERSON_SELECTALLBYGENDER", ServerSideOnly=true)]
		public static object? PersonSelectallbygender(string? pGENDER)
		{
			throw new InvalidOperationException();
		}

		#endregion

		#region PersonSelectbykey

		[Sql.Function(Name="MANAGED.PERSON_SELECTBYKEY", ServerSideOnly=true)]
		public static object? PersonSelectbykey(decimal? pID)
		{
			throw new InvalidOperationException();
		}

		#endregion

		#region PersonSelectbyname

		[Sql.Function(Name="MANAGED.PERSON_SELECTBYNAME", ServerSideOnly=true)]
		public static object? PersonSelectbyname(string? pFIRSTNAME, string? pLASTNAME)
		{
			throw new InvalidOperationException();
		}

		#endregion

		#region PersonSelectlistbyname

		[Sql.Function(Name="MANAGED.PERSON_SELECTLISTBYNAME", ServerSideOnly=true)]
		public static object? PersonSelectlistbyname(string? pFIRSTNAME, string? pLASTNAME)
		{
			throw new InvalidOperationException();
		}

		#endregion

		#region ScalarDatareader

		[Sql.Function(Name="MANAGED.SCALAR_DATAREADER", ServerSideOnly=true)]
		public static object? ScalarDatareader()
		{
			throw new InvalidOperationException();
		}

		#endregion

		#region ScalarReturnparameter

		[Sql.Function(Name="MANAGED.SCALAR_RETURNPARAMETER", ServerSideOnly=true)]
		public static int? ScalarReturnparameter()
		{
			throw new InvalidOperationException();
		}

		#endregion

		#region TestFunction

		[Sql.Function(Name="MANAGED.TEST_FUNCTION", ServerSideOnly=true)]
		public static decimal? TestFunction(decimal? i)
		{
			throw new InvalidOperationException();
		}

		#endregion
	}

	public static partial class TableExtensions
	{
		public static AllType? Find(this ITable<AllType> table, decimal ID)
		{
			return table.FirstOrDefault(t =>
				t.ID == ID);
		}

		public static BINARYDATA? Find(this ITable<BINARYDATA> table, decimal BINARYDATAID)
		{
			return table.FirstOrDefault(t =>
				t.BINARYDATAID == BINARYDATAID);
		}

		public static DataTypeTest? Find(this ITable<DataTypeTest> table, decimal DataTypeID)
		{
			return table.FirstOrDefault(t =>
				t.DataTypeID == DataTypeID);
		}

		public static Doctor? Find(this ITable<Doctor> table, decimal PersonID)
		{
			return table.FirstOrDefault(t =>
				t.PersonID == PersonID);
		}

		public static InheritanceChild? Find(this ITable<InheritanceChild> table, decimal InheritanceChildId)
		{
			return table.FirstOrDefault(t =>
				t.InheritanceChildId == InheritanceChildId);
		}

		public static InheritanceParent? Find(this ITable<InheritanceParent> table, decimal InheritanceParentId)
		{
			return table.FirstOrDefault(t =>
				t.InheritanceParentId == InheritanceParentId);
		}

		public static LongRawTable? Find(this ITable<LongRawTable> table, decimal ID)
		{
			return table.FirstOrDefault(t =>
				t.ID == ID);
		}

		public static Patient? Find(this ITable<Patient> table, decimal PersonID)
		{
			return table.FirstOrDefault(t =>
				t.PersonID == PersonID);
		}

		public static Person? Find(this ITable<Person> table, decimal PersonID)
		{
			return table.FirstOrDefault(t =>
				t.PersonID == PersonID);
		}

		public static SchemaTestMatView? Find(this ITable<SchemaTestMatView> table, decimal Id)
		{
			return table.FirstOrDefault(t =>
				t.Id == Id);
		}

		public static SchemaTestTable? Find(this ITable<SchemaTestTable> table, decimal Id)
		{
			return table.FirstOrDefault(t =>
				t.Id == Id);
		}

		public static SEQUENCETEST? Find(this ITable<SEQUENCETEST> table, decimal ID)
		{
			return table.FirstOrDefault(t =>
				t.ID == ID);
		}

		public static TEntity? Find(this ITable<TEntity> table, decimal EntityId)
		{
			return table.FirstOrDefault(t =>
				t.EntityId == EntityId);
		}

		public static TestIdentity? Find(this ITable<TestIdentity> table, decimal ID)
		{
			return table.FirstOrDefault(t =>
				t.ID == ID);
		}

		public static TestMerge1? Find(this ITable<TestMerge1> table, decimal Id)
		{
			return table.FirstOrDefault(t =>
				t.Id == Id);
		}

		public static TestMerge2? Find(this ITable<TestMerge2> table, decimal Id)
		{
			return table.FirstOrDefault(t =>
				t.Id == Id);
		}

		public static TTestUser? Find(this ITable<TTestUser> table, decimal UserId)
		{
			return table.FirstOrDefault(t =>
				t.UserId == UserId);
		}

		public static TTestUserContract? Find(this ITable<TTestUserContract> table, decimal UserContractId)
		{
			return table.FirstOrDefault(t =>
				t.UserContractId == UserContractId);
		}
	}
}
