An invalid mapping is generated from an assembly containing no attributed classes.
Description
I looked through the HbmSerializer+Serialize method and found no check for such situation which implies the following output: <?xml version="1.0" encoding="utf-8" ?>
<!-- Generated from NHibernate.Mapping.Attributes on 2009-10-09 09:55:38Z. --> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" />
and this causes NHibernate.Mapping exception when parsing this file.
The only problem is to decide what should be done in this situation (empty stream, exception, boolean return value or other?).
Environment
None
Activity
Show:
Pierre Henri Kuaté October 22, 2009 at 5:49 PM
NHMA now throws an exception if no mapped class is found.
I looked through the HbmSerializer+Serialize method and found no check for such situation which implies the following output:
<?xml version="1.0" encoding="utf-8" ?>
<!-- Generated from NHibernate.Mapping.Attributes on 2009-10-09 09:55:38Z.
-->
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" />
and this causes NHibernate.Mapping exception when parsing this file.
The only problem is to decide what should be done in this situation (empty stream, exception, boolean return value or other?).