internal JoinableCohortAggregateConfigurationUse(ICatalogueRepository repository, DbDataReader r) : base(repository, r) { ExtractionJoinType joinType; if (ExtractionJoinType.TryParse(r["JoinType"].ToString(), true, out joinType)) { JoinType = joinType; } JoinableCohortAggregateConfiguration_ID = Convert.ToInt32(r["JoinableCohortAggregateConfiguration_ID"]); AggregateConfiguration_ID = Convert.ToInt32(r["AggregateConfiguration_ID"]); }
/// <summary> /// Constructor to be used to create already existing JoinInfos out of the database only. /// </summary> /// <param name="repository"></param> /// <param name="r"></param> internal JoinInfo(IRepository repository, DbDataReader r) : base(repository, r) { ForeignKey_ID = Convert.ToInt32(r["ForeignKey_ID"]); PrimaryKey_ID = Convert.ToInt32(r["PrimaryKey_ID"]); Collation = r["Collation"] as string; ExtractionJoinType joinType; if (ExtractionJoinType.TryParse(r["ExtractionJoinType"].ToString(), true, out joinType)) { ExtractionJoinType = joinType; } else { throw new Exception("Did not recognise ExtractionJoinType:" + r["ExtractionJoinType"]); } if (ForeignKey_ID == PrimaryKey_ID) { throw new Exception("Join key 1 and 2 are the same, lookup is broken"); } }
internal Lookup(ICatalogueRepository repository, DbDataReader r) : base(repository, r) { Description_ID = int.Parse(r["Description_ID"].ToString()); ForeignKey_ID = int.Parse(r["ForeignKey_ID"].ToString()); PrimaryKey_ID = int.Parse(r["PrimaryKey_ID"].ToString()); Collation = r["Collation"] as string; ExtractionJoinType joinType; if (ExtractionJoinType.TryParse(r["ExtractionJoinType"].ToString(), true, out joinType)) { ExtractionJoinType = joinType; } else { throw new Exception("Did not recognise ExtractionJoinType:" + r["ExtractionJoinType"]); } if (ForeignKey_ID == PrimaryKey_ID) { throw new ArgumentException("Join Key 1 and Join Key 2 cannot be the same"); } }