[fluent-nhib] Re: official homepage not working?!!

2009-09-15 Thread Paul Batum
Good idea, thanks Tomas. On Wed, Sep 16, 2009 at 5:07 AM, John Leger wrote: > > Thanks Tomas > > On Sep 15, 7:22 am, Tomas wrote: > > Took the pages I could find in the google cache and put up a copy of > > the currently down wiki onhttp://fluentnhibernate.wikia.com/ > > > > Hopefully useful un

[fluent-nhib] Re: Website down

2009-09-15 Thread Paul Batum
Not for me.. I still get the "it works" page. Torkel, James runs the wiki and he is currently on holidays. I've tried to get in touch with him but have had no luck. I am afraid we just have to be patient. Paul Batum On Tue, Sep 15, 2009 at 10:17 PM, Topflysecurity wrote: > > it is back > > On 1

[fluent-nhib] Re: Question: Modifying mappings after they are generated by FNH but before they are sent to NHibernate

2009-09-15 Thread Anthony Gatlin
Stuart, That's it. The BuildConfiguration is what I remember reading about. I'd certainly like to take a look at that. It might be just what I need. I also find Hudson's idea interesting. Although its not pretty, exporting the xml and transforming it in some way might overcome some limitations.

[fluent-nhib] Re: Accessing Id as public field?

2009-09-15 Thread anthony
Posting for posterity. I decided to go with a mix of fluent mappings for classes that I define myself, and hbm.xml mappings for classes I want to use as is. For reference, here's what my configuration code looks like: var config = Fluently.Configure().Database(...).Mappings(...); config.ExposeCo

[fluent-nhib] Re: Uni-directional many-to-many

2009-09-15 Thread Hudson Akridge
Furthermore, if you've got an intelligent 2nd level Caching setup, that'll just add to the performance in terms of what NH has to load across the wire from the DB, and what it can load from memory. On Tue, Sep 15, 2009 at 3:07 PM, Hudson Akridge wrote: > Lazy load :) Do a typical MTM setup with b

[fluent-nhib] Re: Uni-directional many-to-many

2009-09-15 Thread Hudson Akridge
Lazy load :) Do a typical MTM setup with both sides MTM, one marked as inverse, and set both sides to lazy load. That will proxy the collections until you use them (I am assuming that a single image is not associated to *every* document in your database). On Tue, Sep 15, 2009 at 2:56 PM, DannyT w

[fluent-nhib] Re: Uni-directional many-to-many

2009-09-15 Thread DannyT
Thanks Hudson, will revisit typical MTM and try to recall what the hurdle we were trying to overcome with that was (been going round in circles for hours so I forget!). Cheers for the thoughts Dan 2009/9/15 Hudson Akridge > Furthermore, if you've got an intelligent 2nd level Caching setup, that

[fluent-nhib] Re: Uni-directional many-to-many

2009-09-15 Thread DannyT
I guess I've manually mapped this before and fallen in the 70% bracket without issues. Is it then possible for Fluent AutoPersistanceModel to create such a mapping somehow even if it does result in 70/30 reliable code? Or what are the alternatives? The problem is this is a remote service that rec

[fluent-nhib] Re: Question: Modifying mappings after they are generated by FNH but before they are sent to NHibernate

2009-09-15 Thread Stuart Childs
Another possible option would be to do .BuildConfiguration() instead of .BuildSessionFactory() to get the NHibernate Configuration object. From there you can access the mappings that it is aware of, but I've never used it for anything except adding event listeners so I can't say how robust it is. H

[fluent-nhib] Re: Uni-directional many-to-many

2009-09-15 Thread Hudson Akridge
I've attempted to do this before, with extremely limited success. You question isn't a FNH one, but an NH question, and the quick answer is, no, it is not possible to do a uni-directional MTM. You can indeed map it as such, and it'll work for about 70% of the things you want to do, but you will get

[fluent-nhib] Re: Question: Modifying mappings after they are generated by FNH but before they are sent to NHibernate

2009-09-15 Thread Hudson Akridge
Well, Technically you can export the XML to some files using the .ExportTo() in the FluentConfig, then modify them, then load FNH with those XML documents. Not sure if there's a simpler way. On Mon, Sep 14, 2009 at 10:43 PM, Anthony Gatlin wrote: > > Here is another Newbie question. I am sure th

[fluent-nhib] Uni-directional many-to-many

2009-09-15 Thread DannyT
Can someone please tell me if it's possible to use the AutoPersistanceModel to generate a uni-directional many-to-many mapping? E.g: public class Document { public Guid Id{get; set;} public string Title {get; set;} public IList Images {get; set;} public Document(){} } public cla

[fluent-nhib] Re: Question: How to map a self referencing table

