Re: [fluent-nhib] Re: Automapping primary key as database assigned - GeneratedBy.Identity()

2012-03-14 Thread Brad Laney
I forgot to get the code for you again, my bad. I'll try to remember tomorrow. On Wed, Mar 14, 2012 at 3:34 AM, Sofi wrote: > I was expecting same thing - views should be treated just as if they were > tables, that's why at first I gave example with table. I thought I was > doing something wrong

Re: [fluent-nhib] Re: Automapping primary key as database assigned - GeneratedBy.Identity()

2012-03-14 Thread Sofi
I was expecting same thing - views should be treated just as if they were tables, that's why at first I gave example with table. I thought I was doing something wrong. When I switched inserting into a table, without changing convention, everything was fine. NH throws error like "null identifier" o

Re: [fluent-nhib] Re: Automapping primary key as database assigned - GeneratedBy.Identity()

2012-03-13 Thread Brad Laney
Pretty sure NH doesn't know if its a view or a table. NH is a ORM that does not know of the databases existence. You tell it what to do and it does it ignoring the settings on the db. I have this setup and it works fine. I'll reply with our primary key convention tomorrow. On Tue, Mar 13, 2012 at

[fluent-nhib] Re: Automapping primary key as database assigned - GeneratedBy.Identity()

2012-03-13 Thread Sofija Blazevski
I'm a bit surprised no one answered. Anyway, I just wanted to correct myself, as I actually wanted to insert into a view, not a table. So, conclusion on this is that FluentNHibernate generates correct xml file, but NHibernate doesn't generate expected sql if an insert is made on a view. And that is

[fluent-nhib] Re: Automapping with SQL Server function name as table name

2011-11-08 Thread Rasmoo
You may be able to fix it by using SchemaMetadataUpdater.QuoteTableAndColumns On Nov 8, 7:06 am, jd wrote: > Hi all, > > I am getting this error: > > http://d4dilip.wordpress.com/2011/09/28/nhibernate-error-incorrect-sy... > > The above post suggests wrapping the table/column name with '[name]' >

Re: [fluent-nhib] Re: Automapping and subclassing

2011-09-29 Thread Asbjørn Ulsberg
Ah, I'm such a dumb-ass. The reason AutoMappingTester doesn't work is because there isn't a separate mapping (that is, an HBM.XML) for the Subclass. It exists only as a child node of Superclass' mapping file, so if I want to test how Subclass is mapped, I have to create AutoMappingTester and

Re: [fluent-nhib] Re: Automapping and subclassing

2011-09-29 Thread Asbjørn Ulsberg
Just to add to the problems with joined subclasses, it seems that it's impossible to use AutoMappingTester on a class that is subclass-mapped. FNH at least throws the following exception in my face: System.InvalidOperationException : Could not find mapping for class 'Subclass' at FluentNHi

Re: [fluent-nhib] Re: Automapping and subclassing

