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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:01:20+00:00 2026-05-14T20:01:20+00:00

and first off thanks for your time to look at this. For a research

  • 0

and first off thanks for your time to look at this.

For a research project I’m working on, I have a somewhat complex design (which I’ve been given) to persist to a database via NHibernate.

Here’s an example of the class hierarchy:

alt text http://img215.imageshack.us/img215/3998/transit.png

TransitStrategy, TransportationCompany and TransportationLocation are all abstract classes.

The XML configuration I have is presently:

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
               assembly="Vacationizer"
               namespace="Vacationizer.Domain.Transit">

<class name="TransitStrategy">

    <id name="TransitStrategyId">
        <generator class="guid" />
    </id>

    <property name="Restrictions" />

    <joined-subclass name="Flight" table="Flight_TransitStrategy">

        <key column="TransitStrategyId" />

        <property name="DepartingAirport" />
        <property name="ArrivingAirport" />
        <property name="Airline" />
        <property name="FlightNumber" />
        <property name="FlightArrivalTime" />
        <property name="FlightDepartureTime" />

    </joined-subclass>

    <joined-subclass name="RentalCar" table="RentalCar_TransitStrategy">

        <key column="TransitStrategyId" />

        <property name="RentalCarBranch" />
        <property name="CarMake" />
        <property name="CarModel" />
        <property name="CarYear" />
        <property name="CarColor" />
        <property name="RentalBegins" />
        <property name="RentalEnds" />

    </joined-subclass>

</class>

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
               assembly="Vacationizer"
               namespace="Vacationizer.Domain.Transit">

<class name="TransportationCompany">

    <id name="TransportationCompanyId">
        <generator class="guid" />
    </id>

    <property name="Name" />
    <property name="Reviews" />
    <property name="Website" />
    <property name="Photo" />

    <joined-subclass name="Airline" table="Airline_TransportationCompany">

        <key column="TransportationLocationId" />

    </joined-subclass>

    <joined-subclass name="RentalCarAgency" table="RentalCarAgency_TransportationCompany">

        <key column="TransportationLocationId" />

    </joined-subclass>

</class>

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
               assembly="Vacationizer"
               namespace="Vacationizer.Domain.Transit">

<class name="TransportationLocation">

    <id name="TransportationLocationId">
        <generator class="guid" />
    </id>

    <property name="Name" />
    <property name="Image" />
    <property name="Geolocation" />
    <property name="Reviews" />
    <!-- <property name="HoursOpen" />-->
    <property name="PhoneNumber" />
    <property name="FaxNumber" />

    <joined-subclass name="Airport" table="Airport_TransportationLocation">

        <key column="TransportationLocationId" />

        <property name="AirportCode" />
        <property name="Website" />

    </joined-subclass>

    <joined-subclass name="RentalCarBranch" table="RentalCarBranch_TransportationLocation">

        <key column="TransitStrategyId" />

        <property name="Agency" />

    </joined-subclass>

</class>

However, whenever I try to use this schema I get this error/stack trace:

------ Test started: Assembly: Vacationizer.Tests.dll ------

