[fluent-nhib] Re: many to many

2009-08-13 Thread Wayne Douglas
Hey James do you have any clues as to where to look in the fnh base? I'm going to have a snoop myself - i'm new to nhib and fnh so probably wont turf up much but it's worth a look right :) w:// On Thu, Aug 13, 2009 at 10:40 AM, Wayne Douglas wrote: > Cheers man - really appreciate it - I have

[fluent-nhib] Re: "Keyword not supported: 'statement cache size'."

2009-08-13 Thread Froggymeister
I'll definitely give it a go when it's ready and available. 2009/8/14 David R. Longnecker > Glad you got it working! If I may ask, when the changes hit the master > branch, please give the Fluently method another shot... I'd be interested to > see how things work out with the updates. > > Than

[fluent-nhib] one-to-one, hasOne? how to do it properly

2009-08-13 Thread Topflysecurity
hi. i been checking around for a good example but did not find one. i want to do a one-to-one mapping but im not sure how i should do that really. it is my Customer that got a CustomerConfiguration. how should i do a basic setup of this? thx in advance --~--~-~--~~~---

[fluent-nhib] Re: "Keyword not supported: 'statement cache size'."

2009-08-13 Thread David R. Longnecker
Glad you got it working! If I may ask, when the changes hit the master branch, please give the Fluently method another shot... I'd be interested to see how things work out with the updates. Thanks for the response! :) -dl On Thu, Aug 13, 2009 at 4:57 PM, Froggymeister wrote: > So I got it work

[fluent-nhib] Re: Mapping Inheritence

2009-08-13 Thread AzamSharp
The only problem is that I don't want to add another column in the Users table. If I like to know who is teacher then I will create a UserRoles table and that will be linked with the Users table. Thanks, Azam On Aug 13, 5:01 pm, James Gregory wrote: > Who said anything about roles? > I don't th

[fluent-nhib] Re: Mapping Inheritence

2009-08-13 Thread James Gregory
You need to rethink your design. It's either a fully fledged subclass with a discriminator, or you just use a User entity that has a Role property; you can't save with one and query with the other. On Thu, Aug 13, 2009 at 11:04 PM, AzamSharp wrote: > > The only problem is that I don't want to ad

[fluent-nhib] Re: Mapping Inheritence

2009-08-13 Thread James Gregory
Who said anything about roles? I don't think I can make this any simpler... Add a new column into your Users table called Discriminator, this column will hold the class name for that role. *That is all you need to do.* Given this table: | UserId | FirstName | LastName | | 1 | James | Gr

[fluent-nhib] Re: Mapping Inheritence

2009-08-13 Thread AzamSharp
Forget about the Role information. I am just assigning FirstName and LastName to a Teacher object. Roles and UserRoles will be different table since one person can have many roles. How can I just insert the Teacher's "FirstName" and "LastName" into the Users table? On Aug 13, 4:53 pm, James Greg

[fluent-nhib] Re: "Keyword not supported: 'statement cache size'."

2009-08-13 Thread Froggymeister
So I got it working. Yea! I ended up using the connection below. It turns out that the reason I wasn't getting the expected results was because there weren't any results in the table to return. How could that be? Simple; when I first ran the application, it proceeded to create tables in my schema

[fluent-nhib] Re: Mapping Inheritence

2009-08-13 Thread James Gregory
You need another column in your Users table to tell NHibernate what each row is. How else is it supposed to be able to tell what entity each row is? On Thu, Aug 13, 2009 at 10:52 PM, AzamSharp wrote: > > No I don't have a discriminator column. I only have a Users table > which has the following

[fluent-nhib] Re: Mapping Inheritence

2009-08-13 Thread AzamSharp
No I don't have a discriminator column. I only have a Users table which has the following fields: UserId, FirstName and LastName. There is not even a Teacher table or a Student table. Teacher and Student both uses the Users table to store the information. On Aug 13, 4:48 pm, James Gregory wr

[fluent-nhib] Re: Mapping Inheritence

2009-08-13 Thread James Gregory
Do you have a column name called discriminator? You need a column in your table which tells NHibernate what the entity a row represents, that is what you put in the DiscriminateSubClassesOnColumn call. On Thu, Aug 13, 2009 at 10:46 PM, AzamSharp wrote: > > Now it is throwing invalid column name

[fluent-nhib] Re: Mapping Inheritence