2011-09-28 Thread Asbjørn Ulsberg
Thanks for your insights! The things I'm mapping is the Id and foreign key. I've hacked my way around all of this by implementing IJoinedSubclassConvention like this: public class JoinedSubclassConvention : IJoinedSubclassConvention { private static readonly IList joinedSubclasses; static J

Re: [fluent-nhib] Re: Automapping and subclassing

2011-09-27 Thread Isaac Cambron
I looked into this for a while (original group post here). Basically, subclassing from an override doesn't work at all. I took a stab at fixing it (branch is her

[fluent-nhib] Re: Automapping and subclassing

2011-09-27 Thread James Gregory
Is it just foreign key naming you're doing, or more? Have you seen the ForeignKeyConvention base class? You might be able to use that instead; but either way, that class implements IJoinedSubclassConvention so it might give you some ideas. Documentation on this area is sparse; frankly, because

[fluent-nhib] Re: Automapping and subclassing

2011-09-27 Thread Asbjørn Ulsberg
After some digging, I've found IJoinedSubclassConvention that is being invoked when mapping. I've found ISubclassConvention as well, but that is not being invoked. I guess joined subclass is the default and that any other convention needs to be configured somewhere else(?). Either way, I'm st

Re: [fluent-nhib] Re: automapping, overrides, and subclasses

2011-09-06 Thread Isaac Cambron
Bump. Any thoughts here? On Mon, Aug 29, 2011 at 4:32 PM, Isaac Cambron wrote: > It doesn't seem to. I haven't dug deep to find out why, but here it is. > First, my other email used an old syntax. It should have said this: > > mapping > .DiscriminateSubClassesOnColumn("typeid") > .SubClass(1, m

Re: [fluent-nhib] Re: automapping, overrides, and subclasses

2011-08-29 Thread Isaac Cambron
It doesn't seem to. I haven't dug deep to find out why, but here it is. First, my other email used an old syntax. It should have said this: mapping .DiscriminateSubClassesOnColumn("typeid") .SubClass(1, m => { }) .SubClass(2, m => { }); which is way nicer (you describe that change here

Re: [fluent-nhib] Re: automapping, overrides, and subclasses

2011-08-25 Thread James Gregory
Ah, I think we've got a hole in our API here. In a non-automapping scenario you'd use a SubclassMap, which gives you a DiscriminatorValue method you can call; sounds like we need that in the overrides to facilitate what I thought was already available. Does the deprecated method still work? --

Re: [fluent-nhib] Re: automapping, overrides, and subclasses

2011-08-24 Thread Isaac Cambron
I should have been more specific. What I'm really trying to do is set up the discriminator values. So I've got something like: public void Override(AutoMapping mapping) { var des = mapping.DisciminateSubClassesOnColumn("typeid"); des .SubClass(m => {}) //a. deprecated, b. weird em

[fluent-nhib] Re: automapping, overrides, and subclasses

2011-08-23 Thread James Gregory
It's been a while since I've done any work on the Automapper, so I may have forgotten how it works... Is there a reason why you can't just create an override for the subclass type itself (instead of overriding the superclass and calling Subclass)? -- You received this message because you are s

[fluent-nhib] Re: Automapping Read Only Properties

2011-05-01 Thread James Gregory
Automapping is really going to struggle to make sense of your DisplayTitle property. As it's a getter only, it'll try to find a backing field that matches; off the top of my head, I don't know what it'll do if it doesn't find one. The Access.ReadOnlyProperty() method looks suspiciously broken.

Re: [fluent-nhib] Re: Automapping Read Only Properties

2011-04-30 Thread Paul Batum
The API might have changed a little but this blog post covers the approach that most people use: http://blog.overridethis.com/blog/post/2010/06/04/FluentNHibernate11-RTW-and-ReadOnly-Properties.aspx On Fri, Apr 29, 2011 at 11:12 PM, Mohamed Meligy wrote: > No, I didn't. Jose told me I should be

Re: [fluent-nhib] Re: Automapping Read Only Properties

2011-04-29 Thread Mohamed Meligy
No, I didn't. Jose told me I should be able to do this and he is doing it in his confORM example. Note that this different from the other "private setter" problem arising in .NET 3.2. Anyway, after a chat with Jose we agreed this is fine to use in Override and this is how I completed the sample a

[fluent-nhib] Re: Automapping Read Only Properties

2011-04-29 Thread tclay
Have you tried using a protected empty setter? public virtual string DisplayTitle { get { return Name; } protected set { ; } } On Apr 8, 12:46 am, Mohamed Meligy wrote: > I am trying to map read only properties (property with getter and no setter) > via a

[fluent-nhib] Re: AutoMapping Children ... again

2010-06-13 Thread Chris C
NHibernate is really intended to always use transactions. The newer versions tend to complain unless you turn of the transaction checking. If you don't create a transaction the database will have to create an implicit one per statement anyway. On Jun 12, 8:49 am, Derek Greer wrote: > I usually u

[fluent-nhib] Re: Automapping not-null for fields

2010-04-09 Thread Rob#
I have got the answer. http://stackoverflow.com/questions/2605930/fluent-nhibernate-automap-convention-for-not-null-field/2607868#2607868 Thanks. On Apr 8, 5:34 pm, "Rob#" wrote: > Hi, > Could some one help, how would I instruct automap to have not-null for > a cloumn? > >     public class Pape

[fluent-nhib] Re: AutoMapping with Composite ID's

2010-02-14 Thread Corey Coogan
Hi Paul that is correct. I would like to access the KeyProperties. I have not tried to update ICompositeIdentityInstance. I have no problem contributing, but I have to learn how to use GIT first, which is a barrier right now due to my current schedule. On Feb 13, 6:57 am, Paul Batum wrote:

[fluent-nhib] Re: AutoMapping with Composite ID's

2010-02-14 Thread Corey Coogan
Hey Paul, On Feb 13, 6:57 am, Paul Batum wrote: > Hi Corey, > > If I'm following you correctly, the issue is the ICompositeIdentityInstance > interface. It doesn't provide a way to alter the KeyProperties, but if it > did, use that mechanism to update the mapping based on the values of some > cu

Re: [fluent-nhib] Re: AutoMapping with Composite ID's

2010-02-13 Thread Paul Batum
Hi Corey, If I'm following you correctly, the issue is the ICompositeIdentityInstance interface. It doesn't provide a way to alter the KeyProperties, but if it did, use that mechanism to update the mapping based on the values of some custom attributes. Does that sound correct to you? Have you tri

Re: [fluent-nhib] Re: automapping version column

2010-02-07 Thread Paul Batum
When was the last time you updated your build of FNH? The problem with your Version member being ignored when on the base class was resolved a few builds back. You shouldn't have any problems with it if you're on the latest. On Thu, Feb 4, 2010 at 2:12 AM, RT wrote: > I should've been more speci

[fluent-nhib] Re: automapping tag

2010-02-04 Thread RT
I consider myself a newbie to this world...but, here is my take... My current code for mapping entities is something like AddEntityAssembly(assemblyContainingMappedType) .Where(entity => entity.Namespace.EndsWith("Entities") && e

[fluent-nhib] Re: automapping version column

2010-02-03 Thread RT
I should've been more specific. If the property is in the derived class, it gets generated fine. If the property is in the base class (preferred approach), it doesn't. I can live with this limitation for now though. Thanks again for your prompt responses. On Feb 3, 10:01 am, James Gregory wrot

Re: [fluent-nhib] Re: automapping version column

2010-02-03 Thread James Gregory
Property name can be Version or Timestamp, case insensitive; and the property type should be int, long, TimeStamp, or byte[]. On Wed, Feb 3, 2010 at 2:56 PM, RT wrote: > Hi James, > > Thanks for the response. > > I initially called the property Version and it was completely ignored. > I figured

[fluent-nhib] Re: automapping version column

2010-02-03 Thread RT
Hi James, Thanks for the response. I initially called the property Version and it was completely ignored. I figured since Version was a SQL server keyword, it was ignored. That is the reason I changed the property to RowVersion. is there anything else I need to do besides using the property name

[fluent-nhib] Re: AutoMapping with Composite ID's

2010-01-26 Thread Corey Coogan
I think I was confused on what this convention would actually do. I see that this is a convention to be applied to Composite ID mappings. That is very useful, but I was actually looking for a way to read a custom attribute from a class and map a composite ID from the convention itself, like I can

[fluent-nhib] Re: AutoMapping with Composite ID's

2010-01-26 Thread Corey Coogan
I'll have a look at it today and letyou know how it ends up. On Jan 25, 9:41 pm, Paul Batum wrote: > Hi Corey, > > I've managed to get Chris's work into my dev branch, one of the tests was > failing but that has now been resolved. > > Its available here:http://github.com/paulbatum/fluent-nhiberna

Re: [fluent-nhib] Re: AutoMapping with Composite ID's

2010-01-25 Thread Paul Batum
Hi Corey, I've managed to get Chris's work into my dev branch, one of the tests was failing but that has now been resolved. Its available here: http://github.com/paulbatum/fluent-nhibernate/tree/dev Can you let me know how it goes? I would prefer to let you have a run with it before I ask James

Re: [fluent-nhib] Re: AutoMapping with Composite ID's

2010-01-22 Thread Paul Batum
Yeah my bad, this one ended up in the black hole that is my starred items in gmail. I can set aside some time to look at this over the next few days. On Tue, Jan 19, 2010 at 7:49 AM, Hudson Akridge wrote: > I'm not an automapping guru sadly :( So again, there might be some > workarounds that I'm

Re: [fluent-nhib] Re: AutoMapping with Composite ID's

2010-01-18 Thread Hudson Akridge
I'm not an automapping guru sadly :( So again, there might be some workarounds that I'm unaware of (very possible). Hoping for Paul or James to chime in. They know much more about automapping than me. On Mon, Jan 18, 2010 at 2:29 PM, Corey Coogan wrote: > Thanks Hudson, > I saw this thread w

[fluent-nhib] Re: AutoMapping with Composite ID's

2010-01-18 Thread Corey Coogan
Thanks Hudson, I saw this thread where Chris C. wrote an implementation in November 09, but I don't see it in the trunk. http://groups.google.com/group/fluent-nhibernate/browse_thread/thread/8c2a254c6b7bd932?fwc=1 I don't know where this ever ended up. Is there any other work around for thi

[fluent-nhib] Re: Automapping an encapsulated Collection

2010-01-14 Thread tbushell
On Jan 13, 11:00 am, Ryan Kelley wrote: > Yes, I can make it work as an override. But, my whole reasoning for > wanting to convert to AutoMapping was that I didn't want to have to > have a bunch of extra classes that defined each class and how to map > it. That's one of the reasons I went strai

Re: [fluent-nhib] Re: Automapping an encapsulated Collection

2010-01-14 Thread Paul Batum
I've just been using overrides to handle this. I certainly would like to hear about it if anyone does find a way to do this with conventions. My expectation has been that the only way around the overrides is to make the necessary modifications to FNH directly, but I'd love to be proved wrong. On

[fluent-nhib] Re: Automapping an encapsulated Collection

2010-01-13 Thread Ryan Kelley
Yes, I can make it work as an override. But, my whole reasoning for wanting to convert to AutoMapping was that I didn't want to have to have a bunch of extra classes that defined each class and how to map it. Granted, 1 line of override for a class vs. 12 lines in a ClassMap is better, but it is st

[fluent-nhib] Re: Automapping an encapsulated Collection

2010-01-13 Thread Ryan Kelley
typeof (IEnumerable))); >         } >     } > > -Original Message- > From: fluent-nhibernate@googlegroups.com > [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of Ryan Kelley > Sent: 13 January 2010 14:53 > To: Fluent NHibernate > Subject: [fluent-nhib] Re: Automa

[fluent-nhib] Re: Automapping an encapsulated Collection

2010-01-13 Thread tbushell
>in my fluent mappings I just had this: >HasMany(x => x.GetTeams()).Access.CamelCaseField >(Prefix.Underscore).Cascade.SaveUpdate(); I'm not clear - have you tried to get this working as an override? It's my impression that everything you can do in a mapping class can also be done as an override

RE: [fluent-nhib] Re: Automapping an encapsulated Collection

2010-01-13 Thread Martin Hornagold
ype() .IsAssignableFrom(typeof (IEnumerable))); } } -Original Message- From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of Ryan Kelley Sent: 13 January 2010 14:53 To: Fluent NHibernate Subject: [fluent-nhib] Re: Automapping

