Well, if you're generating your schema then that code you posted should work. I just ran it and I got: create table [Contributor] ( Id INT IDENTITY NOT NULL, SequenceNumber NVARCHAR(255) null, primary key (Id) )
create table Names ( Contributor_id INT not null, MyNames NVARCHAR(255) null ) Which is fine. Admittedly I'm not using MySql but SQLExpress, perhaps there is a problem with MySql and the schema generation. How are you generating your schema? On Wed, Feb 18, 2009 at 9:58 AM, Tom Warnat <[email protected]> wrote: > I don't understand. The schema is generated by code. So the listmapping > should be creating the table automaticly. > > > > Mit freundlichen Grüßen, > > > > Tom Warnat > > > > Mauve Mailorder Software GmbH & Co KG > > Steeler Wasserturm > > Laurentiusweg 83 > > 45276 Essen > > > > Fon: 0201 437918 0 > > Fax: 0201 431918 55 > > E-Mail: [email protected] > > E-Mail: [email protected] (System2) > > E-Mail: [email protected] (System3) > > E-Mail: [email protected] (Shop) > > http://www.mauve.eu/ > > > > Amtsgericht Essen, HRA 8514 > Geschäftsführer Christian Mauve > Ust-Id.DE243763811 > St.Nr.111/5770/1703 > > > > *From:* [email protected] [mailto: > [email protected]] *On Behalf Of *James Gregory > *Sent:* Montag, 16. Februar 2009 10:51 > > *To:* [email protected] > *Subject:* [fluent-nhib] Re: Mapping simple datatypes via fluent > nhibernate > > > > What's your schema? > > On Mon, Feb 16, 2009 at 9:48 AM, Tom Warnat <[email protected]> wrote: > > I do. > > > > Class: > > > > public class Contributor > > { > > #region Properties > > > > public virtual int Id { get; set; } > > > > public virtual string SequenceNumber { get; set; } > > > > public virtual IList<string> Names { get; set; } > > > > #endregion > > > > #region Constructor > > > > public Contributor() > > { > > this.SequenceNumber = String.Empty; > > > > this.Names = new List<string>(); > > } > > > > #endregion > > } > > > > Mapping: > > > > using FluentNHibernate.Mapping; > > > > public class ContributorMap : ClassMap<Contributor> > > { > > public ContributorMap() > > { > > Id(x => x.Id); > > > > Map(x => x.SequenceNumber); > > > > HasMany(x => x.Names).AsElement("MyNames"); //WithElement can > not be found… > > } > > } > > > > *From:* [email protected] [mailto: > [email protected]] *On Behalf Of *James Gregory > *Sent:* Montag, 16. Februar 2009 10:09 > > > *To:* [email protected] > *Subject:* [fluent-nhib] Re: Mapping simple datatypes via fluent > nhibernate > > > > Well, that code you gave is correct. Did you say you were mapping a * > List<string>*? Have you tried an *IList<string>*? > > On Mon, Feb 16, 2009 at 8:20 AM, Tom Warnat <[email protected]> wrote: > > > Hi, > > the WithElement-Option ist not valid. > > HasMany(x => x. MyListOfStrings).AsElement("foo") would be my only option. > > I get a MySql.Data.MySqlClient.MySqlException: Table 'foo' doesn't exist > while running this piece of code. > > > > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of James Gregory > Sent: Montag, 9. Februar 2009 14:13 > To: [email protected] > Subject: [fluent-nhib] Re: Mapping simple datatypes via fluent nhibernate > > > HasMany(x => x.MyListOfStrings) > .WithElement("string column name") > > This is from memory so it may not be exact. > > On 2/9/09, Tom Warnat <[email protected]> wrote: > > > > Hi, > > > > i've tryed to map a list of string via fluent nhibernate lately and i > > can't get it to run. > > > > So googling for 8 hours on friday i'll take my shoot here. > > > > Can anyone tell me to map a simply a List<string>? Furthermore how get > > fluent nhibernate to automatically create the relation for the list > > (which is basically my problem)? > > > > thanks in advance. > > > > > > > > > > > > > > > > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" 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/fluent-nhibernate?hl=en -~----------~----~----~----~------~----~------~--~---