TestCase 'M:Vacationizer.Tests.VacationRepository_Fixture.TestFixtureSetUp'
failed: Could not compile the mapping document:      Vacationizer.Mappings.TransitStrategy.hbm.xml
    NHibernate.MappingException: Could not compile the mapping document: Vacationizer.Mappings.TransitStrategy.hbm.xml ---> NHibernate.MappingException: Problem trying to set property type by reflection ---> NHibernate.MappingException: class Vacationizer.Domain.Transit.RentalCar, Vacationizer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null not found while looking for property: RentalCarBranch ---> NHibernate.PropertyNotFoundException: Could not find a getter for property 'RentalCarBranch' in class 'Vacationizer.Domain.Transit.RentalCar'
    at NHibernate.Properties.BasicPropertyAccessor.GetGetter(Type type, String propertyName)
    at NHibernate.Util.ReflectHelper.ReflectedPropertyClass(String className, String name, String accessorName)
       --- End of inner exception stack trace ---
    at NHibernate.Util.ReflectHelper.ReflectedPropertyClass(String className, String name, String accessorName)
    at NHibernate.Mapping.SimpleValue.SetTypeUsingReflection(String className, String propertyName, String accesorName)
       --- End of inner exception stack trace ---
    at NHibernate.Mapping.SimpleValue.SetTypeUsingReflection(String className, String propertyName, String accesorName)
    at NHibernate.Cfg.XmlHbmBinding.ClassBinder.CreateProperty(IValue value, String propertyName, String className, XmlNode subnode, IDictionary`2 inheritedMetas)
    at NHibernate.Cfg.XmlHbmBinding.ClassBinder.PropertiesFromXML(XmlNode node, PersistentClass model, IDictionary`2 inheritedMetas, UniqueKey uniqueKey, Boolean mutable, Boolean nullable, Boolean naturalId)
    at NHibernate.Cfg.XmlHbmBinding.JoinedSubclassBinder.HandleJoinedSubclass(PersistentClass model, XmlNode subnode, IDictionary`2 inheritedMetas)
    at NHibernate.Cfg.XmlHbmBinding.ClassBinder.PropertiesFromXML(XmlNode node, PersistentClass model, IDictionary`2 inheritedMetas, UniqueKey uniqueKey, Boolean mutable, Boolean nullable, Boolean naturalId)
    at NHibernate.Cfg.XmlHbmBinding.RootClassBinder.Bind(XmlNode node, HbmClass classSchema, IDictionary`2 inheritedMetas)
    at NHibernate.Cfg.XmlHbmBinding.MappingRootBinder.AddRootClasses(XmlNode parentNode, IDictionary`2 inheritedMetas)
    at NHibernate.Cfg.XmlHbmBinding.MappingRootBinder.Bind(XmlNode node)
    at NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc)
       --- End of inner exception stack trace ---
    at NHibernate.Cfg.Configuration.LogAndThrow(Exception exception)
    at NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc)
    at NHibernate.Cfg.Configuration.ProcessMappingsQueue()
    at NHibernate.Cfg.Configuration.AddDocumentThroughQueue(NamedXmlDocument document)
    at NHibernate.Cfg.Configuration.AddXmlReader(XmlReader hbmReader, String name)
    at NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream, String name)
    at NHibernate.Cfg.Configuration.AddResource(String path, Assembly assembly)
    at NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly)
    at NHibernate.Cfg.Configuration.AddAssembly(String assemblyName)
    at NHibernate.Cfg.Configuration.DoConfigure(IHibernateConfiguration hc)
    at NHibernate.Cfg.Configuration.Configure()
    VacationRepository_Fixture.cs(24,0): at Vacationizer.Tests.VacationRepository_Fixture.TestFixtureSetUp()

0 passed, 1 failed, 0 skipped, took 8.38 seconds (Ad hoc).

Any ideas on how I can implement this differently? Thanks very much!

  • 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-14T20:01:21+00:00Added an answer on May 14, 2026 at 8:01 pm

    The error itself is clear: mapping for RentalCar defines a RentalCarBranch property, that might not be declared (check for typos; personally I’d name the property Branch instead).

    There’s another error there: you are defining everything as <property>, when all persistent entity references should be declared as <many-to-one>.

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

Sidebar

Related Questions

First off, thanks in advance for your help. This issue is driving me nuts.
JAVA: First off, Thanks so much for taking the time to look at my
first off: thanks for looking; your time is appreciated! to the point: SCHEMA: for
First of all thanks for taking your time to help me with this. Sorry
First off thanks to all the users who have made my android developing adventure
First off, let me thank you if you're taking the time to look at
First off, I am new to programming (especially with C#) and thanks for your
First off, I'm working on an app that's written such that some of your
First off, this is my first project using SQLAlchemy, so I'm still fairly new.
First off thank you in advance for taking time to help me with this,

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.