1 Reply Latest reply on Apr 8, 2008 4:32 PM by Christian Bauer

    Not evaluated @Column Annotation

    Sascha Effert Newbie


      I am using SEAM 2.0.1 on a JBoss 4.2.2 with EJB3 and PostgreSQL 8.2.6. I generated a project using seam-gen and added an entity containing a field physicalDiskId. By a Column-Annotation this field is mapped to a column physicalvolume_id. Here the been:

      public class Extent implements java.io.Serializable {
           private static final long serialVersionUID = 1L;
           // <editor-fold defaultstate="collapsed" desc="EJB CMP Fields.">
          @Column(name = "id", nullable = false)
          private Long id;
          @Column(name = "physicalvolume_id", nullable = false)
          private Long physicalDiskId;
          private Long virtualPosition;
          private Long physicalPosition;
          private Long status;
          private Long virtualVolumeId;

      Deploying the application I get the following errormessage:

      15:37:13,075 WARN  [ServiceController] Problem starting service persistence.units:ear=mda2008.ear,jar=mda2008.jar,unitName=mda2008
      javax.persistence.PersistenceException: org.hibernate.HibernateException: Missing column: physicalDiskId in public.extent
           at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:720)
           at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)

      So it tries to find a column named after the field in the bean instead of the name I told him. Why does this happen?

      The table extent looks like following:

      CREATE TABLE extent (
              id bigint,
              physicalvolume_id bigint,
              virtualposition bigint,
              physicalposition bigint,
              status bigint,
              virtualvolume_id bigint,
              PRIMARY KEY (id, physicalvolume_id)

      Can anyone tell me where my failure is?