[fluent-nhib] Re: Hiding Useless Memembers (like ToString, GetType, etc)

2009-09-29 Thread Stuart Childs
llow you to hide members from third party >> consumers of your code, and not hide them from yourself during >> development. >> >> On Sep 28, 2:20 pm, Stuart Childs wrote: >> > Yes, that is what I tried. I tried unchecking filter by >> [EditorBrowsable], >> >

Re: Fw: [fluent-nhib] Re: Hiding Useless Memembers (like ToString, GetType, etc)

2009-09-28 Thread Stuart Childs
orBrowsable] attribute" > under Environment, IntelliSense, Completion Appearance. Once that's enabled, > you can select whether you want to see members marked Always and/or > Advanced. > > *From:* Stuart Childs > *Sent:* Monday, September 28, 2009 10:17 AM > *To:* fluen

[fluent-nhib] Re: Hiding Useless Memembers (like ToString, GetType, etc)

2009-09-28 Thread Stuart Childs
pletion Appearance. Once that's enabled, > you can select whether you want to see members marked Always and/or > Advanced. > > *From:* Stuart Childs > *Sent:* Monday, September 28, 2009 10:17 AM > *To:* fluent-nhibernate@googlegroups.com > *Subject:* [fluent-nhib] Re: Hidin

[fluent-nhib] Re: Hiding Useless Memembers (like ToString, GetType, etc)

2009-09-28 Thread Stuart Childs
I really like this idea, especially since I can use it on a few "wart" members that have to be public but aren't really supposed to be used by consumers of the class. I can't seem to get it to work with ReSharper though, even if I tell it to filter based on the EditorBrowsable attribute. Works fine

[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: My first fluent nhibernate ..

2009-09-09 Thread Stuart Childs
This is your problem: "Unable to load type 'NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle' during configuration of proxy factory class." The message also has your solution: Solution: Confirm that your deployment folder contains one of the following assemblies: NHibern

[fluent-nhib] Re: Wiki Documentation Query

2009-09-09 Thread Stuart Childs
If I've read my documentation (http://docs.jboss.org/hibernate/stable/core/reference/en/html/inheritance.html) properly, you are correct. I've changed the text to match. Thanks, Barry! On Tue, Sep 8, 2009 at 10:29 PM, Barry Dahlberg wrote: > > On this page: > http://wiki.fluentnhibernate.org/Flu

[fluent-nhib] Re: BuildSessionFactory Performance

2009-09-08 Thread Stuart Childs
I also have a fairly complex architecture spanning at least a dozen assemblies with around a hundred entities and it doesn't take 40 seconds to load. My suggestion would be to make sure you have some good logging throughout your library and application. If you can see how long each section is taki

[fluent-nhib] Re: No Cascade Delete-Orphan option?

2009-09-05 Thread Stuart Childs
, 2009 at 3:40 AM, James Crowley > wrote: > > Sorry Stuart - crossed emails! Thanks for checking - 'tis good to know > I'm not going entirely mad ;) > > 2009/9/4 Stuart Childs : > > > > I just looked and here is the full cascade dictionary for N

[fluent-nhib] Re: No Cascade Delete-Orphan option?

2009-09-04 Thread Stuart Childs
return action == CascadingAction.Delete; } public override bool HasOrphanDelete { get { return true; } } } The question is now what to do about it. :) On Fri, Sep 4, 2009 at 12:22 PM, Stuart Childs wrote: > Well, looking back as far a

[fluent-nhib] Re: No Cascade Delete-Orphan option?

2009-09-04 Thread Stuart Childs
Well, looking back as far as the 1.0.2 documentation, only the following cascades are documented: cascade="all|none|save-update|delete|all-delete-orphan" I also found this comment from January 14: "Hmm.. I'm using NHibernate 2.2 and this happens: [MappingException: Unsupported cascade style: del

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

