[jboss-user] [EJB 3.0] - @Column Annotation doesn't seem to work...

EricChile do-not-reply at jboss.com
Mon Mar 26 10:34:50 EDT 2007


It seems the @Column annotation doesn't work for some reason?
using 
jboss-4.0.5.GA

EJB 3.0

  | 
  | @Entity
  | @NamedQueries({
  | @NamedQuery(name = "SdsDataLoadPat.findAll", query = "select o from SdsDataLoadPat o"),
  | @NamedQuery(name = "SdsDataLoadPat.findAllbyId", query = "select o from SdsDataLoadPat as o WHERE o.loadSeqNo = :loadSeqNo AND o.setId = :setId")
  | })
  | @Table(name = "SDS_DATA_LOAD_PAT")
  | @IdClass(SdsDataLoadPatPK.class)
  | public class SdsDataLoadPat implements Serializable {
  |     @Column(name="ADDRESS_CITY")
  |     private String addressCity;
  | 
  | .....
  | 
  |     @Id
  |     @Column(name="LOAD_SEQ_NO", nullable = false)
  |     private Long loadSeqNo;
  | 
  |     @Id
  |     @Column(name="SET_ID", nullable = false)
  |     private Long setId;
  | 
  |     private String ssn;
  |     @Column(name="STATUS_CODE")
  |     private String statusCode;
  |     private String suffix;
  | 
  | }
  | 
  | 
  | 

This is the sql shown from the DEBUG 


  | 
  | 2007-03-26 08:16:05,643 DEBUG [org.hibernate.util.JDBCExceptionReporter] could not execute query [select sdsdataloa0_.loadSeqNo as loadSeqNo24_, 
  | .............
  | sdsdataloa0_.USIIS_ID as USIIS67_24_ from SDS_DATA_LOAD_PAT sdsdataloa0_ where sdsdataloa0_.loadSeqNo=? and sdsdataloa0_.setId=?]
  | 
  | 


The sql is being translated using the field name, not the @column name. (sdsdataloa0_.loadSeqNo=? and sdsdataloa0_.setId=?)

Anyone have a clue why?

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

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



More information about the jboss-user mailing list