Note that there are some explanatory texts on larger screens.

plurals
  1. POFluent Nhibernate over legacy database in oracle
    text
    copied!<p>I am trying to connect to the existing db in oracle with fluentmapping . I got Mapping over CUstomer</p> <pre><code>public CustomerMapping() { Not.LazyLoad(); Id(x =&gt; x.Cst_Recid).GeneratedBy.Increment() ; } </code></pre> <p>and i am trying to create session </p> <pre><code>public static ISessionFactory CreateSessionFactory() { return Fluently .Configure() .Database(OracleClientConfiguration.Oracle10.ConnectionString ("....")) .Mappings(m =&gt; { m.FluentMappings.AddFromAssemblyOf&lt;CustomerMapping&gt;(); }) .BuildConfiguration() .BuildSessionFactory(); } </code></pre> <p>i have some trial class to try and create the sessionFactory</p> <pre><code>public class MyDataProvider { public static Customer GetCustomerById(long customerId) { ISessionFactory sessionFactory = SessionFactory.CreateSessionFactory(); ISession session = sessionFactory.OpenSession(); return session.Linq&lt;Customer&gt;().Where(x =&gt; x.Cst_Recid.Equals(temp)).FirstOrDefault(); } } </code></pre> <p>i am not being able to get the Customer by Id even though I am getting to open session and activating ...</p> <p>the test is very simple - only to check the select activity </p> <pre><code> [Test] public void CanGetCustomerById() { MyDataProvider provider = new MyDataProvider(); Assert.AreEqual(33941, MyDataProvider.GetCustomerById(33941).Cst_Recid); } </code></pre> <p>there is a mistake -</p> <p>TestCase '...DataLayer.Tests.CustomerMappingTests.CanGetCustomerById' failed: NHibernate.ADOException : could not execute query [ select * from ( SELECT this_.Cst_Recid as Cst1_0_0_, this_.Cst_Customerid as Cst2_0_0_, this_.Cst_First_Name as Cst3_0_0_, this_.Cst_Group_Recid as Cst4_0_0_, this_.Cst_Insdbdt as Cst5_0_0_, this_.Cst_Insdbuser as Cst6_0_0_, this_.Cst_Joingroup_Dt as Cst7_0_0_, this_.Cst_Last_Name as Cst8_0_0_, this_.Cst_Lastupddt as Cst9_0_0_, this_.Cst_Lastupduser as Cst10_0_0_, this_.Cst_Tat_Lakoach_Meshalem as Cst11_0_0_, this_.Cst_Typeid as Cst12_0_0_, this_.Cst_Tziyun_Meshalem_Rashi_Only as Cst13_0_0_, this_.Cst_Tziyun_Mizdamen as Cst14_0_0_ FROM "Customer" this_ WHERE this_.Cst_Recid = :p0 ) where rownum &lt;=:p1 ] Positional parameters: #0>33941 [SQL: select * from ( SELECT this_.Cst_Recid as Cst1_0_0_, this_.Cst_Customerid as Cst2_0_0_, this_.Cst_First_Name as Cst3_0_0_, this_.Cst_Group_Recid as Cst4_0_0_, this_.Cst_Insdbdt as Cst5_0_0_, this_.Cst_Insdbuser as Cst6_0_0_, this_.Cst_Joingroup_Dt as Cst7_0_0_, this_.Cst_Last_Name as Cst8_0_0_, this_.Cst_Lastupddt as Cst9_0_0_, this_.Cst_Lastupduser as Cst10_0_0_, this_.Cst_Tat_Lakoach_Meshalem as Cst11_0_0_, this_.Cst_Typeid as Cst12_0_0_, this_.Cst_Tziyun_Meshalem_Rashi_Only as Cst13_0_0_, this_.Cst_Tziyun_Mizdamen as Cst14_0_0_ FROM "Customer" this_ WHERE this_.Cst_Recid = :p0 ) where rownum &lt;=:p1] ----> System.Data.OracleClient.OracleException : ORA-00942: table or view does not exist</p> <p>the query that he is trying to run is build automaticly by FluentNHibernate . If i remove the quoates the query executes right , it gets the result .. the trouble is that i can not change the query as i want .. maybe the problem is that we are using Oracle 11 g and FluentNhibernate adjusted only to Oracle 9 or 10 ?</p> <p>will appreceate any help.</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