Entity Class + FluentNHibernate Map Class in the same FILE

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
risegabriel
Posts: 3
Joined: Fri 20 Jul 2012 12:43

Entity Class + FluentNHibernate Map Class in the same FILE

Post by risegabriel » Fri 20 Jul 2012 13:10

Hello, I was trying to modify my NHibernate Template to generate the Entity Class and the Fluent Map Class in the same file. But I'm too stupid to do that LoL

So... what i'm attempting to do is generate a single file with this structure
I'm using C# BTW

file.cs

using blablabla; // all the external files needed


namespace My.Super.Namespace
{

public partial class EntityClass
{
//My NHibernate Template Generated Class
}

public class EntityClassMap : ClassMap<EntityClass>
{
//My FluentNHibernate MAP Template Generated Class
}

}


There's a good soul whoo could help me?
If there is already a template like this... can someone pass me the link?

Thanks in advance

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

Re: Entity Class + FluentNHibernate Map Class in the same FILE

Post by Shalex » Thu 26 Jul 2012 17:42

risegabriel wrote:I was trying to modify my NHibernate Template to generate the Entity Class and the Fluent Map Class in the same file.
We do not recommend you to implement such approach because EntityClass in your sample represents application's component layer (does not include database-specific mapping), but EntityClassMap is like data-access layer which can be modified independently from EntityClass.

If it is critical for your task, please contact us and we will help you to merge the NHibernate and Fluent NHibernate templates to set their output in the same file.

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

Re: Entity Class + FluentNHibernate Map Class in the same FILE

Post by Shalex » Wed 01 Aug 2012 11:55

We have sent a merged template (EntityClasses+FluentMapping) to your e-mail address.

risegabriel
Posts: 3
Joined: Fri 20 Jul 2012 12:43

Re: Entity Class + FluentNHibernate Map Class in the same FILE

Post by risegabriel » Wed 08 Aug 2012 13:48

Can you send me the template again?
I believe didn't receive the e-mail with the code =/

risegabriel
Posts: 3
Joined: Fri 20 Jul 2012 12:43

Re: Entity Class + FluentNHibernate Map Class in the same FILE

Post by risegabriel » Thu 09 Aug 2012 11:57

Thanks I've received the template BUT when I click on the generate code button I get the following messages:



An error occurred during an attempt to compile the template 'EntityClasses+FluentMapping'.
Error List:
error : The best overloaded method match for 'EntityDeveloper.TemplateEngine.Output.AddReference(string)' has some invalid arguments
error : Argument 1: cannot convert from 'System.Reflection.AssemblyName' to 'string'
error : The best overloaded method match for 'EntityDeveloper.TemplateEngine.Output.AddReference(string)' has some invalid arguments
error : Argument 1: cannot convert from 'System.Reflection.AssemblyName' to 'string'
error : The best overloaded method match for 'EntityDeveloper.TemplateEngine.Output.AddReference(string)' has some invalid arguments
error : Argument 1: cannot convert from 'System.Reflection.AssemblyName' to 'string'
error : The best overloaded method match for 'EntityDeveloper.TemplateEngine.Output.AddReference(string)' has some invalid arguments
error : Argument 1: cannot convert from 'System.Reflection.AssemblyName' to 'string'
error : The best overloaded method match for 'EntityDeveloper.TemplateEngine.Output.AddReference(string)' has some invalid arguments
error : Argument 1: cannot convert from 'System.Reflection.AssemblyName' to 'string'
error : The best overloaded method match for 'EntityDeveloper.TemplateEngine.Output.AddReference(string)' has some invalid arguments
error : Argument 1: cannot convert from 'System.Reflection.AssemblyName' to 'string'
error : 'System.Linq.ParallelEnumerable.Where<TSource>(System.Linq.ParallelQuery<TSource>, System.Func<TSource,int,bool>)' is a 'method', which is not valid in the given context

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

Re: Entity Class + FluentNHibernate Map Class in the same FILE

Post by Shalex » Fri 10 Aug 2012 11:40

We have sent you two templates with the same functionality:
- EntityClasses+FluentMapping_CurrentBuild.zip works with the previous (4.5.222) build of Entity Developer
- EntityClasses+FluentMapping_NextBuild.zip should be used with the current (4.5.240) build. This caused by some changes in our object model

1. Specify the build number (x.xx.xxx) of your Entity Developer.
2. Which one template (from *_CurrentBuild.zip or *_NextBuild.zip) are you using?

Post Reply