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 3598218
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:12:53+00:00 2026-05-18T20:12:53+00:00

I am particularly confused by the following test case: public void TestMapping() { var

  • 0

I am particularly confused by the following test case:

public void TestMapping()
{
    var autoPersistenceModel = AutoMap.AssemblyOf<RepositoryEntity>().Where(
        x => x.Namespace.EndsWith("Descriptors"));

    var configuration = Fluently.Configure()
        .Database(SQLiteConfiguration.Standard.ShowSql().InMemory)
        .Mappings(x => x.AutoMappings.Add(autoPersistenceModel))
        .ExposeConfiguration(x => new NHibernate.Tool.hbm2ddl.SchemaExport(x).Create(true, false));

    var sessionFactory = configuration.BuildSessionFactory();

    using (var session = sessionFactory.OpenSession())
    {
        new PersistenceSpecification<IndicatorUnitDescriptor>(session)
            .CheckProperty(x => x.Name, "Name1")
            .CheckProperty(x => x.Timestamp, new DateTime(2000, 10, 10))
            .VerifyTheMappings();
    }
}

As you can see, I’m experimenting with automappings, but unfortunately the following test case raises the following SQLite exception (the first contains the actual queries done):

drop table if exists "IndicatorUnitDescriptor"

drop table if exists "StockUnitDescriptor"

create table "IndicatorUnitDescriptor" (
   Id  integer,
   Name TEXT,
   Timestamp DATETIME,
   primary key (Id)
)

create table "StockUnitDescriptor" (
   Id  integer,
   Name TEXT,
   Timestamp DATETIME,
   primary key (Id)
)

NHibernate: INSERT INTO "IndicatorUnitDescriptor" (Name, Timestamp) VALUES (@p0, @p1); select last_insert_rowid();@p0 = 'Name1' [Type: String (0)], @p1 = 10.10.2000 0:00:00 [Type: DateTime (0)]

System.Data.SQLite.SQLiteException: SQLite error
no such table: IndicatorUnitDescriptor

And I can’t understand why does it happen this way – the SQL commands seem to be working appropriately and the corresponding table should be created by the create table query.

I assume something is wrong in my code (I probably missed something). Could you help me?

  • 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-18T20:12:54+00:00Added an answer on May 18, 2026 at 8:12 pm

    I think your using two sessions. One during database creation and in your test proper. Try setting up like this.

      Configuration cfg = Fluently.Configure()
            .Database(SQLiteConfiguration.Standard.InMemory())
            .Mappings(m => m.HbmMappings.AddFromAssembly(_mappingsAssembly))
            .BuildConfiguration();
    
        var session = cfg.BuildSessionFactory().OpenSession();
    
        new SchemaExport(cfg).Execute(false, true, false, session.Connection, null);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am particularly confused by the following test case: public void TestMapping() { var
Given the following: class BC { public void Display() { System.Console.WriteLine(BC::Display); } } class
I am a little confused with Hibernate. My problem is the following: I have
I am a little confused about overloading rules, let's say there are following literal
What does MEDIA_URL does now? I am particularly confused after I got django.core.exceptions.ImproperlyConfigured: The
Particularly, what is the best snippets package out there? Features: easy to define new
Particularly the bit about live.... jQuery('.something').live('click', function() { jQuery(this).parent('form').reset(); }); I suppose this might
Particularly for 2d games, and particularly silverlight/wpf games. If you think about it, you
More particularly - I have a window handle of another running application. This application
I am particularly interested in Document Libraries, but in terms of general SharePoint lists,

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.