[jboss-user] [EJB 3.0] - hibernate couldn't find column

carstenkeuch do-not-reply at jboss.com
Tue Aug 1 10:40:47 EDT 2006


Hi there,
i'm new to Hibernate, EJB3 and surrounding stuff. I'm using JBoss 4.0.4 and within delivered Hibernate engine. Database is Postgre 8.1.
I've a problem with a generated query. The stack trace is (outtake):
anonymous wrote : 
  | 2006-08-01 16:12:53,273 WARN  [org.hibernate.util.JDBCExceptionReporter] SQL Error: 0, SQLState: 42703
  | 2006-08-01 16:12:53,273 ERROR [org.hibernate.util.JDBCExceptionReporter] ERROR: column factactual0_.keydate does not exist
  | 2006-08-01 16:12:53,273 DEBUG [org.hibernate.util.JDBCExceptionReporter] could not execute query [select factactual0_.keydate as keydate291_, factactual0_.keyorga as keyorga291_, factactual0_.key as key291_, factactual0_.time as time291_, factactual0_.op_time as op6_291_, factactual0_.max as max291_, factactual0_.min as min291_, factactual0_.op_quantity as op9_291_ from fact_data_actual factactual0_ where factactual0_.keyoperation=? and (factactual0_.keyorga in (1 , 2 , 3))]
  | org.postgresql.util.PSQLException: ERROR: column factactual0_.keydate does not exist
  | 	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512)
  | 	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297)
  | 	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
  | 	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:430)
  | 	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:346)
  | 	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:250)
  | 
Following the bean code:

  | 	private int keydate, keyorga;
  | 	private float time, task, minTime, maxTime;
  | 	private FactDataActualPK key;
  | 
  | 	@Id
  | 	public FactDataActualPK getKey() {
  | 		return key;
  | 	}
  | 
  | 	public void setKey(FactDataActualPK key) {
  | 		this.key = key;
  | 	}
  | 
  | 	@Column(name = "key_date")
  | 	public int getKeydate() {
  | 		return keydate;
  | 	}
  | 
  | 	public void setKeydate(int keyDate) {
  | 		this.keydate = keyDate;
  | 	}
  | 
  | 	@Column(name = "key_orga")
  | 	public int getKeyorga() {
  | 		return keyorga;
  | 	}
  | 
  | 	public void setKeyorga(int keyOrga) {
  | 		this.keyorga = keyOrga;
  | 	}
  | 

Has anybode an idea why Hibernate is saying that the column "keydate" is missing? The sql error sais that the column is not defined! But: The property exists and the @Column Annotation matches the database. The query seems to be correct.
Thankx for your efforts,

Regards, 

     Carsten.

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

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



More information about the jboss-user mailing list