2009-09-04 Thread Stuart Childs
>> like Map(Reveal.Property("propertyName") - another complaint >> is that it doesn't seem to look for fields, only properties). FluentNHibernate does not current support fields, at all. For more info, see this thread: http://groups.google.com/group/fluent-nhibernate/browse_thread/thread/6c1fb736

[fluent-nhib] Re: Entity-name attribute

2009-09-03 Thread Stuart Childs
Feel free to request it, but don't expect much. ;) I doubt we'll move back to that. For what it's worth, we actually do have a list of all the elements and attributes supported by NHibernate and their level of support in FNH. Part of the problem is that we simply don't know what some of them are f

[fluent-nhib] Re: Reveal of fields not supported

2009-09-03 Thread Stuart Childs
As you mentioned, the entire architecture of FNH is based primarily around properties. There is no support for fields at the moment, but you are not the first to request such a thing. As I recall, there was some discussion and it was decided that we'd wait until after the 1.0 release to consider f

[fluent-nhib] Re: Disabling lazy load

2009-09-03 Thread Stuart Childs
I think your problem is you've made the classic mistake of confusing session.Get and session.Load. session.Load will always return a proxy object. I can't remember if it will initialize it from the session cache, but if it's not in the cache it will be an empty object (except for the ID). If you

[fluent-nhib] Re: Access to SessionFactory

2009-09-03 Thread Stuart Childs
Being that we're all developers, maybe some source code would be more clear. :) Here's an example ripped straight from one of my libraries: var lconfig = ServiceLocator.Current.GetInstance("Default"); var config = Fluently.Configure() .Database(lconfig.PersistenceFor().Internal)

[fluent-nhib] Re: Access to SessionFactory

2009-09-02 Thread Stuart Childs
I'm also not sure what SessionSource is, but I suspect it's an internal testing tool. I'll try to look into it later and reply again (assuming it's even worth mentioning...). As such, I really don't think it's intended for end-user use. Make sure you've read the wiki for how to get started: http:/

[fluent-nhib] Re: Problems with inheritance mapping

2009-08-25 Thread Stuart Childs
That's how it's supposed to work because NH 2.0 changed the default flush mode to Commit (see http://markmail.org/message/pjqelacrqu5jormi#query:+page:1+mid:gte3kefsewskmgfa+state:results). Previously it was set to Auto, so NHibernate would flush the session before executing a query, making sure

[fluent-nhib] Re: Using an ISet<>

2009-08-20 Thread Stuart Childs
He's probably referring to the Iesi.Collections library included along with NH. AFAIK, we don't have implicit support for the Iesi collections. Have you tried HasMany(x => x.YourCollection).AsSet(); ? The default collection type is bag. On Thu, Aug 20, 2009 at 10:13 AM, James Gregory wrote: > So

[fluent-nhib] Re: FNH new features

2009-08-20 Thread Stuart Childs
The current trunk release is supporting the NH 2.1 GA release. Previously FNH only supported 2.0. So yes, it's being upgrade along with NH. On Thu, Aug 20, 2009 at 1:23 PM, Sachin wrote: > > yea...I mean to say as NH is upgrading itself so are we coming up with > newer versions of FNH as well? >

[fluent-nhib] Re: AsIndexedCollection

2009-08-20 Thread Stuart Childs
; private IDictionary forecasts = new > Dictionary(); > > > > :) > > when i have the refactoring stable i'll come back to this - one of the > benefits i was hoping for was to bring in fluentnhibernate.testing - > lovelly. time's a constraint as ever though &g

[fluent-nhib] Re: AsIndexedCollection

2009-08-20 Thread Stuart Childs
It takes either the column name string or a lambda expression pointing to the index property on your entity. What sort of collection are you trying to map? If we know the signature and desired behavior, we might be able to give a better answer. On Thu, Aug 20, 2009 at 4:05 AM, Wayne Douglas wrote

[fluent-nhib] Re: Map a view to an entity

2009-07-28 Thread Stuart Childs
QLite.SQLiteException : SQLite error >  no such table: Theme > > Whereas when I execute the sql in SQLite expert directly all goes > well. Any suggestions on how to get this working with SQLite? > > On Jul 28, 9:01 pm, Stuart Childs wrote: >> NHibernate requires that mappe

[fluent-nhib] Re: Map a view to an entity

2009-07-28 Thread Stuart Childs
NHibernate requires that mapped classes have an element. You haven't created one with your mapping. Instead of Map(s => s.ReportID); you need Id(s => s.ReportID);. On Tue, Jul 28, 2009 at 1:58 PM, Tomk wrote: > > > I'd like to map a view to a newly created entity. I'm only after > getting the da

[fluent-nhib] Re: inlining raw hbm.xml code for ternary association into an existing fluent mapping?

