-->
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.  [ 5 posts ] 
Author Message
 Post subject: Implementing IPropertyAccessor ??
PostPosted: Sun Jun 25, 2006 6:02 am 
Newbie

Joined: Sun May 28, 2006 7:42 pm
Posts: 19
Location: Italy
Hi, i've create a class called EntityAccessor that implements the IPropertyAccesso inteface.
This is the class.
public class EntityAccessor:NHibernate.Property.FieldAccessor, NHibernate.Property.IPropertyAccessor
{
public EntityAccessor()
{ }

public new IGetter GetGetter(Type theClass, string propertyName)
{
return base.GetGetter(theClass, "entityData." + propertyName);
}

public new ISetter GetSetter(Type theClass, string propertyName)
{
return base.GetSetter(theClass, propertyName);
}
}

In the entity.hbm.xml file i setted the property like this:
<property name="AccountType" column="AccountType" type="String" access="Test3.DAL.EntityAccessor"/>

When i call the configurator.Configure() and error occure:

"could not interpret type: Test3.DAL.EntityAccessor"

Could, someone, help me to find whre is the error?
Thanks.


Top
 Profile  
 
 Post subject: Re: Implementing IPropertyAccessor ??
PostPosted: Tue Jun 27, 2006 5:37 am 
Newbie

Joined: Mon Jun 05, 2006 8:51 am
Posts: 18
ovidius wrote:
In the entity.hbm.xml file i setted the property like this:
Code:
<property name="AccountType" column="AccountType" type="String" access="Test3.DAL.EntityAccessor"/>


type attribute value should be an assembly-qualified type name, that is something like:
Code:
type="Test3.DAL.EntityAccessor, Test3.DAL"

(I'm assuming Test3.DAL for the name of the assembly).


Top
 Profile  
 
 Post subject: Re: Implementing IPropertyAccessor ??
PostPosted: Tue Jun 27, 2006 5:23 pm 
Newbie

Joined: Sun May 28, 2006 7:42 pm
Posts: 19
Location: Italy
a.gogolev wrote:
ovidius wrote:
In the entity.hbm.xml file i setted the property like this:
Code:
<property name="AccountType" column="AccountType" type="String" access="Test3.DAL.EntityAccessor"/>


type attribute value should be an assembly-qualified type name, that is something like:
Code:
type="Test3.DAL.EntityAccessor, Test3.DAL"

(I'm assuming Test3.DAL for the name of the assembly).


The problem was not solved.
The error message always is the same:

"Could not interpret type: Test3.DAL.EntityAccessor, Test3.DAL".


gogolev, are you sure i must change the type attribute and not the access attribute?

Thanks a lot.


Top
 Profile  
 
 Post subject: Re: Implementing IPropertyAccessor ??
PostPosted: Wed Jun 28, 2006 7:57 am 
Newbie

Joined: Mon Jun 05, 2006 8:51 am
Posts: 18
ovidius wrote:
gogolev, are you sure i must change the type attribute and not the access attribute?

Whoops, my bad :) Yes, access is the name for the attribute.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 01, 2006 5:20 pm 
Newbie

Joined: Sun May 28, 2006 7:42 pm
Posts: 19
Location: Italy
I can't solve my problem.
I follewed this step, but i don't undestand whre its the error.

1)I created a class that implemets IPropertyAccessor
2) in the xml mapping file, i've settet the access attribute to the name class i created in the first step, in this way: "access="Test3.DAL.Myaccessor, Test3.DAL".

When runs the application and try to configure my configurato class I get an error message : "Could not interpret type: Test3.DAL.EntityAccessor, Test3.DAL".

Could someone help me?

Thanks.


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