SQLServer2005 and domains, nhibernate templates not picking

NHibernate Forum

SQLServer2005 and domains, nhibernate templates not picking

Postby aappddeevv on Sat May 27, 2006 11:35 pm

Using any of the recent nhibernate templates on a SQL Server 2005 table. I seem to be picking up alot of Unknown type info for the columns in the template output.

Using the Gentle.NET templates seemed to create types okay. Both templates seem to use IColumn.LanguageType for picking up column type info so I would have expected similar behavior if it was as underlying MyMeta problem.

Thoughts on where I might look to track down the issue?

Here's the output of the nhibernate template:
...
[Serializable]
public sealed class Client
{
#region Private Members
private bool m_isChanged;
private bool m_isDeleted;
private Unknown m_clientid;
private Unknown m_name;
private Unknown m_createdby;
private Unknown m_updatedby;
private Unknown m_createdon;
private Unknown m_updatedon;
private Unknown m_projectcounter;
#endregion
...

But the Gentle.Net template picks up the right info:

[TableName(\"CLIENT\", CacheStrategy.Temporary)]
public class Client : Persistent
{
#region Members
private bool isChanged;
[TableColumn(\"CLIENTID\", NotNull=true), PrimaryKey(AutoGenerated=false)]
private int clientid;
[TableColumn(\"NAME\", NullValue=\"\")]
private string name;
[TableColumn(\"CREATEDBY\", NullValue=0)]
private int createdby;
[TableColumn(\"UPDATEDBY\", NullValue=0)]
private int updatedby;
[TableColumn(\"CREATEDON\")]
private DateTime createdon;
[TableColumn(\"UPDATEDON\")]
private DateTime updatedon;
[TableColumn(\"PROJECTCOUNTER\", NullValue=0)]
private int projectcounter;
#endregion
aappddeevv
Lurker
 
Posts: 3
Joined: Fri May 20, 2005 5:14 am

Postby mike.griffin on Sun May 28, 2006 12:31 am

Try setting your Language and DbTarget settings in the MyGeneration Default Settings dialog.
User avatar
mike.griffin
Site Admin
 
Posts: 3290
Joined: Sat Apr 03, 2004 6:10 am
Location: Indianapolis, IN

Re:

Postby aappddeevv on Sun May 28, 2006 11:06 pm

All set correctly to C#. Some of my fields are defined using domains in SQL Server. Anything in the nhibernate code that would make this shift all column types to \"Unknown?\"
aappddeevv
Lurker
 
Posts: 3
Joined: Fri May 20, 2005 5:14 am

Postby aappddeevv on Mon May 29, 2006 1:32 pm

Strangeness. Some (not all) of my variables are defined using domains in the SQL Server 2005 instance. I fiddled with the MyMetada DomainOverride button a few times, restarted MyGeeration, ran some other templates and I was able to get the nhibernate templates to start picking up the types correctly. I also checked then rechecked the language target types in the Preferences dialago as well.

I'll see if I continue to have good luck with the types being picked up.

Thanks.
aappddeevv
Lurker
 
Posts: 3
Joined: Fri May 20, 2005 5:14 am

Postby mike.griffin on Mon May 29, 2006 7:25 pm

Cool, I hope it works for you. The NHibernate templates are all user submitted so I really don't know alot about them.
User avatar
mike.griffin
Site Admin
 
Posts: 3290
Joined: Sat Apr 03, 2004 6:10 am
Location: Indianapolis, IN


Return to NHibernate

Who is online

Users browsing this forum: No registered users and 0 guests