[jboss-user] [EJB 3.0] - Please Help! Error with db column definition

funkydunc do-not-reply at jboss.com
Sun Jun 17 08:56:16 EDT 2007


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



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055029#4055029

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055029



More information about the jboss-user mailing list