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.  [ 2 posts ] 
Author Message
 Post subject: Exception: AttributeIdentifierAttribute -- NHibernate 1.2
PostPosted: Tue Sep 26, 2006 8:28 am 
Newbie

Joined: Tue Sep 26, 2006 8:08 am
Posts: 3
Hi,

NHibernate version: 1.2

My current project is based on NHibernate 1.0.2. I tried to port it to NHibernate 1.2 but an error occurs when generating mapping files.

The following code segment I have:

Code:
[Id(0, Access = "nosetter.camelcase-underscore", Name = "Id", Column = "Id", TypeType = typeof(Guid), UnsavedValue = "{00000000-0000-000-0000-000000000000}")]
[Generator(1, Class = "guid.comb")]
public Guid Id
{
   get { return _id; }
   private set { _id = value; }
}


This works fine in 1.0.2. In NHibernate 1.2 I get the following error when generating the mapping files:

Can not find a AttributeIdentifierAttribute with the name '00000000-0000-0000-0000-000000000000' in the class Country (and its base classes)

What is wrong with my code, or is something wrong in the mapping generation tool?

Marc


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 28, 2006 10:59 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
The problem is that there is a new feature in NHibernate.Mapping.Attributes which sees {00000000-0000-000-0000-000000000000} as an "identifier" (refer to the doc).

Anyway, the workaround is to change the way it recognize identifier. Eg:
// Add this before using NHibernate.Mapping.Attributes
HbmWriter.StartQuote = "{{";
HbmWriter.EndQuote = "}}";

I will change it in to something else (before the final release), but I don't know what yet... Suggestions?

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.