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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:06:38+00:00 2026-06-06T21:06:38+00:00

I’m trying to setup a set of data models like so: [ActiveRecord, JoinedBase] public

  • 0

I’m trying to setup a set of data models like so:

[ActiveRecord, JoinedBase]
public class Locale : DataType
{
    private int m_id;
    private String m_DisplayName;
    private String m_Code;

    public Locale() 
    {
    }

    [PrimaryKey]
    public override int Id
    {
        get { return m_id; }
        set { m_id = value; }
    }

    [Property]
    public String DisplayName
    {
        get { return m_DisplayName; }
        set { m_DisplayName = value; }
    }

    [Property]
    public String Code
    {
        get { return m_Code; }
        set { m_Code = value; }
    }
}

[ActiveRecord, JoinedBase]
public class LocaleStringInstance : DataType
{
    private int m_id;
    private String m_text;

    public LocaleStringInstance() 
    {
    }

    [PrimaryKey]
    public override int Id
    {
        get { return m_id; }
        set { m_id = value; }
    }


    [Property]
    public String Text
    {
        get { return m_text; }
        set { m_text = value; }
    }
}

[ActiveRecord(Lazy=true), JoinedBase]
public class LocaleString : DataType
{
    private int m_id;
    private IDictionary<Locale, LocaleStringInstance> m_LocaleStrings;

    public LocaleString() 
    {
    }

    [PrimaryKey]
    public override int Id
    {
        get { return m_id; }
        set { m_id = value; }
    }

    [HasAndBelongsToMany(typeof(LocaleStringInstance),
        RelationType.Map, ColumnRef="LS_Col_Ref", ColumnKey = "LocaleStringInstance_id", Table = "LocaleStringMapping", 
        RelationType = RelationType.Map, Cascade = ManyRelationCascadeEnum.AllDeleteOrphan,
        Lazy = true, Index = "Locale", IndexType= "Locale")]
    virtual public IDictionary<Locale, LocaleStringInstance> LocaleStrings 
    {
        get { return m_LocaleStrings; }
        set { m_LocaleStrings = value; }
    }
}

The main problem lies in trying to model the last property here, “LocaleStrings”.
The idea is that a particular LocaleString will have a string for each ‘locale’ that has been defined. The Dictionary is supposed to represent this.

Unfortunately when I try to register these types with ActiveRecord I get the following error:
ActiveRecordException: {“Could not determine type for: Locale, for columns: NHibernate.Mapping.Column(Locale)”} System.Exception {NHibernate.MappingException}

This is because the “IndexType” is set to “Locale”.. But what should it be set to? I’ve tried adding the full namespace to the beginning of Locale, which didn’t work. I’ve also tried setting to string, and int, which naturally work during registration, but fail when I try to actually use the object because a Locale can’t be converted to a string or integer.

Does anyone know how to use this RelationType.Map and IndexType properly? How can I acheive a model that does what I’m looking for?

Thanks

Josh

  • 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-06T21:06:39+00:00Added an answer on June 6, 2026 at 9:06 pm

    Unfortunately it appears that it is not possible to model the described relation using Castle.ActiveRecord at this time as it does not support the required parameters that NHibernate would need to make sense of it.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I am doing a simple coin flipping experiment for class that involves flipping a
I would like to run a str_replace or preg_replace which looks for certain words

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.