[fluent-nhib] Re: collection item referencing abstract base class

2009-06-16 Thread Hudson Akridge
I don't see a problem with your child referencing the parent with the parent being a base class. As long as Stage is mapped, and it contains the collection mapping for Estimates, then you're golden. From memory it'd be something like this:public class StageMap : ClassMap { Id(x=>x.Id).AsYourIdType(

[fluent-nhib] nhibernate filter support

2009-06-16 Thread Dru Sellers
any updates on plans to support this? -d --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-nhibernate@googlegroups.com To unsubscribe from this grou

[fluent-nhib] Re: How to map a CompositeUserType?

2009-06-16 Thread George Mauer
As far as I've been able to to tell my mapping is correct. I can also map each of those columns separately. Here is the full error that I'm getting: FluentNHibernate.Cfg.FluentConfigurationException occurred Message="An invalid or incomplete configuration was used while creating a SessionFacto

[fluent-nhib] collection item referencing abstract base class

2009-06-16 Thread Jon
Is there a way for a an item in a collection (a "many" in a one-to- many relationship) to reference a base class of it's containing object (the "one", so to speak =P)? Here's a simplified example to demonstrate what I'm thinking: public abstract class Stage : Entity { DateTime StartingDate {

[fluent-nhib] Re: Concat-ing two string props... should that property be mapped?

