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: Add client-side-only properties to the mapped class
PostPosted: Sat Mar 13, 2010 11:14 am 
Newbie

Joined: Sun Oct 11, 2009 5:34 pm
Posts: 5
Hi all,

I'm trying to add ordinary properties to my mapped class, i.e. properties that aren't mapped to fields in a database, but following error occurs:
"The following types may not be used as proxies:..."

Why isn't it possible?

Or maybe it is...

Many thanks

Giorgi


Top
 Profile  
 
 Post subject: Re: Add client-side-only properties to the mapped class
PostPosted: Mon Mar 15, 2010 3:41 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
Afaik, you have to mark all props as virtual even if they aren't mapped. It's the way the proxy factory works.

_________________
--Wolfgang


Top
 Profile  
 
 Post subject: Re: Add client-side-only properties to the mapped class
PostPosted: Mon Mar 15, 2010 9:29 am 
Newbie

Joined: Sun Oct 11, 2009 5:34 pm
Posts: 5
wolli wrote:
Afaik, you have to mark all props as virtual even if they aren't mapped.


It's not necessary to mark unmapped props as virtual, though, I tried this already and no success, as expected.
But I got the solution -

you should add -

Quote:
<property name="use_proxy_validator">false</property>


to the hibernate configuration file. By its name it's clear what it does :).
You could add this configuration in code to the Configuration object.

Thanks

Giorgi


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.