1 Reply Latest reply on Jun 19, 2007 12:16 PM by Duncan Saunders

    Please Help! Error with db column definition

    Duncan Saunders Newbie

      My application platform is a Apache2.2 JBoss4.05 SQL Server 2005 EJB3 pattern.

      Ever since I made the following amendment to my code I have had the following error:

      javax.persistence.PersistenceException: org.hibernate.MappingException: Could not determine type for: com.manticpoint.stream.data.BookingPassenger, for columns: [org.hibernate.mapping.Column(leadPassenger)]

      Here is the code in question:

      Before change was made:

      public class BookingPassenger {
      
       private long id;
       private String emailAddr;
       private boolean leadPassenger
       //more properties here
      
       //more methods here
       @Column(name = "LEAD_PASSENGER")
       public boolean isLeadPassenger() {
       return leadPassenger;
       }
      
       public void setLeadPassenger(boolean leadPassenger) {
       this.leadPassenger = leadPassenger;
       }
      }
      


      And after the change was made:

      public class BookingPassenger {
      
       private long id;
       private String emailAddr;
       private Boolean leadPassenger
       //more properties here
      
       //more methods here
       @Column(name = "LEAD_PASSENGER")
       public Boolean getLeadPassenger() {
       return leadPassenger;
       }
      
       public void setLeadPassenger(Boolean leadPassenger) {
       this.leadPassenger = leadPassenger;
       }
      }
      


      The reason for the above change is that I realised that I had accidently used 'boolean' instead of 'Boolean' and therefore my auto generated getter and setter were for the 'boolean' definition. Unlike my other data classes which use 'Boolean' and work just fine.

      Database = SQL server 2005 and the LEAD_PASSENGER column definition is tinyint.

      Nothing I have tried seems to get rid of this error, including removing the leadPassenger property and corresponding db column completely.

      In persistence.xml I have tried changed the hibernate.hbm2ddl.auto value from 'validate' to 'update', 'create' and 'create-drop', but to no avail. It seems to be caching or remembering the fact that I had this properties somehow.

      From the digging I have done so far it seems that this error occurs on classes in a one to many relationship, on the property which links to the other entity in the relationship. My BookingPassenger class is in a one to many relationship from another class Booking, but the leadPassenger property that is giving me grief is unrelated to that relationship.

      Any help would be much appreciated.

      Cheers

      Duncan