Jeff-Lewis / codesmith

Automatically exported from code.google.com/p/codesmith
0 stars 0 forks source link

Error using Codesmith Explorer and foreign Keys... #157

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create my MySQL DataBase (Wich im attaching to this issue)
2. Open the latest version of the Codesmith Explorer (5.1.6.9466)
3. Im using the HBMMaps template(C#)
4. Im configuring the explorer using the Database attached and clicked
"Generate"
(Im using MySQL .Net Connector 6.1.2, and i had tryied with random tables
and get the same error).

What is the expected output? What do you see instead?
Im expecting the template generated code, instead, im getting this error:

System.NullReferenceException: Object reference not set to an instance of
an object.
   at NHibernateHelper.NHibernateHelper.ValidateName(String memberName)
   at NHibernateHelper.NHibernateHelper.GetClassName(TableSchema table)
   at _CodeSmith.Hbm_cst.__RenderMethod1(TextWriter writer, Control control)
   at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
   at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
   at CodeSmith.Engine.Control.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.RenderToString()
   at CodeSmith.Gui.CodeTemplateGenerator.f(Object A_0, EventArgs A_1)

What version of the product are you using?

CodeSmith Trial Version 5.1.6.9466
Latest Templates Upgrade (10/06/2009)
MySQL Community Server 5.1.39
MySQL .Net Connector 6.1.2
nHibernate 2.1.0
Visual Studio 2008 SP1

Please provide any additional information below.

Original issue reported on code.google.com by rogelio....@gmail.com on 6 Oct 2009 at 5:29

Attachments:

GoogleCodeExporter commented 9 years ago
I just tryied again, and get a different error

System.NullReferenceException: Object reference not set to an instance of an 
object.
   at NHibernateHelper.EntityManager.GetManyToOne()
   at NHibernateHelper.EntityManager.Init()
   at NHibernateHelper.EntityManager.get_PrimaryKey()
   at _CodeSmith.Hbm_cst.__RenderMethod1(TextWriter writer, Control control)
   at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
   at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
   at CodeSmith.Engine.Control.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.RenderToString()
   at CodeSmith.Gui.CodeTemplateGenerator.f(Object A_0, EventArgs A_1)

Original comment by rogelio....@gmail.com on 6 Oct 2009 at 5:39

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by shannon....@gmail.com on 6 Oct 2009 at 6:51

GoogleCodeExporter commented 9 years ago
The NHibernate templates require that you use run the NHibernateMaster.cst, 
running
sub-templates without the master will result in this error.

We have received several reports of similar issues recently, we do plan to 
remove
this dependency in version 2.0 of our templates, but until then we will add a 
more
intuitive error message.

Original comment by tdupont...@gmail.com on 7 Oct 2009 at 4:16