This is great! Just what I have been looking for. Although I had to spend
yesterday upgrading many of my dependencies (castle, nh, rhino, castle
contrig, ..). But now they work at least.
My problem now is that I get exception below exception in
PersistenceModel:226 (row is marked with "=>")
(System.ArgumentException: An item with the same key has already been
added.)
public virtual void Configure(Configuration cfg)
{
EnsureMappingsBuilt();
foreach (var mapping in compiledMappings.Where(m =>
m.Classes.Count() == 0))
{
var serializer = new MappingXmlSerializer();
XmlDocument document = serializer.Serialize(mapping);
226: => cfg.AddDocument(document);
}
foreach (var mapping in compiledMappings.Where(m =>
m.Classes.Count() > 0))
{
var serializer = new MappingXmlSerializer();
XmlDocument document = serializer.Serialize(mapping);
if (cfg.GetClassMapping(mapping.Classes.First().Type) ==
null)
cfg.AddDocument(document);
}
}
Maybe the check in the other 'foreach' is missing?
On Thu, Sep 10, 2009 at 5:16 AM, Paul Batum <[email protected]> wrote:
> Hi Dru,
>
> I applied a patch for filter support to my development branch recently.
> It'll probably work its way into the trunk when James gets back from
> holiday. You could give it a go now by grabbing my branch:
>
> http://github.com/paulbatum/fluent-nhibernate/tree/dev
>
> Paul Batum
>
>
> On Thu, Sep 10, 2009 at 11:26 AM, Dru Sellers <[email protected]> wrote:
>
>> has there been any updates on the filter support?
>> -d
>>
>>
>> On Tue, Jul 7, 2009 at 7:29 AM, Hitt <[email protected]> wrote:
>>
>>>
>>> You don't really need to do that. The solution I'm going with for now
>>> until official filter support is added is to use the object model
>>> provided by NHibernate. If you use the ExposeConfiguration method for
>>> the fluent configuration, you can change the object model as you see
>>> fit before the SessionFactory is built. For example, use
>>> config.ClassMappings.AddFilter(...)
>>>
>>> On Jul 7, 7:56 am, ZeusTheTrueGod <[email protected]> wrote:
>>> > I guess you can export mappings to a temporary folder,
>>> > then change some mappings with your code
>>> > and configure a SessionFactory with mappings form that folder
>>> >
>>> > I would like to add a helper utilty like
>>> > FindMappingFor<MyClass> ---> returns a XElement with a root on a
>>> > hbm file
>>> > Add(new XElement ... - setupfiltershere
>>> >
>>> > In that case mappings are first exported from fluent configuration and
>>> > then changed for insertingfiltersand other not supported features
>>> >
>>> > On Jul 6, 10:13 pm, Hitt <[email protected]> wrote:
>>> >
>>> >
>>> >
>>> > > Well, I was thinking of adding it myself but it looks like some major
>>> > > API additions need to be done and that should probably be up to the
>>> > > main contributers (Mr. Gregory comes to mind)
>>> >
>>> > > So I have this question. The docs don't make this exactly clear, but
>>> > > can I define the <filter-def> and <filter> in a manual HBM file, and
>>> > > still have FNH "merge" these with an automapping for the same class?
>>> > > (since I'd have to have to do everything manually if all I need
>>> that's
>>> > > different is the filter support).
>>> >
>>> > > On Jun 17, 7:08 am, Dru Sellers <[email protected]> wrote:
>>> >
>>> > > > what would I have to do to help.ie. what kinds of pieces should I
>>> look at
>>> > > > adding?
>>> >
>>> > > > possible api
>>> >
>>> > > > Fluently.Configure()
>>> > > > .Filters(f=>
>>> > > > {
>>> > > > f.Add<int>("custId");
>>> > > > f.Add<DateTime>("asOf");
>>> > > > });
>>> >
>>> > > > public class Employee : ClassMap<Employee>
>>> > > > {
>>> > > > public Employee()
>>> > > > {
>>> > > > Map(x=>x.EffectiveStartDate, "eff_start_dt");
>>> > > > Map(x=>x.EffectiveEndDate, "eff_end_dt");
>>> > > > Filter("effectiveDate").Condition(":asOf BETEWEEN
>>> eff_start_dt AND
>>> > > > eff_end_dt")
>>> > > > }
>>> >
>>> > > > }
>>> >
>>> > > > -d
>>> >
>>> > > > On Wed, Jun 17, 2009 at 3:09 AM, James Gregory <
>>> [email protected]>wrote:
>>> >
>>> > > > > It's still planned :)
>>> >
>>> > > > > On Wed, Jun 17, 2009 at 3:03 AM, Dru Sellers <
>>> [email protected]> wrote:
>>> >
>>> > > > >> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---