Note that there are some explanatory texts on larger screens.

plurals
  1. POfluent-nhibernate: not getting the records
    text
    copied!<p>I have an entity like</p> <pre><code>public class SKU { //public int Id { get; set; } public string FactoruCode { get; set; } public string Ptoduct { get; set; } } </code></pre> <p>and mapping defined as</p> <pre><code> public class SKUMap : ClassMap&lt;SKU&gt; { public SKUMap() { Table("MST_PRODUCT"); Not.LazyLoad(); Id(x =&gt; x.Ptoduct).GeneratedBy.Assigned(); Map(x =&gt; x.Ptoduct, "PRODUCT_NAME"); Map(x =&gt; x.FactoruCode, "FACTORY_CODE"); } } </code></pre> <p>and retrieving the records like</p> <pre><code>class Program { static void Main() { var sessionFactory = CreateSessionFactory(); using (var session = sessionFactory.OpenSession()) { using (session.BeginTransaction()) { var skus = session.CreateCriteria(typeof(SKU)).List&lt;SKU&gt;(); foreach (var sku in skus) { Console.WriteLine(sku.Ptoduct); } } } } private static ISessionFactory CreateSessionFactory() { var cfg = OracleClientConfiguration.Oracle10 .ConnectionString(c =&gt; c.Is( @"DATA SOURCE=SERVER_NAME;PERSIST SECURITYINFO=True;USER ID=USER_ID;Password=PWD")); return Fluently.Configure() .Database(cfg).Mappings(m =&gt; m.FluentMappings.AddFromAssemblyOf&lt;Program&gt;()) .ExposeConfiguration(BuildSchema).BuildSessionFactory(); } private static void BuildSchema(NHibernate.Cfg.Configuration config) { new SchemaExport(config).Create(false, true); } } </code></pre> <p>but the table has more columns than specified for entity. This code executes well, but I'm not able to get the list of SKUs (table has more than 8000 rows).</p> <p>Please help me to understand the problem.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload