-->
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: Virtual accessors
PostPosted: Tue Apr 04, 2006 5:40 pm 
Beginner
Beginner

Joined: Mon Mar 06, 2006 2:19 pm
Posts: 42
Location: Belo Horizonte, Brazil
Hi, I haven't seen many people with this problem yet.

{"Type 'Sys.Data.Address cannot be specified as a proxy: method get_Id should be virtual"}

I have to make all my properties as public virtual or hibernate will not load. Does anybody knows what is happening?

Thanks.


Top
 Profile  
 
 Post subject: Re: Virtual accessors
PostPosted: Wed Apr 05, 2006 2:39 am 
Expert
Expert

Joined: Thu Jan 19, 2006 4:29 pm
Posts: 348
cassiot wrote:
I have to make all my properties as public virtual or hibernate will not load. Does anybody knows what is happening?


Fo lazy loading to work properly, all public memebers of Your class must be virtual.

If Your classes are not lazy-loaded then this is propably a bug in that checking algorithm.


Gert


Top
 Profile  
 
 Post subject: Re: Re: Virtual accessors
PostPosted: Wed Apr 05, 2006 7:34 am 
Beginner
Beginner

Joined: Mon Mar 06, 2006 2:19 pm
Posts: 42
Location: Belo Horizonte, Brazil
Quote:
Fo lazy loading to work properly, all public memebers of Your class must be virtual.


Yes, I'm using lazy loading. The strange thing about this is that when I was using the latest release I was not forced to make it virtual. Now I'm using one of the builds that supports generics. But I'm not totally sure about this.[/quote]

The problem to do it all lazy is that I want to make some private accessors only for NHibernate use and I can't do private virtual.

Thanks.


Top
 Profile  
 
 Post subject: Re: Re: Virtual accessors
PostPosted: Wed Apr 05, 2006 9:02 am 
Expert
Expert

Joined: Thu Jan 19, 2006 4:29 pm
Posts: 348
cassiot wrote:
Yes, I'm using lazy loading. The strange thing about this is that when I was using the latest release I was not forced to make it virtual.


Yes. AFAIK it was a shortcoming (== bug) of the latest release.

cassiot wrote:
The problem to do it all lazy is that I want to make some private accessors only for NHibernate use and I can't do private virtual.


If the accessor is not public, the NHibernate should not require it to be virtual. If it does, file a bug report. (AFAIK You can specify proeprty like

Code:
public virtual int SomeProp
{
  get { return ...; }
  private set {..}
}


Gert


Top
 Profile  
 
 Post subject: Re: Re: Virtual accessors
PostPosted: Thu Apr 06, 2006 7:29 am 
Beginner
Beginner

Joined: Mon Mar 06, 2006 2:19 pm
Posts: 42
Location: Belo Horizonte, Brazil
Thank you Gert. Everything is working fine now.


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.