Ignore me on this one. It would appear that I was a victim of my own
noobiness. In this particular scenario what I really was an ordered
list:
private IList<ITitleList> titleLists = new List<ITitleList>();
[HasAndBelongsToMany(MapType = typeof(TitleList), Table =
"DVDListCollections", ColumnKey = "CategoryID", ColumnRef =
"DVDListID",
Lazy = true, RelationType = RelationType.List, Index =
"OrderBy")]
public virtual IList<ITitleList> Lists
{
get { return this.titleLists; }
set { this.titleLists = value;}
}
I.e.: RelationType = RelationType.List, Index = "OrderBy"
Cheers.
On Oct 16, 1:20 pm, Charlie M <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm currently utilizing the DatabaseTestFixtureBase base class to
> allow me to test against an in-memory SQLite database.
>
> I've just come across an issue that prevents me from testing an active-
> record class containing a property with the HasAndBelongsToMany
> relation, which itself has an OrderBy attrib defined. E.g.:
>
> [ActiveRecord(Table = "DVDListCategory")]
> public class TitleListCategory : BaseModel, ITitleListCategory
> {
> private IList<ITitleList> titleLists = new List<ITitleList>();
>
> [HasAndBelongsToMany(MapType = typeof(TitleList), Table =
> "DVDListCollections", ColumnKey = "CategoryID", ColumnRef =
> "DVDListID", Lazy = true, OrderBy = "DisplayOrder")]
> public virtual IList<ITitleList> Lists
> {
> get { return this.titleLists; }
> set { this.titleLists = value;}
> }
> }
>
> This maps to a many-to-many joining table named DVDListCollections.
> DisplayOrder is a column on this table.
>
> When running a test that hits this property, I'm greeted with the
> following:
>
> System.Data.SQLite.SQLiteException: SQLite error no such column:
> lists0_.DisplayOrder
>
> SQLite is evidently unaware of any column named DisplayOrder. It has
> not been created, which is not unexpected I suppose as it wouldn't
> know what type it was etc.
>
> Is this a known issue or am I simply missing something? If a known
> issue, can anyone suggest a work-around?
>
> I'm fairly new to the NHibernate/ActiveRecord game, and it should be
> noted that I'm working with a legacy database schema that I'm unable
> to make alterations to at this stage. I'd prefer to not have to create
> an intermediary class to "physicalize" the many-to-many relationship
> so would be keen to learn of other ideas.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Rhino Tools Dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rhino-tools-dev?hl=en
-~----------~----~----~----~------~----~------~--~---