Matt,
Here is all the information minus the using statements in the source
code.
Thanks
David
Exception:
{"could not load an entity: [ADRPData.Domain.DocType#ArbAssocRuling]
[SQL: SELECT doctype0_.SDOCTYPEID as SDOCTYPEID1_0_,
doctype0_.SDOCTYPECODE as SDOCTYPE2_1_0_, doctype0_.sSettings as
sSettings1_0_, doctype0_.sTemplate as sTemplate1_0_,
doctype0_.sArchiveOnly as sArchive5_1_0_, doctype0_.sDocTypeDescriptio
as sDocType6_1_0_, doctype0_.sPrinterName as sPrinter7_1_0_,
doctype0_.sViewableInMCare as sViewabl8_1_0_,
doctype0_.sMCareDescription as sMCareDe9_1_0_, doctype0_.sDocGroup as
sDocGroup1_0_ FROM DocType doctype0_ WHERE doctype0_.SDOCTYPEID=?]"}
Inner Exception:
{"Invalid index 0 for this DB2ParameterCollection with Count=0."}
DocType.hbm.xml:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="ADRPData"
namespace="ADRPData.Domain">
<class name="DocType">
<id name="sDocTypeID" column="SDOCTYPEID" type="String">
<generator class="assigned" />
</id>
<property name="sDocTypeCode" column="SDOCTYPECODE" />
<property name="sSettings" />
<property name="sTemplate" />
<property name="sArchiveOnly" />
<property name="sDocTypeDescriptio" />
<property name="sPrinterName" />
<property name="sViewableInMCare" />
<property name="sMCareDescription" />
<property name="sDocGroup" />
</class>
</hibernate-mapping>
DocType.cs:
namespace ADRPData.Domain
{
public class DocType
{
public virtual string sDocTypeID { get; set; }
public virtual string sDocTypeCode { get; set; }
public virtual string sSettings { get; set; }
public virtual string sTemplate { get; set; }
public virtual string sArchiveOnly { get; set; }
public virtual string sDocTypeDescriptio { get; set; }
public virtual string sPrinterName { get; set; }
public virtual string sViewableInMCare { get; set; }
public virtual string sMCareDescription { get; set; }
public virtual string sDocGroup { get; set; }
}
}
Program.cs - ConsoleApplication:
namespace ADRPConsole
{
class Program
{
private static ISessionFactory _sessionFactory;
private static Configuration _configuration;
static void Main(string[] args)
{
_configuration = new Configuration();
_configuration.Configure();
_configuration.AddAssembly(typeof(DocType).Assembly);
_sessionFactory = _configuration.BuildSessionFactory();
IDocTypeRepository repository = new DocTypeRepository();
var fromDb = repository.GetById("ArbAssocRuling");
Console.WriteLine("DocTypeCode:" + fromDb.sDocTypeCode);