2009-06-16 Thread Hudson Akridge
Your question isn't specifically a fluent way that I'm aware of, you're just looking for a way to map a model formula property to the database, for querying, but that doesn't get read out of the database (because again, it's calculated in the model based on the other two properties). Is that correc

[fluent-nhib] Concat-ing two string props... should that property be mapped?

2009-06-16 Thread kujotx
I have a derived class that uses a method from a value object. My value object has first, last names, so I added a concatenation for full name and other variations for Find() criteria. The abbreviated version is shown below. My goal is to be able to do something like the following p => p.Person.F

[fluent-nhib] Re: Table-per-concrete class mapping?

2009-06-16 Thread Lukasz Podolak
Works like a charm, thank you. Łukasz 2009/6/16 Martin Hornagold > > Sounds to me like you don't need subclasses of any kind. > You just need to tell FNH that DictionaryBase is a base type. > If you are using S#arpArch you then modifying the IsBaseTypeConvention > method in the AutoPersistenceMo

[fluent-nhib] Re: Table-per-concrete class mapping?

2009-06-16 Thread Hudson Akridge
+1 to what Martin said 2009/6/16 Martin Hornagold > > Sounds to me like you don't need subclasses of any kind. > You just need to tell FNH that DictionaryBase is a base type. > If you are using S#arpArch you then modifying the IsBaseTypeConvention > method in the AutoPersistenceModelGenerator to

[fluent-nhib] Re: Table-per-concrete class mapping?

2009-06-16 Thread Martin Hornagold
Sounds to me like you don't need subclasses of any kind. You just need to tell FNH that DictionaryBase is a base type. If you are using S#arpArch you then modifying the IsBaseTypeConvention method in the AutoPersistenceModelGenerator to the following should do the trick: private bool IsB

[fluent-nhib] Re: Table-per-concrete class mapping?

2009-06-16 Thread Łukasz Podolak
Thank you Hudson, but I still can't make it working. Could you please take a quick look at my example ? here are my classess (one abstract and one conrete). I have more concrete classess like Contractor, but didn't want to include for brevity. public abstract class DictionaryBase : Entity {

[fluent-nhib] Re: Hilo POID generator support in fluent mappings

2009-06-16 Thread Hudson Akridge
Yup, it's the final conversion process to the Semantic Model (although not the final design). The Semantic Model had to be merged into the legacy PartMap's one by one, which James has painstakingly done. It's finished. At the moment, the only thing pending is finishing all of the Conventions in the

[fluent-nhib] Re: Hilo POID generator support in fluent mappings

2009-06-16 Thread Morten Maxild
Thanks for the quick answer. Allright I am allready using github, but not with fluent-nh at the moment. Maybe its time to fork it, and patching my own public repo? I all ready have created some low-prio issues, and I understand your situation. Thanks for pointing out the branch. Is ‘Mo

[fluent-nhib] Re: Increment Generator - could not fetch initial value

2009-06-16 Thread Caio Kinzel Filho
Sure, here's the test [Test] public void EmployeeMapping_IsOk() { new PersistenceSpecification(SessionFirebird) .CheckProperty(c => c.Name, "Any Name") .CheckProperty(c => c.Phone, "-") .CheckProperty(c

[fluent-nhib] Re: Hilo POID generator support in fluent mappings

2009-06-16 Thread Hudson Akridge
As far as I'm aware, no reason that you wouldn't be able to do that (aside from the fact that the parameterless call doesn't exist). For now, it's probably best to create an issue for that rather than a patch. A bunch of stuff is changing behind the scenes that hasn't been merged into trunk yet. Al

[fluent-nhib] Hilo POID generator support in fluent mappings

2009-06-16 Thread Morten Maxild
Hi, I am running R530 off the svn mirror. When fluently mapping the POID generator strategy to be HiLo, why is the max_lo value a mandatory argument, and why is it a string? Are there any reason not to make it possible to run with the NH default value for max_lo? Possible: ===

[fluent-nhib] Re: Increment Generator - could not fetch initial value

2009-06-16 Thread Hudson Akridge
I believe you want GeneratedBy.Identity() But would you mind posting your test just in case? :) On Tue, Jun 16, 2009 at 8:24 AM, caiokf wrote: > > I'm trying to use FluentNHibernate over a legacy database. I'm also > using SQLite for tests. > > When I try to create a test for the mappings using

[fluent-nhib] Increment Generator - could not fetch initial value

2009-06-16 Thread caiokf
I'm trying to use FluentNHibernate over a legacy database. I'm also using SQLite for tests. When I try to create a test for the mappings using FluentNHibernate's PersistenceSpecification, I get the following exception: NHibernate.Exceptions.GenericADOException : could not fetch initial value for

[fluent-nhib] Re: Table-per-concrete class mapping?

2009-06-16 Thread Hudson Akridge
In FNH, it would be a .JoinedSubClass("columnName",x=> x.YourSubClassMappingHere); Although as a point of contention, one of the reasons why the table per class hierarchy is default, is because it's the easiest to use in the database, and it's also the best performing option. Having done a fairly c

[fluent-nhib] Table-per-concrete class mapping?

2009-06-16 Thread Łukasz Podolak
By default, the inheritance mapping is "table per class hierarchy". I have a "DictionaryBase" class and couple of derived classes from it. How can I tell fnh to map all my derived classes as single tables and not to map DictionaryBase at all ? Can be fluent or automapping, whichever gets job done.

[fluent-nhib] Re: Mapping a List of Enum Values

2009-06-16 Thread Ben Hyrman
Have either of you looked at Rhino Security? The first post introducing it is here: http://ayende.com/Blog/archive/2008/01/22/Rhino-Security-Overview-Part-I.aspx I believe it's still living in Rhino Commons. Ben On Tue, Jun 16, 2009 at 7:17 AM, David Perfors wrote: > > I had the same problem,

[fluent-nhib] Re: Mapping a List of Enum Values

2009-06-16 Thread David Perfors
I had the same problem, I solved it by converting the list of enums to an string when saving it... it is not ideal, but it works. class User { public IList Permissions { get;set; } internal string PermissionsString { get { StringBuilder permissionString = new S

[fluent-nhib] Re: Syntax for specifying ordering on one-to-many mappings

2009-06-16 Thread James Gregory
#2 gets my vote too. You should bare in mind that the order-by attribute can contain any arbitrary sql statement, as long as it is valid. While possible to provide some fluency, it'll also be a good idea to allow the user to specify a simple string too. I did this with the Where method. On Tue, Ju

[fluent-nhib] mapping unknown fields dynamically in fluent nhibernate

2009-06-16 Thread Silvia
I have the below situation that I need help figure it out. I am using fluent nhibernate with a legacy database. I need to map some additional columns to a dictionary(?) property in my entity dynamically, because I do not know the number of columns and column names and other specifications at comp