NHibernate.MappingException : No persister for: HSC.Domain.Junk

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
edowney
Posts: 14
Joined: Thu 07 Mar 2013 13:10

NHibernate.MappingException : No persister for: HSC.Domain.Junk

Post by edowney » Tue 24 Jun 2014 15:03

I'm getting a lot closer to having a working implementation of NHibernate working straight out of Entity Developer (very exciting)! In my unit tests for my test object aptly named junk I keep getting a "no persister" error when trying to save the object to the database. I double and triple checked to make sure the hbm mapping file was set to embedded resource in VS (which it was). The rest of the code is the stuff genned up by ED. Any suggestions would be greatly appreciated!


edowney
Posts: 14
Joined: Thu 07 Mar 2013 13:10

Re: NHibernate.MappingException : No persister for: HSC.Domain.Junk

Post by edowney » Tue 24 Jun 2014 17:14

Yeah, I have the mapping tag in there and all of my hbm files are set to embedded resource. Here's my app.config file contents:

<?xml version="1.0"?>
<configuration>
<configSections>
<section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate"/>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections>
<connectionStrings>
<add name="HSCConnectionString" connectionString="Data Source=DOT6ZF85V1\MSSQLSERVERR2;Initial Catalog=HSC;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<appSettings>
<add key="applicationName" value="HSC"/>
</appSettings>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="connection.connection_string">
Data Source=DOT6ZF85V1\MSSQLSERVERR2;Initial Catalog=HSC;Integrated Security=True;MultipleActiveResultSets=True
</property>
<property name="adonet.batch_size">100</property>
<property name="show_sql">false</property>
<property name="dialect">NHibernate.Dialect.MsSql2008Dialect</property>
<property name="max_fetch_depth">true</property>
<property name="command_timeout">60</property>
<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
<property name="current_session_context_class">web</property>
<property name="show_sql">true</property>
<property name="hbm2ddl.auto">update</property>
<property name="generate_statistics">true</property>
<mapping assembly="HSC.Domain"/>
</session-factory>
</hibernate-configuration>
<log4net debug="true">

<appender name="trace" type="log4net.Appender.TraceAppender, log4net">
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p %c{1}:%L - %m%n" />
</layout>
</appender>
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender, log4net">
<layout type="log4net.Layout.PatternLayout, log4net">
<param name="ConversionPattern" value="%d %p %m%n"/>
</layout>
</appender>
<appender name="RollingFile" type="log4net.Appender.RollingFileAppender,log4net">
<param name="File" value="C:\Users\eric.downey\Documents\Visual Studio 2013\Projects\HSC\HSC.UnitTesting\log.txt"/>
<param name="AppendToFile" value="true"/>
<param name="DatePattern" value="yyyy.MM.dd"/>
<layout type="log4net.Layout.PatternLayout,log4net">
<conversionPattern value="%d %p %m%n"/>
</layout>
</appender>

<root>
<priority value="DEBUG"/>
<appender-ref ref="trace"/>
<appender-ref ref="ConsoleAppender"/>
<appender-ref ref="RollingFile"/>
</root>

<logger name="NHibernate" additivity="false">
<level value="DEBUG"/>
<appender-ref ref="RollingFile"/>
<appender-ref ref="ConsoleAppender"/>
<appender-ref ref="trace"/>
</logger>
<logger name="NHibernate.SQL" additivity="false">
<level value="ALL"/>
<appender-ref ref="RollingFile"/>
<appender-ref ref="ConsoleAppender"/>
<appender-ref ref="trace"/>
</logger>

</log4net>
</configuration>

Shalex
Site Admin
Posts: 8242
Joined: Thu 14 Aug 2008 12:44

Re: NHibernate.MappingException : No persister for: HSC.Domain.Junk

Post by Shalex » Thu 26 Jun 2014 08:12

Please carefully follow this link to identify the problem in your project: http://stackoverflow.com/questions/5780 ... er-for-xyz. If the issue is caused by the generation made by Entity Developer, report a bug, and we will do our best to fix it as soon as possible.

Post Reply