I've just upgraded an application from version 3.3.4.4000 to 4.1.1.4000 and 
I have hit a major issue and I wanted to make sure this is a definite bug 
before filing it as one. Basically I have a mechanism of adding additional 
fields to entities and storing them in an attributes collection 
(IDictionary). I do this programatically when I build the configuration 
(using FluentNhibernate). However the issue I'm having is that the values 
for each attribute is the same for each field/property. Here's a sample of 
the code which adds the dynamic component:

Fluently.Configure()
    ...
    .ExposeConfiguration(c => {
        var persistentClass = c.GetClassMapping("MyApp.Models.User");

        // Create the component
        var component = new Component(persistentClass);

        // Add the "Name" property
        var simpleValue = new SimpleValue(persistentClass.Table) { TypeName 
= "String" };

        simpleValue.AddColumn(new Column("Name") {
            Value = simpleValue,
            Length = 100,
            IsNullable = true
        });

        component.AddProperty(new Property() { Name = "Name", Value = 
simpleValue });

        // Add the "Email" property
        var simpleValue2 = new SimpleValue(persistentClass.Table) { 
TypeName = "String" };

        simpleValue2.AddColumn(new Column("Email") {
            Value = simpleValue2,
            Length = 100,
            IsNullable = true
        });

        component.AddProperty(new Property() { Name = "Email", Value = 
simpleValue2 });

        // Add the component
        persistentClass.AddProperty(new Property() { Name = "Attributes", 
Value = component });
    })
    .BuildConfiguration();

However if I say:

session.Get<User>().Attributes["Email"]

It has the same value as the "Name" attribute. Looking in the database it 
has definitely has different values.

I have simplified the above to show the problem. This worked fine before. 
Please let me know if this indeed a bug or if there is a new way of doing 
this in version 4.

Thanks

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to