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: Ignore property in a bean
PostPosted: Tue Jul 22, 2008 5:22 am 
Newbie

Joined: Tue Jul 22, 2008 5:19 am
Posts: 10
Hello, I'm having problems adding a property or extending the bean with a class that have other properties, not mapped in the hbm I get
org.hibernate.QueryException: could not resolve property myProp of: myClass

How can I tell to Hibernate to ignore that property? Is it possible?
Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 22, 2008 5:59 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Marking a field as being @Transient will allow Hibernate to ignore the property. Is this what you need?

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 22, 2008 6:10 am 
Newbie

Joined: Tue Jul 22, 2008 5:19 am
Posts: 10
Cameron McKenzie wrote:
Marking a field as being @Transient will allow Hibernate to ignore the property. Is this what you need?


I use old annotation, so I tried to declare the variable

private transient boolean myVar;

But I get the same error.

Code:

public class ValueObject implements Serializable {
   
   protected boolean selected;

   public boolean isSelected() {
      return selected;
   }

   public void setSelected(boolean selected) {
      this.selected = selected;
   }
}


Code:
public class Canale extends ValueObject {

   private Long canCodice;
   private String canDescrizione;
   
   public Long getCanCodice() {
      return this.canCodice;
   }

   public void setCanCodice(Long canCodice) {
      this.canCodice = canCodice;
   }

   public String getCanDescrizione() {
      return this.canDescrizione;
   }

   public void setCanDescrizione(String canDescrizione) {
      this.canDescrizione = canDescrizione;
   }   
}


Error:
org.hibernate.QueryException: could not resolve property selected of: Canale

How can I solve it?


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.