Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 404959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:21:21+00:00 2026-05-12T17:21:21+00:00

I am trying to connect to the existing db in oracle with fluentmapping .

  • 0

I am trying to connect to the existing db in oracle with fluentmapping .
I got
Mapping over CUstomer

public CustomerMapping()
    {

         Not.LazyLoad();
        Id(x => x.Cst_Recid).GeneratedBy.Increment() ;
    }

and i am trying to create session

public static ISessionFactory CreateSessionFactory()
    {
        return Fluently
            .Configure()
            .Database(OracleClientConfiguration.Oracle10.ConnectionString
            ("...."))
            .Mappings(m =>
             {
                 m.FluentMappings.AddFromAssemblyOf<CustomerMapping>();

             })
             .BuildConfiguration() 
             .BuildSessionFactory();
    }

i have some trial class to try and create the sessionFactory

public class MyDataProvider
{
    public static  Customer GetCustomerById(long customerId)
    {
        ISessionFactory sessionFactory = SessionFactory.CreateSessionFactory(); 
        ISession session = sessionFactory.OpenSession();
          return session.Linq<Customer>().Where(x => x.Cst_Recid.Equals(temp)).FirstOrDefault();

    }


}

i am not being able to get the Customer by Id even though I am getting to open session and activating …

the test is very simple – only to check the select activity

    [Test]
    public void CanGetCustomerById()
    {
        MyDataProvider provider = new MyDataProvider();
        Assert.AreEqual(33941, MyDataProvider.GetCustomerById(33941).Cst_Recid);

    }

there is a mistake –

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 <=: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 <=:p1]
—-> System.Data.OracleClient.OracleException : ORA-00942: table or view does not exist

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 ?

will appreceate any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:21:22+00:00Added an answer on May 12, 2026 at 5:21 pm

    My previous answer was incorrect. Allow me to try again!

    When you quote an object name in Oracle, it becomes case-sensative. Your CUSTOMER table is being quoted as “Customer” which is not the same as being quoted “CUSTOMER”:

    SQL> select * from "dual";
    select * from "dual"
                  *
    ERROR at line 1:
    ORA-00942: table or view does not exist
    
    
    SQL> select * from "Dual";
    select * from "Dual"
                  *
    ERROR at line 1:
    ORA-00942: table or view does not exist
    
    
    SQL> select * from "DUAL";
    
    D
    -
    X
    

    I still don’t know anything about Fluid NHibernate, but is it possible to get it to look for a “CUSTOMER” table instead of a “Customers” table?

    Alternatively, if nothing else is looking for a CUSTOMERS table, you could rename it to “Customers”… however, this will break references to a CUSTOMERS table:

    SQL> create table CUSTOMERS (x int);
    
    Table created.
    
    SQL> insert into CUSTOMERS (x) values (1);
    
    1 row created.
    
    SQL> select * from CUSTOMERS;
    
             X
    ----------
             1
    
    SQL> select * from "Customers";
    select * from "Customers"
                  *
    ERROR at line 1:
    ORA-00942: table or view does not exist
    
    
    SQL> select * from "CUSTOMERS";
    
             X
    ----------
             1
    
    SQL> alter table CUSTOMERS rename to "Customers";
    
    Table altered.
    
    SQL> select * from CUSTOMERS;
    select * from CUSTOMERS
                  *
    ERROR at line 1:
    ORA-00942: table or view does not exist
    
    
    SQL> select * from "Customers";
    
             X
    ----------
             1
    

    Good luck! I hope this helps…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to connect to a MySQL 5.5 database as follows: public void
I'm trying to connect to an existing Windows Service that exposes several WCF endpoints.
I am trying to write an Android app to connect to an existing web
I'm trying to connect to an existing database (non-SQLEXPRESS) but everytime I try to
I'm trying to connect to our existing subversion repository. It is set up like
I'm trying to connect to an existing LDAP server to authenticate users trying to
I'm trying to connect to an existing MySQL DB from Lightswitch RTM through a
I've been trying to connect to a remote DB hosted elsewhere, not my my
I am trying to connect to an existing Sybase db using Rails and populate
I've been trying to connect my backbone.js application to an existing Codeigniter API. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.