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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:48:28+00:00 2026-06-10T15:48:28+00:00

Trying to map a Order Class with two identical sub classes and Getting the

  • 0

Trying to map a Order Class with two identical sub classes and Getting the following error

Could not find a getter for property 'RatingCriteria1' in class 'ORM.Entities.Enquiry.EnquiryOrder'

Basically I have one table in database with alot of columns. 12 columns are rating related

BuyerRatingCriteria1,BuyerRatingCriteria2, BuyerRatingCriteria3, BuyerRatingCriteria4, BuyerRatingCriteria5, BuyerRatingCriteriaComments

And

SupplierRatingCriteria1, SupplierRatingCriteria2, SupplierRatingCriteria3, SupplierRatingCriteria4, SupplierRatingCriteria5, SupplierRatingCriteriaComments

I want to simplify these into two subclasses on the so that i have

Order.SupplierRating.Criteria1

and

Order.BuyerRating.Criteria1

for example

public class EnquiryOrder : Entity
{
    public virtual int Id { get; set; }
    public virtual DateTime DateOrdered { get; set; }

    public virtual string PONumber { get; set; }
    public virtual string SONumber { get; set; }

    public virtual Rating SupplierRatings { get; set; }
    public virtual Rating BuyerRatings { get; set; }

}

public class Rating : Entity
{
    public virtual int RatingCriteria1 { get; set; }
    public virtual int RatingCriteria2 { get; set; }
    public virtual int RatingCriteria3 { get; set; }
    public virtual int RatingCriteria4 { get; set; }
    public virtual int RatingCriteria5 { get; set; }
    public virtual string RatingCriteriaComment { get; set; }

}

Mapping I thought would be as easy as this

    public EnquiryOrderMapping()
    {
        Id(x => x.Id).Column("EnquiryOrderId");
        Map(x => x.DateOrdered);

        Map(x => x.PONumber).Nullable();
        Map(x => x.SONumber).Nullable();

        Map(x => x.BuyerRatings.RatingCriteria1).Column("EnquiryBuyerRatingsRatingCriteria1").Nullable();
        Map(x => x.BuyerRatings.RatingCriteria2).Column("EnquiryBuyerRatingsRatingCriteria2").Nullable();
        Map(x => x.BuyerRatings.RatingCriteria3).Column("EnquiryBuyerRatingsRatingCriteria3").Nullable();
        Map(x => x.BuyerRatings.RatingCriteria4).Column("EnquiryBuyerRatingsRatingCriteria4").Nullable();
        Map(x => x.BuyerRatings.RatingCriteria5).Column("EnquiryBuyerRatingsRatingCriteria5").Nullable();
        Map(x => x.BuyerRatings.RatingCriteriaComment).Column("EnquiryBuyerRatingsRatingCriteriaComment").Nullable();

    }

No I have left out mapping the supplier side here as I was trying to simplify it best I could to be able to solve it.

So I don’t understand why its having a issue… I’ve told it which column to look at (full name) not “RatingCriteria1”

as well as when I do have a variable RatingCriteria1 it has a getter and setter!!!

very odd… am i missing something you have to do when mapping sub classes like this?

  • 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-06-10T15:48:30+00:00Added an answer on June 10, 2026 at 3:48 pm

    You need to map Ratings as a component, by doing:

    public EnquiryOrderMapping()
    {
        Id(x => x.Id).Column("EnquiryOrderId");
        Map(x => x.DateOrdered);
    
        Map(x => x.PONumber).Nullable();
        Map(x => x.SONumber).Nullable();
    
        Component(x => x.BuyerRatings,
            y => 
                {
                    y.Map(r => r.RatingCriteria1, "EnquiryBuyerRatingsRatingCriteria1").Nullable();
                    y.Map(r => r.RatingCriteria2, "EnquiryBuyerRatingsRatingCriteria2").Nullable();
                    y.Map(r => r.RatingCriteria3, "EnquiryBuyerRatingsRatingCriteria3").Nullable();
                    // etc..
                });     
        // etc..
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to map the following schema using the Entity Framework. A Customer can have
I'm trying to map a Dictionary containing Lists. I have the following set of
I'm trying to map entities of the same class (MyData) to each other through
I'm trying to make will_paginate's :order to work with this array: @posts = current_user.subscribed_tags.map(&:posts).flatten.paginate(:page
When trying to map an inherited property using AttributeOverride annotation, OpenJPA throws an error
TL; DR : I'm trying to map a many-to-many with an additionaly Order column
I'm trying to map an order and its order items in Hibernate. An order
I'm trying to make a wrapper to the STL map container, in order to
Im trying to map urls to numbers in a range [0,50] for porting, that
I am trying to map a legacy database here and I'm running into a

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.