-->
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.  [ 4 posts ] 
Author Message
 Post subject: PropertyNotFoundException: Could not find a getter for
PostPosted: Mon May 25, 2009 11:55 am 
Regular
Regular

Joined: Wed Jan 28, 2009 8:31 pm
Posts: 54
bonjour j ai un petit probleme. J utilise hibernateSynchronizer3
pour genere mes hbm.

mais mon compilateur ne voit pas les getters et setters qui commence par un l minuscule
bizzare quand meme.
mon hbm
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
   "-//Hibernate/Hibernate Mapping DTD//EN"
   "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

<hibernate-mapping package="pojo">
   <class
      name="PpoAtraiterPojo"
      table="PPO_ATRAITER"
   >
      <id
         name="idPpoNtraite"
         column="ID_PPO_NTRAITE"
         type="integer"
         length="6"
      >
      
         <generator class="assigned"/>
      </id>
      <property
         name="ligneQualifier"
         column="LGN_QUALIFIER"
         type="string"
         not-null="false"
         length="2"
      />
      <property
         name="cntl"
         column="CLM_CNTL"
         type="string"
         not-null="false"
         length="17"
      />
      <property
         name="ligneProvider"
         column="LGN_PROVIDER"
         type="string"
         not-null="false"
         length="6"
      />
      <property
         name="disp"
         column="CLM_DISP"
         type="string"
         not-null="false"
         length="2"
      />
      <property
         [b]name="lAllowable"[/b]
         column="LGN_ALLOWABLE"
         type="big_decimal"
         not-null="false"
         length="9"
      />
   


   </class>
</hibernate-mapping>


pojo
Code:

package pojo;

import java.io.Serializable;
import java.math.BigDecimal;

public class PpoAtraiterPojo implements Serializable, InterfacePojo {

   private static final long serialVersionUID = 7127703723951922317L;

   // primary key
   private Integer idPpoNtraite;

   // fields
   private String ligneQualifier;

   private String cntl;

   private String ligneProvider;

   private String disp;

   private BigDecimal lAllowable;

   

   /* [CONSTRUCTOR MARKER BEGIN] */
   public PpoAtraiterPojo() {
      super();
   }

   /**
    * Constructor for primary key
    */
   public PpoAtraiterPojo(Integer idPpoNtraite) {
      this.idPpoNtraite = idPpoNtraite;
   }

   public String getCntl() {
      return cntl;
   }

   public void setCntl(String cntl) {
      this.cntl = cntl;
   }

   public String getDisp() {
      return disp;
   }

   public void setDisp(String disp) {
      this.disp = disp;
   }

   public Integer getIdPpoNtraite() {
      return idPpoNtraite;
   }

   public void setIdPpoNtraite(Integer idPpoNtraite) {
      this.idPpoNtraite = idPpoNtraite;
   }

   public BigDecimal getLAllowable() {
      return lAllowable;
   }

   public void setLAllowable(BigDecimal allowable) {
      lAllowable = allowable;
   }

   public String getLProvider() {
      return lProvider;
   }

   public void setLigneProvider(String lProvider) {
      this.lProvider = ligneProvider;
   }

   public String getLQualifier() {
      return ligneQualifier;
   }

   public void setLQualifier(String ligneQualifier) {
      this.lQualifier = ligneQualifier;
   }


donc pour mes champs qui commencent par un l minuscule
j ai comme errreurs
Quote:
Initial SessionFactory creation failed.org.hibernate.PropertyNotFoundException: Could not find a getter for lAllowable in class pojo.PpoAtraiterPojo


et quand je change
ex lAllowable par ligneAllowable ca passe
tres bizarre quand meme tout ca
est ce qu il y a une personne qui peut m explique ce qui se passe merci


Top
 Profile  
 
 Post subject: Re: PropertyNotFoundException: Could not find a getter for
PostPosted: Wed May 27, 2009 3:51 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
hello
rien à voir hibernate, il s'agit de la norme JavaBean.
Cherche avec google tu devrais finir par tomber sur la spec qui décrit très précisément ton cas.

Anthony

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject: Re: PropertyNotFoundException: Could not find a getter for
PostPosted: Wed May 27, 2009 10:02 am 
Regular
Regular

Joined: Wed Jan 28, 2009 8:31 pm
Posts: 54
bonjour anthony merci pour ton temps.
Mais j avoue avoir un peu de difficulté a comprendre.
Sur quoi je dois me baser dans la recherche sur google.


Top
 Profile  
 
 Post subject: Re: PropertyNotFoundException: Could not find a getter for
PostPosted: Thu May 28, 2009 4:12 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
http://java.sun.com/javase/technologies ... /spec.html

This normally means converting the first character from upper case to lower case, but in the (unusual) special case when there is more than one character and both the first and second characters are upper case, we leave it alone.

Thus "FooBah" becomes "fooBah" and "X" becomes "x", but "URL" stays as "URL".

En gros le comportement que tu as découle de la spec et est normal.

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


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