2009-08-13 Thread AzamSharp
Now it is throwing invalid column name discriminator: public class UserMap : ClassMap { public UserMap() { Id(x => x.Id).ColumnName("UserId"); Map(x => x.FirstName); Map(x => x.LastName); WithTable("Users"); Discri

[fluent-nhib] Re: Mapping Inheritence

2009-08-13 Thread James Gregory
Then just leave the mapping empty! SubClass(m => {}); On Thu, Aug 13, 2009 at 10:44 PM, AzamSharp wrote: > > Teacher does not have anything extra. It only uses the inherited > fields from the User class! > > On Aug 13, 4:43 pm, James Gregory wrote: > > No you don't need to remap them. Just map

[fluent-nhib] Re: Mapping Inheritence

2009-08-13 Thread AzamSharp
Teacher does not have anything extra. It only uses the inherited fields from the User class! On Aug 13, 4:43 pm, James Gregory wrote: > No you don't need to remap them. Just map anything that *only* appears on > Teacher inside the SubClass call. > > > > On Thu, Aug 13, 2009 at 10:42 PM, AzamShar

[fluent-nhib] Re: Mapping Inheritence

2009-08-13 Thread James Gregory
No you don't need to remap them. Just map anything that *only* appears on Teacher inside the SubClass call. On Thu, Aug 13, 2009 at 10:42 PM, AzamSharp wrote: > > Here is my code: > > public class UserMap : ClassMap >{ >public UserMap() >{ > Id(x => x.Id).ColumnNa

[fluent-nhib] Re: Mapping Inheritence

2009-08-13 Thread AzamSharp
Here is my code: public class UserMap : ClassMap { public UserMap() { Id(x => x.Id).ColumnName("UserId"); Map(x => x.FirstName); Map(x => x.LastName); WithTable("Users"); DiscriminateSubClassesOnColumn("discriminator

[fluent-nhib] Re: Mapping Inheritence

2009-08-13 Thread James Gregory
You haven't mapped your teacher. public class UserMap : ClassMap { public UserMap() { Id(x => x.Id); Map(x => x.PropertyInUser); // // mappings on User and all subclasses here // DiscriminateSubClassesOnColumn("discriminator") .SubClass(m => { // an

[fluent-nhib] Re: Mapping Inheritence

2009-08-13 Thread AzamSharp
I have a scenario where I have a base class called "User" and I have inherited classed called "Teacher" and "Student". I have define some properties in the User class which are also used in the Teacher and Student through inheritance. I have defined the UserMap with all the mappings. But it throws

[fluent-nhib] Re: Mapping Inheritence

2009-08-13 Thread James Gregory
DiscriminateSubClassOnColumn is only to be used for the discriminator column, the column in your table that dictates what entity type the row contains. All other properties are mapped normally. On Thu, Aug 13, 2009 at 10:10 PM, AzamSharp wrote: > > Hi, > > I just looked at the syntax for Discrim

[fluent-nhib] Re: Mapping Inheritence

2009-08-13 Thread AzamSharp
Hi, I just looked at the syntax for DiscriminateSubClassesOnColumn() which is little weird but anyway!! It seems like I have to create a DiscriminateSubClassesOnColumn for every column that is being used in the Base class. Is that right? That will be a disaster for me since I have several fields

[fluent-nhib] Re: JoinedSubclass ignoring Property and Reference conventions

2009-08-13 Thread playtime
Right on time for me then :) Will persevere in the meantime with a workaround. On Aug 13, 12:37 pm, James Gregory wrote: > Imminent as in hopefully next week. > > On Thu, Aug 13, 2009 at 12:33 PM, playtime wrote: > > > > > > > Care to expand on imminent? ;) > > > I wasn't sold on Fluent the fir

[fluent-nhib] KeyColumnNames not working with self-referencing table

2009-08-13 Thread Fregas
I'm using FluentNH version 0.1.0.535 I have the following mapping on a self-referencing table/class called UserAccount. Basically I want useraccount to have an IList of user accounts (one-to-many) but have the column name with the FK to be called ParentAccountID. But it always calls it UserAcco

[fluent-nhib] Re: medium trust

2009-08-13 Thread Jorgas
On the same subject... What I ended up doing was that I am still using FluentNHibernate for mapping using c# mapping files. And from those I generate *.hbm files that I include in my project as embedded resources. And instead of configuring NHibernate in my running application using Fluently.Conf

[fluent-nhib] Re: Table per class hierarchy mapping error

2009-08-13 Thread Roger
I will give it a try. Do I need to go through these steps in order to update FNH in Sharp Architecture? http://groups.google.com/group/sharp-architecture/browse_thread/thread/f37a99ecfa681770# I have a question on mapping. Employee, a subclass of User, has a many- to-one relationship with Role.

[fluent-nhib] Re: "Keyword not supported: 'statement cache size'."

2009-08-13 Thread David R. Longnecker
Using the connection string below (and with working server, instance, user, pass, and a mapping object), I connected to an Oracle i9 v9.2.0.8 database without any errors. Unfortunately, not being the "DBA dude" I don't have access to the dba schema to see if, perhaps, statement cache size is a set

[fluent-nhib] Re: JoinedSubclass ignoring Property and Reference conventions

2009-08-13 Thread James Gregory
Imminent as in hopefully next week. On Thu, Aug 13, 2009 at 12:33 PM, playtime wrote: > > Care to expand on imminent? ;) > > I wasn't sold on Fluent the first time saw it a while ago but > conventions and the improved ease of generating the database has made > it very useful. > > Keep it up. > >

[fluent-nhib] Re: JoinedSubclass ignoring Property and Reference conventions

2009-08-13 Thread playtime
Care to expand on imminent? ;) I wasn't sold on Fluent the first time saw it a while ago but conventions and the improved ease of generating the database has made it very useful. Keep it up. On Aug 13, 8:41 am, James Gregory wrote: > Sounds like a bug. This issue won't be present in our immine

[fluent-nhib] Re: medium trust

2009-08-13 Thread Jorgas
Mick's patch had new types that were not available in the patch. I can demonstrate what happens when making the following call: Fluently.Configure() .Database(MySQLConfiguration.Standard.ShowSql ().Dialect("NHibernate.Dialect.MySQL5Dialect, Nhibernate")

[fluent-nhib] Re: many to many

2009-08-13 Thread Wayne Douglas
Cheers man - really appreciate it - I have about 3 seperate projects needing this so will help me out hugely. w:// On Thu, Aug 13, 2009 at 10:36 AM, James Gregory wrote: > Definitely a bug then. I'll have a look tonight. > On Thu, Aug 13, 2009 at 10:15 AM, Wayne Douglas > wrote: >> >> yesterday

[fluent-nhib] Re: many to many

2009-08-13 Thread James Gregory
Definitely a bug then. I'll have a look tonight. On Thu, Aug 13, 2009 at 10:15 AM, Wayne Douglas wrote: > > yesterday. I grabbed the latest and built it using horn - it all works > fine except adding the many to many convention > > On Thu, Aug 13, 2009 at 10:12 AM, James Gregory > wrote: > > I thi

[fluent-nhib] Re: many to many

2009-08-13 Thread Wayne Douglas
yesterday. I grabbed the latest and built it using horn - it all works fine except adding the many to many convention On Thu, Aug 13, 2009 at 10:12 AM, James Gregory wrote: > I think there's a bug. When was the last time you upgraded FNH? > > On Wed, Aug 12, 2009 at 8:49 PM, Wayne Douglas > wrot

[fluent-nhib] Re: many to many

2009-08-13 Thread James Gregory
I think there's a bug. When was the last time you upgraded FNH? On Wed, Aug 12, 2009 at 8:49 PM, Wayne Douglas wrote: > > Hi > > I've searched the internet trying to figure out how to get many to > many mappings working - i'm a bit new to fluent too. > > so far i've tried: > > > > > configurat

[fluent-nhib] Re: Table per class hierarchy mapping error

2009-08-13 Thread James Gregory
Looks like a bug, I'd advise updating your copy of FNH. On Thu, Aug 13, 2009 at 5:29 AM, Roger wrote: > > I haven been using the latest release of Sharp Architecture with > Fluent Nhibernate. I ran into this error: > > ---> NHibernate.MappingException: Could not compile the mapping > doc

[fluent-nhib] Re: Component Access Convention

2009-08-13 Thread James Gregory
Sounds like a bug. This issue will be resolved in our imminent 1.0 release. On Thu, Aug 13, 2009 at 1:55 AM, playtime wrote: > > I have a component that I map as follows: > > Component(x => x.Value, CurrencyAmountComponent.Map > ()).Access.AsPascalCaseField(Prefix.Underscore); > > I would like to

[fluent-nhib] Re: JoinedSubclass ignoring Property and Reference conventions

2009-08-13 Thread James Gregory
Sounds like a bug. This issue won't be present in our imminent 1.0 release. On Thu, Aug 13, 2009 at 3:37 AM, playtime wrote: > > The constructor for the Party entity map is: > >public PartyMap() >{ >Id(x => x.Id); >//Other studd >JoinedSubClass(

[fluent-nhib] Re: Get Mapping XML when invalid?

2009-08-13 Thread James Gregory
Configured in what way? WriteMappingsTo and CompileMappings are mutually exclusive, I'm pretty sure you shouldn't be calling both. You should look into the Fluent Configuration stuff, which has better support for exporting mappings. On Th

[fluent-nhib] Re: Tweaking BuildConfiguration for performance?

2009-08-13 Thread James Gregory
The HBM objects still require serializing to XML, it's the meta classes that don't; however, those classes are a *nightmare* to work with. The issue we also have is XML is the public, backwards-compatible, interface to NH, the meta classes are subject to change at any time; this makes FNHs integrat