[fluent-nhib] Re: Automapping an encapsulated Collection

2010-01-13 Thread Ryan Kelley
I changed one of these to a property, readonly instead of a method and still no luck. Is there something obvious I am missing? On Jan 12, 11:03 am, Ryan Kelley wrote: > I have been googling, and reading through some of the stuff on the > group and have been unable to find an answer to this questi

[fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-12-19 Thread tbushell
Yes lose the SubId. > > >> -Original Message- > >> From: fluent-nhibernate@googlegroups.com > > >> [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of tbushell > >> Sent: 17 December 2009 20:10 > >> To: Fluent NHibernate > &

[fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-12-18 Thread tbushell
: fluent-nhibernate@googlegroups.com > > [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of tbushell > Sent: 17 December 2009 20:10 > To: Fluent NHibernate > Subject: [fluent-nhib] Re: Automapping multiple lists of the same type > in an Entity - possible bug? > > Martin, > > I

RE: [fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-12-18 Thread Martin Hornagold
In your case you wouldn't need any extra members for the subclasses. Yes lose the SubId. -Original Message- From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of tbushell Sent: 17 December 2009 20:10 To: Fluent NHibernate Subject: [fluent

Re: [fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-12-17 Thread Paul Batum
Sorry Cliff I misunderstood your question. Perhaps it would be best if you started a new thread and explained your situation? On Fri, Dec 18, 2009 at 7:46 AM, tbushell wrote: > > > On Dec 17, 12:09 pm, cliff vaughn wrote: > > I did notice this, but dismissed it since I don't use auto mappings >

[fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-12-17 Thread tbushell
On Dec 17, 12:09 pm, cliff vaughn wrote: > I did notice this, but dismissed it since I don't use auto mappings I tend to do the opposite, since I try to do everything with Automapping. > On second look, it does seem to give me > what i was after if it works with regular maps. Can't say for su

[fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-12-17 Thread tbushell
Martin, I think I'm starting to get this, except for one thing... You've introduced two new classes that inherit from DistributionResult, but don't show any members for them. What, if anything, do I put between the braces? Also, if it's any help, here's my current implementation of Distribution

[fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-12-17 Thread Martin
I still think the best alternative is to look at Hudsons earlier advice and use inheritance. Using your example: public class DistributionResult{ } public class LogNormalDistributionResult : DistributionResult { ... } public class ContinDistributionResult : DistributionResult { .

Re: [fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-12-17 Thread cliff vaughn
On Thu, Dec 17, 2009 at 4:51 PM, tbushell wrote: > > On Dec 17, 9:29 am, cliff vaughn wrote: > > THanks Paul, but i was hoping to see some mappings to help illustrate the > > point a bit clearer. Specifically, the one to many with flags. I'm > > assuming you'd just have to specify a where clau

[fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-12-17 Thread tbushell
On Dec 17, 9:29 am, cliff vaughn wrote: > THanks Paul, but i was hoping to see some mappings to help illustrate the > point a bit clearer.  Specifically, the one to many with flags.  I'm > assuming you'd just have to specify a where clause, but not completely > sure. Cliff, did you notice this c

[fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-12-17 Thread tbushell
On Dec 16, 4:57 pm, Paul Batum wrote: > Would we? > > To be honest I'm skeptical about whether the extra complexity would be worth > it in this case. Thanks for clarifying. I asked because if you and James thought it was a simple change, I would have looked into attempting it myself. Realistic

Re: [fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-12-17 Thread cliff vaughn
THanks Paul, but i was hoping to see some mappings to help illustrate the point a bit clearer. Specifically, the one to many with flags. I'm assuming you'd just have to specify a where clause, but not completely sure. Also, could you do something like that with a one to one type mapping? On Thu

Re: [fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-12-17 Thread Paul Batum
There's two major options. Either you leave it as one to many, or you make it a many to many. As a one to many, you end up with flags on the child table. As a Many to Many, you can either have flags on the joining table, or you can have multiple joining tables. One option will probably make more se

Re: [fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-12-17 Thread cliff vaughn
Just curious, can someone show the other ways of mapping this that would work well in FNH? On Wed, Dec 16, 2009 at 10:00 PM, James Gregory wrote: > I agree entirely. I was just trying to be polite. > > > On Wed, Dec 16, 2009 at 9:57 PM, Paul Batum wrote: > >> Would we? >> >> To be honest I'm ske

Re: [fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-12-16 Thread James Gregory
I agree entirely. I was just trying to be polite. On Wed, Dec 16, 2009 at 9:57 PM, Paul Batum wrote: > Would we? > > To be honest I'm skeptical about whether the extra complexity would be > worth it in this case. Especially considering that there are multiple ways > in which this scenario can be

Re: [fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-12-16 Thread Paul Batum
Would we? To be honest I'm skeptical about whether the extra complexity would be worth it in this case. Especially considering that there are multiple ways in which this scenario can be handled in terms of relational db schema... In my opinion, if people really want to approach the implementation

Re: [fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-12-16 Thread James Gregory
I was going to write a long winded reply concerning your design decisions, but I think it can more easily be summed up as: *If it hurts, don't do it*. You're the first person in the life of FNH to need to do this, that should raise alarm bells. We'll gladly accept a patch to support this behavio

[fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-12-16 Thread tbushell
On Dec 15, 11:19 am, kimsk112 wrote: > I am sorry to hijack this thread. I just wonder why you don't use Many- > To-Many (i.e., create an association table) to differentiate between > those lists? Is the above method (i.e., extra property in the class) > better way to do this? My sample code wa

[fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-12-16 Thread kimsk112
Thanks for sharing your thought. I agree that this has nothing to do with NH or FNH, but it is more about design decision. For many-to-many way, if the class will be used again in another place (e.g., new collection or a collection in another class), I will not need to create another child class ju

Re: [fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-12-15 Thread Hudson Akridge
A many to many table would work where you specified separate tables in each many to many mapping. However I assume the way it's set up the OP only wanted 1 store association per employee. Another way of solving this comes down to (what I consider to be) proper OO design using inheritance. Staff an

[fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-12-15 Thread kimsk112
I am sorry to hijack this thread. I just wonder why you don't use Many- To-Many (i.e., create an association table) to differentiate between those lists? Is the above method (i.e., extra property in the class) better way to do this? Thanks, karlkim -- You received this message because you are su

[fluent-nhib] Re: Automapping all instances of a component

2009-12-02 Thread Zuber
I am also looking for the same. Any help is appreciated. Thanks On Oct 20, 2:17 am, kujotx wrote: > I am using AutoMapping and am trying to suss out the best practice for > mapping components using conventions. I have seen the wiki convention > usage, but don't see how to map a component. > > Cur

[fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-11-25 Thread tbushell
On Nov 24, 4:58 am, Paul Batum wrote: > Interesting that the namespaces were the issue. I have no idea why this > would be the case. If I find the time, I might try to reproduce it, because > really this sounds like a bug to me. Yes, it certainly seems like a bug. > In general most people (in

Re: [fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-11-24 Thread Paul Batum
Interesting that the namespaces were the issue. I have no idea why this would be the case. If I find the time, I might try to reproduce it, because really this sounds like a bug to me. In general most people (including myself) put their mapping classes and conventions in a seperate assembly to the

[fluent-nhib] Re: Automapping and ManyToManyConvention

2009-11-24 Thread OyvindHansen
To answer my own question, I solved the issue by adding a "Id" Primary Key to the ServiceCountry table, naturally because my mapping says it should look for a "Id" PK. However I'm more interested in how to map multiple Primary Keys with the automapping functionality on ServiceCountry table. On

[fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-11-23 Thread tbushell
Paul, Many, many thanks for this! I now have working code I can start putting in my application. Also, because you provided a fully working, standalone project, I was able to figure out why I'd been unable to get overrides to work in the past. I had been putting my map override classes (e.g. p

Re: [fluent-nhib] Re: Automapping to create indexes on associations

2009-11-21 Thread Paul Batum
Yes this was added for HasMany only a month or so ago. On Thu, Nov 19, 2009 at 7:25 PM, Sergey Prokhorenko < sergey.prokhore...@gmail.com> wrote: > Hm, I only see "string name" and "params string[] names" Add method > signatures. Is it in a newer release? I can't tell the exact release > that I'm

Re: [fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-11-21 Thread Paul Batum
The automapper doesn't have anything to handle this case, mostly because there is no obvious "default implementation" for it. Eric's suggestion of using formula's was close but not quite what you wanted - instead it is "where". Here are the classes: public class Employee { public virt

[fluent-nhib] Re: Automapping multiple lists of the same type in an Entity - possible bug?

2009-11-20 Thread tbushell
Eric, Thanks for the suggestion, but I just spent the last 10 minutes googling "Formula", and couldn't make heads or tails of the examples I found. Could you : - give me a sample formula (or point me to a good example) - tell me exactly where I need to place the formula (in CreateSessionFactory?

[fluent-nhib] Re: Automapping to create indexes on associations

2009-11-19 Thread Sergey Prokhorenko
Hm, I only see "string name" and "params string[] names" Add method signatures. Is it in a newer release? I can't tell the exact release that I'm using but it's couple of months old. On Nov 19, 9:58 am, Paul Batum wrote: > Are you talking about one to many's or many to many's? Your code example i

[fluent-nhib] Re: Automapping many-to-many deterministic?

2009-10-25 Thread Paul Batum
Does anyone know if this is still an issue? If its reproducible I would like to investigate it. On Tue, Sep 1, 2009 at 9:10 AM, David Archer wrote: > > (I'm using FluentNhibernate 1.0.0.572) > > Using the automapping feature of fluent nhibernate and have my app > auto-updating the DB schema on s

[fluent-nhib] Re: AutoMapping Boot Up Speed

2009-10-21 Thread Hudson Akridge
Is your entire assembly only 6 classes? Because we've seen slowdowns on relatively large assemblies before. Assuming it's small, could Be any number of factors at work here. Session factory should typically build faster than 2 seconds on a simple/small mapping setup. So that leads me to beli

[fluent-nhib] Re: AutoMapping Boot Up Speed

2009-10-21 Thread James Gregory
Without benchmarking it'd be hard to say. My first reaction is no I don't think that time can be reduced. I believe most of the time will be spent in Assembly.GetTypes(), and there's not much we can do about that. If that * isn't* the case, then of course we'll optimise anything that needs to be do

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

2009-09-20 Thread Paul Batum
] >public void CanSaveChildEntities() >{ >IList list = new List { new > TestEntityB{Comment = "Test"}}; > >new PersistenceSpecification(_pm.GetSession()) >.CheckProperty(e => e.Name, "Test") >

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

2009-09-16 Thread Peter Hageus
.CheckList(e => e.Children, list) .VerifyTheMappings(); } /Peter From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of Paul Batum Sent: den 16 september 2009 15:29 To: fluent-nhibernate@googlegroups.com Subject: [fluent-nhib] Re: A

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

2009-09-16 Thread Paul Batum
tomapping) > > /Peter > > From: fluent-nhibernate@googlegroups.com > [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of Paul Batum > Sent: den 5 september 2009 05:38 > To: fluent-nhibernate@googlegroups.com > Subject: [fluent-nhib] Re: Automapping, protected, and problems with design >

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

2009-09-15 Thread Peter Hageus
ncies, I'm trying to work out how to use 100% automapping) /Peter From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of Paul Batum Sent: den 5 september 2009 05:38 To: fluent-nhibernate@googlegroups.com Subject: [fluent-nhib] Re: Automapping, protected, a

[fluent-nhib] Re: Automapping overrides for ignored base classes

2009-09-10 Thread Kevin Dente
Good idea. I'll give it a try and report back. On Sep 8, 9:50 pm, Paul Batum wrote: > Hi Kevin, > > Have you tried something like this: > >     public class BaseMap : IAutoMappingOverride where T : EntityBase >     { >         public void Override(AutoMap mapping) >         { >             // Ma

[fluent-nhib] Re: Automapping overrides for ignored base classes

2009-09-08 Thread Paul Batum
Hi Kevin, Have you tried something like this: public class BaseMap : IAutoMappingOverride where T : EntityBase { public void Override(AutoMap mapping) { // Map base class stuff here } } public class SurveyMap : BaseMap, IAutoMappingOverride

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

2009-09-07 Thread queen3
Hm, yesterday I read NHibernate In Action, particularly section about access to fields instead of properties, and didn't even think about the possibility to use it. I think this will work to a good degree. I can even use IPropertyAccessor if needed. Thank you, this is definitely better. I wonder

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

2009-09-04 Thread Paul Batum
Whoops, got a bit happy with using resharper hints, the _children field should not be declared as readonly. On Sat, Sep 5, 2009 at 1:38 PM, Paul Batum wrote: > Sergey, > > You do not have to use Reveal() for the cases you described. Say I have > this entity: > > public class TestEntityA >

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

2009-09-04 Thread Paul Batum
Playtime, Can you explain what you meant by this: On Fri, Sep 4, 2009 at 9:41 PM, playtime wrote: > > This and the requirement that everything be virtual/overridable makes > the Automapper useless to me in it's current form. > > To my knowledge, we make our entites have virtual properties and m

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

2009-09-04 Thread Paul Batum
Sergey, You do not have to use Reveal() for the cases you described. Say I have this entity: public class TestEntityA { public virtual int Id { get; set; } private readonly IList _children = new List(); public virtual IEnumerable Children { get

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

2009-09-04 Thread queen3
I personally do not have major problems with private auto- properties.To me it is more helpful to have automatic discovery of private members of choice, whether those are fields or properties. Still, this is not a show-stopper and so I don't think I'm going to insist on this. The topic I wanted to

[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: Automapping, protected, and problems with design

2009-09-04 Thread Mikael Henriksson
Personally I prefer the fluent mapping. It is so much easier to get up and running when working with an existing database schema or when there is a need to customize naming etc on tables. I honestly don't see the wickedness in auto mapping. :) On Fri, Sep 4, 2009 at 2:03 PM, queen3 wrote: > > Hm

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

2009-09-04 Thread queen3
Hm, something like IPropertyFinder would definitely be nice to have for AutoMapping, so that I can for example tell to include members named like "field" and don't touch purely internal ones like "_field", and so on. This would make some of the issues above go away... except for manual overrides w

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

2009-09-04 Thread playtime
I abandoned using the Automapper for similar reasons. If your entities are dumb and look more like service DTOs, you can use the Automapper. This and the requirement that everything be virtual/overridable makes the Automapper useless to me in it's current form. You cannot have anything beyond s

[fluent-nhib] Re: Automapping bi-directional one-to-many

2009-09-03 Thread Peter Hageus
re further, and see if I can come up with a solution. /Peter From: fluent-nhibernate@googlegroups.com [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of Paul Batum Sent: den 3 september 2009 14:39 To: fluent-nhibernate@googlegroups.com Subject: [fluent-nhib] Re: Automapping bi-dir

[fluent-nhib] Re: Automapping bi-directional one-to-many

2009-09-03 Thread Paul Batum
gt; > > create table "TestEntityB" ( > > Id integer, > >Comment TEXT, > >ParentId INTEGER, > >TestEntityAId INTEGER, > >primary key (Id) > > ) > > > > > > /Peter > > > &g

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

2009-09-03 Thread queen3
I by the way, as far as I understand, if I do mapping.Map(x => Reveal.Property("quantity")); I also have to do mapping.IgnoreProperty(x => x.Quantity); so it's TWICE a work if I want a good design. Or, back to mapping inside entities... Or, avoid AutoMapping at all. So, to summa

[fluent-nhib] Re: Automapping bi-directional one-to-many

2009-09-02 Thread Peter Hageus
hibern...@googlegroups.com] On Behalf Of Paul Batum Sent: den 2 september 2009 14:26 To: fluent-nhibernate@googlegroups.com Subject: [fluent-nhib] Re: Automapping bi-directional one-to-many Peter, Are you sure your situation is this simple? This is just a typical one to many, which should a

[fluent-nhib] Re: Automapping bi-directional one-to-many

2009-09-02 Thread Paul Batum
Peter, Are you sure your situation is this simple? This is just a typical one to many, which should automap fine. I don't understand where you are getting the ClassAId fk from. Can you double check the info you've provided? Paul Batum On Tue, Sep 1, 2009 at 8:48 PM, Peter Hageus wrote: > > > H

[fluent-nhib] Re: Automapping to datetime2

2009-08-21 Thread Chris F
Just in case anyone searches the forums and is looking for an answer to this question: I finally got around to caring about this and solved it using a PropertyConvention: public class DateTimeConvention : IPropertyConvention { public bool Accept(IProperty target) {

[fluent-nhib] Re: Automapping Joined Subclasses using a convention?

2009-07-27 Thread Chris Fazeli
Okay, Finally had a chance to upgrade to S#arp Arch 1.0 RTM again, and to further upgrade to NH 2.1GA + FNH r542. Quick aside: building FNH on Windows is tough with rake. I just did a Release build in VS after having no success with Rake. The changes work like a charm. Thanks again. Here's my c

[fluent-nhib] Re: Automapping IUserType (custom Url type) using Conventions - not working!

2009-07-21 Thread James Gregory
That's correct, yes. Your entities should never actually know about your IUserType's. On Tue, Jul 21, 2009 at 11:05 PM, Chris Fazeli wrote: > > I think I figured it out. > > I had: > public class Contact : IEntityWithTypeId > { >... >public virtual Url PictureUrl { get; set; } // DB colu

[fluent-nhib] Re: Automapping IUserType (custom Url type) using Conventions - not working!

2009-07-21 Thread Chris Fazeli
I think I figured it out. I had: public class Contact : IEntityWithTypeId { ... public virtual Url PictureUrl { get; set; } // DB column has the same name ... } But I'm supposed to have: public virtual Uri PictureUrl (not Url PictureUrl). If I understand correctly, the Url : IUserTyp

[fluent-nhib] Re: Automapping Joined Subclasses using a convention?

2009-07-20 Thread James Gregory
Agreed, it's annoying. It would've been nice to get the releases in sync, but Billy is an even faster worker than myself. On Mon, Jul 20, 2009 at 10:37 PM, Chris Fazeli wrote: > > Hi James, > > Thanks, I'll give this a try and report back. > > As I'm using #Arch, this may be a bit tough. I've re

  1   2   >