5 Replies Latest reply on Feb 17, 2009 11:05 AM by jkronegg

    Problem: Seam Generate Entities !

    allforjava.allforjava.aol.in
      Hi,

      I hv used "Seam Genetrate Entities" to reverse engineer from database. The relavant .xhtml and xml with .java files are generated.

      However in some of the auto-generated java codes (bean), the datatype of the attributes/class variables is "double" and where as the datatype of the respective column in the database table is as "float".

      The earlier generated (and enchanced code) is same as I hv generated newly. But the newly genarated one is not working and where as the old one is still working fine.

      Kindly suggest how to deal with it?

      I guess because of this the deployment if failing, with followig error message.

      `
      11:22:40,575 ERROR [[/PortalTemplate]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
      org.jboss.seam.InstantiationException: Could not instantiate Seam component: PortalTemplateEntityManagerFactory
           at org.jboss.seam.Component.newInstance(Component.java:1986)

      .
      .
      .
      Caused by: javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: PERCENTAGE_COMPLETE, expected: double precision

      `
      Issues.java
      `
      private double percentageComplete;

           @Column(name = "PERCENTAGE_COMPLETE", nullable = false, precision = 53, scale = 0)
           @NotNull
           public double getPercentageComplete() {
                return this.percentageComplete;
           }

           public void setPercentageComplete(double percentageComplete) {
                this.percentageComplete = percentageComplete;
           }
      `

      dbo.ISSUES table in datatbase [SQL 2000]
      `
      Column Name                DataType  Allow Nulls
      PERCENTAGE_COMPLETE     float     Unchecked
      `