-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: problem and solution about QuickStart + Access2000 MDB
PostPosted: Thu Feb 23, 2006 10:44 am 
Newbie

Joined: Thu Feb 16, 2006 9:50 am
Posts: 2
i stunned with Nhibernate 1.0.2 JetDriver + Access2000
the db schema is
{
logonId..
password
....
}

in xml configuration , change column="password" to "[password]"
or change "password" to other name, because maybe Nhibernate recognize password as keyword...
it spend me 4 days to dig into that problem, i hope this can fix other guys similar symptom.

thanks to good team work!!!
keep good thing! Nhibernate Guys!


Top
 Profile  
 
 Post subject: Other solution
PostPosted: Mon Jun 11, 2007 8:29 am 
Newbie

Joined: Mon Jun 11, 2007 8:23 am
Posts: 3
Hi.
Another solution is to use a naming strategy in your configuration.
Here is a sample access naming strategy i am using.

Code:
   public class AccessNamingStrategy : NHibernate.Cfg.INamingStrategy
   {
      public AccessNamingStrategy()
      {
      }
      
      public string ClassToTableName(string className)
      {
         return "[" + DefaultNamingStrategy.Instance.ClassToTableName(className) + "]";
      }
      
      public string PropertyToColumnName(string propertyName)
      {
         return "[" + DefaultNamingStrategy.Instance.PropertyToColumnName(propertyName) + "]";      }
      
      public string TableName(string tableName)
      {
         return "[" + tableName + "]";
      }
      
      public string ColumnName(string columnName)
      {
         return "[" + columnName + "]";
      }
      
      public string PropertyToTableName(string className, string propertyName)
      {
         return "[" + DefaultNamingStrategy.Instance.PropertyToTableName(className, propertyName) + "]";      }
      
   }


Top
 Profile  
 
 Post subject: Other solution
PostPosted: Mon Jun 11, 2007 8:29 am 
Newbie

Joined: Mon Jun 11, 2007 8:23 am
Posts: 3
Hi.
Another solution is to use a naming strategy in your configuration.
Here is a sample access naming strategy i am using.

Code:
   public class AccessNamingStrategy : NHibernate.Cfg.INamingStrategy
   {
      public AccessNamingStrategy()
      {
      }
      
      public string ClassToTableName(string className)
      {
         return "[" + DefaultNamingStrategy.Instance.ClassToTableName(className) + "]";
      }
      
      public string PropertyToColumnName(string propertyName)
      {
         return "[" + DefaultNamingStrategy.Instance.PropertyToColumnName(propertyName) + "]";      }
      
      public string TableName(string tableName)
      {
         return "[" + tableName + "]";
      }
      
      public string ColumnName(string columnName)
      {
         return "[" + columnName + "]";
      }
      
      public string PropertyToTableName(string className, string propertyName)
      {
         return "[" + DefaultNamingStrategy.Instance.PropertyToTableName(className, propertyName) + "]";      }
      
   }
`


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.