2009-07-28 Thread Stuart Childs
Unless someone fixed it when I wasn't looking, AsTernaryAssociation can only generate a mapping that "looks correct" in XML, but doesn't actually work (i.e. NH wants a Dictionary object, AsTernaryAssociation won't take one). I started on some HasMap functionality to make mapping "Maps" more fluent

[fluent-nhib] Re: Getting started: how to map IDictionary?

2009-06-30 Thread Stuart Childs
This is currently broken, see issue 230: http://code.google.com/p/fluent-nhibernate/issues/detail?id=230 You could try that patch I attached to the issue but that was quite a while ago so there is no way of knowing if it will work or

[fluent-nhib] Re: Problems with guid primary keys and WithTable()

2009-06-01 Thread Stuart Childs
Hudson is referring to the Id(...).GeneratedBy bit. Since you are using a Guid primary key, you need to call one of the following: Id(...).GeneratedBy.Guid(); // NH will call Guid.NewGuid() Id(...).GeneratedBy.GuidComb(); // Uses the Guid Comb algorithm to improve performance and indexing capabilit

[fluent-nhib] Re: Fields cannot be mapped properly with strange error message.

2009-05-31 Thread Stuart Childs
James' point was not that he knows all, but that fixing fields is a low priority at the moment. The code base is in a somewhat awkward state while the SM is put into place the FI is fleshed out. Adding new features is also a low priority at the moment, so you can imagine that fixing something that

[fluent-nhib] Re: AutoMap, Inheritance and Reference

2009-05-22 Thread Stuart Childs
I've most often seen the "Index was outside the bounds of the array" exception when column names were missing. Can you export your mappings with a .ExportTo("path") and look through them or post them here? On Fri, May 22, 2009 at 9:41 AM, Jon M wrote: > > The message I get is as follows: > > Flu

[fluent-nhib] Re: Mapping based on Join? Read only entities?

2009-05-21 Thread Stuart Childs
Well, I had been typing out a response here but then you had to go and post a SO question and I'm a rep whore :P Hope it helps, and like Hudson said, we're always happy to help even when the questions are much more NH related. We just want to make sure you get the best help and the NH forum is pro

[fluent-nhib] Re: Null Index Column Exception when mapping List

2009-05-19 Thread Stuart Childs
This is an NHibernate issue and I'm not 100% sure, but the error message implies to me that you have a null value in your index column. NHibernate requires your index column to be integer values starting at zero. However, export the mappings FNH is generating to be sure it's not an issue

[fluent-nhib] Re: Order of Conventions and Overrides

2009-05-15 Thread Stuart Childs
Funnily enough, we've been discussing the topic of ordering conventions in a fluent, generic way because "we haven't had any complaints yet but..." I guess you broke that silence. :) I think for now you'll have to continue providing exceptions on your conventions. As far as detecting if Inverse has

[fluent-nhib] Re: Fluent Xml Validation Exception

2009-05-14 Thread Stuart Childs
Are you by chance using an older version of FluentNHibernate? There was a previous issue where component parts were not being sorted correctly so would occasionally be put in the wrong place (like before the element). On Thu, May 14, 2009 at 3:01 PM, Marcos Matos wrote: > Hi, > I'm using Fluent

[fluent-nhib] Re: Array of simple types

2009-05-13 Thread Stuart Childs
As I understand it, all collections besides Set and Bag require an index. So the indexSelector is the property you want to use as the collection index value. m.HasMany(x => x.People).AsArray(p => p.Name) If you are not creating an indexed collection, trying mapping it as a bag or set instead. On

[fluent-nhib] Re: NOTICE: Source moved to Github

2009-05-13 Thread Stuart Childs
50 you say? I think the local goat farm is going to be stretched thin. :P On a more serious note, thanks a ton to James for putting in the work to get this all working. Now everyone reward him with an inundation of pull requests (I'm doing my best already)! On Wed, May 13, 2009 at 3:18 PM, Hudson

[fluent-nhib] Re: Filtering HasMany Collection

2009-05-12 Thread Stuart Childs
First off, if you have a many-to-many relationship, you probably want to be using HasManyToMany instead of HasMany. It sounds like your model looks like (or should look like) [apologies if my ASCII art breaks ;)]: /> Guest (Subclass of O

[fluent-nhib] Re: Dependencies

2009-05-12 Thread Stuart Childs
NHibernate.Linq is used for a Repository which (I believe) is only used by the unit tests. Perhaps the FluentNHibernate.Data namespace could simply be moved to the FluentNHibernate.Testing library which should move the dependency on .Linq from FNH proper to the test suite. I haven't tried though s

[fluent-nhib] Re: Mapping ternary association

2009-05-12 Thread Stuart Childs
I have a patch that implements this for which I'll open an issue. It adds an AsTernaryAssociation method to many-to-many relationships. If it's not correct or you think there is a better way to get the functionality, I think you'll want to start looking at ManyToManyPart.cs (and possibly ToManyBas

[fluent-nhib] Re: error running tutorial

2009-05-08 Thread Stuart Childs
That's an NHibernate error thrown when the mapping file is incorrect. Add a .ExportTo("Directory path here") after AddFromAssemblyOf to get FNH to write out all the mapping files it is passing to NHibernate. If you are familiar with NHibernate HBM files, you might see the problem or you could post

[fluent-nhib] Re: no "property-ref" on HasMany... any work arounds?

2009-05-06 Thread Stuart Childs
I just submitted a patch for issue 207 that might work for you if you are using the alpha. On May 6, 2:55 pm, Stuart Childs wrote: > This is currently not supported by NHibernate *at all*, though it > supposedly is included in version 2.1.0Alpha2. So unless you're using > the alph

[fluent-nhib] Re: no "property-ref" on HasMany... any work arounds?

2009-05-06 Thread Stuart Childs
This is currently not supported by NHibernate *at all*, though it supposedly is included in version 2.1.0Alpha2. So unless you're using the alpha version, you can't do this. If you *are* using the alpha, you can't do this with FNH. :) As you know, there is no way to set "property-ref" and SetAtt

[fluent-nhib] Re: many-to-one column name

2009-05-06 Thread Stuart Childs
ith your ReferenceConvention I get: > > > > Is there a way of getting de Parent of a Reference in a convention? > > Thanks > > On Wed, May 6, 2009 at 3:37 PM, Stuart Childs wrote: > > > What you need to do is create a new class for the convention and > >

[fluent-nhib] Re: many-to-one column name

2009-05-06 Thread Stuart Childs
What you need to do is create a new class for the convention and implement IReferenceConvention. Like: public class ReferenceConvention : IReferenceConvention { public bool Accept(IManyToOnePart part) { return true; } public void Apply(IManyToOnePart part) {

[fluent-nhib] Re: building database w/AutoMapping column ordering question

2009-05-01 Thread Stuart Childs
Oops, I made the previous list by scanning the documentation instead of the mapping schema .xsd... Might want to add the following to the list: meta jcs-cache idbag primitive-array union-subclass filter sql-* Though it's probably unnecessary since I think most (all?) don't really apply for FNH's

[fluent-nhib] Re: building database w/AutoMapping column ordering question

2009-05-01 Thread Stuart Childs
to-many many-to-many collection-id On May 1, 11:45 am, Stuart Childs wrote: > Correct; the generated HBM files have no whitespace... easy enough to > fix with a ctl+k, ctl+d in VS. ;) > > On May 1, 11:41 am, James Gregory wrote: > > > Ah yes, silly mistake. I've added this

[fluent-nhib] Re: building database w/AutoMapping column ordering question

2009-05-01 Thread Stuart Childs
;ve also noticed that > dynamic-component and one-to-one are both missing too, so there may be more > too. This should really be reviewed. > As for the other thing, is it that there's no whitespace in the output? > > On Fri, May 1, 2009 at 5:33 PM, Stuart Childs wrote: > >

[fluent-nhib] Re: building database w/AutoMapping column ordering question

2009-05-01 Thread Stuart Childs
g the ordering > code. > > On Fri, May 1, 2009 at 5:05 PM, Stuart Childs wrote: > > > While I'm not using AutoMappings, I was having a similar issue but was > > more severe (with only one of my classes, too... one of many oddities) > > where properties/components w

[fluent-nhib] Re: building database w/AutoMapping column ordering question

2009-05-01 Thread Stuart Childs
While I'm not using AutoMappings, I was having a similar issue but was more severe (with only one of my classes, too... one of many oddities) where properties/components were being put before the tag, causing NHibernate to fail. It's very bizarre, but grouping all the Map(), Component(), and Ref