2009-09-15 Thread Hudson Akridge
Just map them like normal, as if they were two tables, but they're going to be the same tables, just different columns. So something like (Syntax is not going to be exact, it's pseudo FNH code) CategoryMap() { References(x=> x.ParentCategory).WithColumn("ParentCategoryID"); HasMany(x=> x.ChildCat

[fluent-nhib] Re: Question: How to map tables on multiple fields

2009-09-15 Thread Hudson Akridge
Look into the IInterceptor on NHibernate, you then register that in the configuration, and you gain access to the CUD events that NHibernate fires on the entity side. On Mon, Sep 14, 2009 at 10:37 PM, Anthony Gatlin wrote: > > > Here are a few Newbie questions. I am sure these are no-brainers fo

[fluent-nhib] Re: official homepage not working?!!

2009-09-15 Thread John Leger
Thanks Tomas On Sep 15, 7:22 am, Tomas wrote: > Took the pages I could find in the google cache and put up a copy of > the currently down wiki onhttp://fluentnhibernate.wikia.com/ > > Hopefully useful until James is back from a well-deserved holiday > > On Sep 15, 12:11 am, Paul Batum wrote: >

[fluent-nhib] Re: Entity specific next_hi values when using HiLo generator

2009-09-15 Thread Sean Gough
Just in case...here was my [quickly written] implementation: public void Apply(IIdentityInstance instance) { var tableClause = string.Format("TableName ='{0}'", instance.EntityType.Name); instance.GeneratedBy.HiLo("UniqueKeys", string.Format("NextHi_{0}",

[fluent-nhib] Re: Entity specific next_hi values when using HiLo generator

2009-09-15 Thread Sean Gough
Was worth a try, but unfortunately you still end up with one column and one row in the database. Even worse, it's the last entity to get mapped (say OrderNextHi) and other entity actions fail (since they are looking for their own columns). Looks like the only way to do this will be to write a cu

[fluent-nhib] Re: Parent's ID in child, with subchilds [one-to-many]

2009-09-15 Thread Hudson Akridge
You do not *need* a bidirectional, however life will sadly be a lot easier with one. If you don't have a bi-directional, and you attempt to delete a child, without also removing that child from the parent, then you will get a cascade exception. Having the bi-directional in place means that your chi

[fluent-nhib] Re: Parent's ID in child, with subchilds [one-to-many]

2009-09-15 Thread griti
Got it working, had the reference from child to parent once implemented but had not the inverse(), so I added the reference back. Now I have the reference without .inverse().. do I need it in any case? On 15 Sep., 17:21, griti wrote: > Forgot to mention that the database is setting the IDs of

[fluent-nhib] Re: Parent's ID in child, with subchilds [one-to-many]

2009-09-15 Thread griti
Forgot to mention that the database is setting the IDs of the objects, maybe this is also a problem for nhibernate? On 15 Sep., 17:13, griti wrote: > Thanks for the input, now it's storing the fk as expected for Log -> > LogEntry. > > For this case I don't need any reference back from the child.

[fluent-nhib] Re: Parent's ID in child, with subchilds [one-to-many]

2009-09-15 Thread griti
Thanks for the input, now it's storing the fk as expected for Log -> LogEntry. For this case I don't need any reference back from the child. When I remove .Inverse(), I get the following error: [InvalidOperationException: Collection was modified; enumeration operation may not execute.] What I d

[fluent-nhib] Re: official homepage not working?!!

2009-09-15 Thread Anthony Gatlin
That's a great idea! Thank you! On Sep 15, 6:22 am, Tomas wrote: > Took the pages I could find in the google cache and put up a copy of > the currently down wiki onhttp://fluentnhibernate.wikia.com/ > > Hopefully useful until James is back from a well-deserved holiday > > On Sep 15, 12:11 am, Pa

[fluent-nhib] Re: Parent's ID in child, with subchilds [one-to-many]

2009-09-15 Thread Hudson Akridge
You have .Inverse() marked on all of your OTM collections, but do not have a reference back from the child side to the parent in the mapping using a References(). In that case, an inverse is not what you'd want to set up on the OTM. Although, if a bi-directional is what you're looking for, then you

[fluent-nhib] Re: Automapping, protected, and problems with design

2009-09-15 Thread Peter Hageus
I'm also having trouble getting field access working. If I have no setter for my list I get: > System.ArgumentException : Property set method not found. My IHasManyConvention looks identical to your example below (I've also tried ReadOnlyPropertyThroughCamelCaseField). But, I have not tried

[fluent-nhib] Parent's ID in child, with subchilds [one-to-many]

2009-09-15 Thread griti
Hi there I am working in a prototype with fluent nhibernate 1.0 and nhibernate 2.1. So far the rules seemed logical to me. But now I have some kind of troubles getting the fk of the parent to the child's table. I have 3 tables(simplified): Log: -ID -Type LogEntry: -ID -Log_Id -Action LogEntry

[fluent-nhib] Re: Many-to-Many Realtionships

2009-09-15 Thread Hudson Akridge
As far as I'm aware, you cannot do this with a MTM, you'd need to split the join table into it's own class, then have two OTM relationships to it from the MTM classes, both of them using an ordered list based on that tertiary column. You may also want to try your question at NhUsers, as it's not sp

[fluent-nhib] Re: Website down

2009-09-15 Thread Topflysecurity
it is back On 15 Sep, 08:26, Torkel Ödegaard wrote: > It been down for a long time now with the message "It works!". > > Any ETA on when the site and wiki will be back? > > Cheers > Torkel --~--~-~--~~~---~--~~ You received this message because you are subscribed

[fluent-nhib] Re: official homepage not working?!!

2009-09-15 Thread Tomas
Took the pages I could find in the google cache and put up a copy of the currently down wiki on http://fluentnhibernate.wikia.com/ Hopefully useful until James is back from a well-deserved holiday On Sep 15, 12:11 am, Paul Batum wrote: > Our homepage, wiki etc are all managed by James who is aw

[fluent-nhib] Website down

2009-09-15 Thread Torkel Ödegaard
It been down for a long time now with the message "It works!". Any ETA on when the site and wiki will be back? Cheers Torkel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to thi

[fluent-nhib] Many-to-Many Realtionships

2009-09-15 Thread rqmedes
HI, I have a many-to-many relationship between 2 tables e.g Table A and Table B I am using a third a table C to join them base on the Id's from table A and B I need to join the information in a specific order and was thinking that my mapping table C could have another field to hold

[fluent-nhib] Re: Id of inserted object = 0

2009-09-15 Thread Topflysecurity
soleved this, the issue was that i had to call Session.Flush() manually when i save it in my repository. cause i had that configured that it should do that at the auto at the end request.. thought i post incase anybody run into the same problem.. On 14 Sep, 09:37, Topflysecurity wrote: > in my

[fluent-nhib] Re: Accessing Id as public field?

2009-09-15 Thread Mikael Henriksson
Ant that is part of what AutoMapper does... On Tue, Sep 15, 2009 at 11:22 AM, Anthony Gatlin wrote: > > > > On Sep 15, 2:23 am, anthony wrote: > > > This is in fact exactly what I'm doing now, but it feels somewhat > > extraneous. > > If you have to manually extend every class that might be a b

[fluent-nhib] Re: Accessing Id as public field?

2009-09-15 Thread Anthony Gatlin
On Sep 15, 2:23 am, anthony wrote: > This is in fact exactly what I'm doing now, but it feels somewhat > extraneous. If you have to manually extend every class that might be a bit of work. One option is to reflect on the assembly and iterate through the classes. (This is precisely what FNH do

[fluent-nhib] Re: How to use AnsiString by default?

2009-09-15 Thread Anthony Gatlin
James, would you mind sharing it. I was pretty sure it was possible but didn't know the specifics on how to implement it. I would love to see the specifics as I have somewhat similar requirement. Thanks! Anthony On Sep 15, 3:54 am, JamesSpibey wrote: > I figured this out. I just added a conven

[fluent-nhib] Re: How to use AnsiString by default?

2009-09-15 Thread JamesSpibey
I figured this out. I just added a convention which says then when the property type is string, it should set a CustomType of AnsiString On Sep 15, 7:42 am, JamesSpibey wrote: > Does anyone know how this is done? I can't find where the system types > are mapped into NH types in the code so a poi

[fluent-nhib] Re: Accessing Id as public field?

2009-09-15 Thread Mikael Henriksson
You could have a look at AutoMapper http://www.codeplex.com/AutoMapper On Tue, Sep 15, 2009 at 9:23 AM, anthony wrote: > > > > On Sep 14, 7:32 pm, Anthony Gatlin wrote: > > Anthony T., > > > > That's a pretty interesting idea--persisting objects from third par

[fluent-nhib] Re: Updated to trunk, lost Not.AutoImport();

2009-09-15 Thread Valeriu Caraulean
Anybody, ideas? I don't want back to .hbm's. Why FluentNHibernate broke backwards compatibility in a such way? On Sep 14, 6:21 pm, Valeriu Caraulean wrote: > Hi everybody. > > Just updated & have my mappings broken because there is no anymore > Not.AutoImport(). I cannot find this feature in cl

[fluent-nhib] Re: Accessing Id as public field?

2009-09-15 Thread anthony
On Sep 14, 7:32 pm, Anthony Gatlin wrote: > Anthony T., > > That's a pretty interesting idea--persisting objects from third party > libraries. I can think of a handful of cases right off the bat where > that might come in really handy. If FNH could auto-map these items and > persist them, that