0down 
votefavorite<http://stackoverflow.com/questions/16484547/use-hbm-file-with-fluent-nhiberate-always-get-nhibernate-duplicatemappingexcepti#>
**

I try to use name query with Fluent NHibernate Mapping from this post enter 
link description 
here<http://mikaelkoskinen.net/mapping-to-oracle-stored-procedure-with-fluent-nhibernate/>
 and 
I always get this error message.

I try to solve this like put .hbm.xml and fluent nhibernate mapping in 
difference namespace.

This is my hbm file Mappings.hbm.xml

<?xml version="1.0" encoding="utf-8"?><hibernate-mapping 
xmlns="urn:nhibernate-mapping-2.2"assembly="Noonswoon.Business"namespace="Noonswoon.Business"
 auto-import="true">
    <sql-query name="GetExistingFriendFacbookIds">
        SELECT FriendFacebookId 
        FROM FriendCloseness 
        WHERE FriendFacebookId IN (:friendFacebookIds)
    </sql-query></hibernate-mapping>

and this is configuration file

            var config = Fluently.Configure()
            .Database(sqlConfig)
            .Mappings(m =>
                          {
                              m.FluentMappings.AddFromAssembly(mappingAsembly);
                              m.HbmMappings.AddFromAssemblyOf<FriendManager>();

                          })
                     .ExposeConfiguration(TreatConfiguration);
        sessionFactory = config.BuildSessionFactory();

I get this message after turn log NHibernate

21:40:27 DEBUG NHibernate.Cfg.XmlHbmBinding.Binder - Named SQL query: 
GetExistingFriendFacbookIds -> SELECT FriendFacebookId FROM FriendCloseness 
WHERE FriendFacebookId IN (:friendFacebookIds) 21:40:27 DEBUG 
NHibernate.Cfg.XmlHbmBinding.Binder - Named SQL query: 
GetExistingFriendFacbookIds -> SELECT FriendFacebookId FROM FriendCloseness 
WHERE FriendFacebookId IN (:friendFacebookIds)

It seems like application try to load mapping two time the additional info 
from log file 21:40:25 INFO NHibernate.Cfg.Environment - NHibernate 
3.3.1.4000 (3.3.2.GA) 21:40:25 INFO NHibernate.Cfg.Environment - NHibernate 
3.3.1.4000 (3.3.2.GA) 21:40:25 INFO NHibernate.Cfg.Environment - 
hibernate-configuration section not found in application configuration file 
21:40:25 INFO NHibernate.Cfg.Environment - hibernate-configuration section 
not found in application configuration file 21:40:25 INFO 
NHibernate.Cfg.Environment - Bytecode provider name : lcg 21:40:25 INFO 
NHibernate.Cfg.Environment - Bytecode provider name : lcg 21:40:25 INFO 
NHibernate.Cfg.Environment - Using reflection optimizer 21:40:25 INFO 
NHibernate.Cfg.Environment - Using reflection optimizer

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to