14 Replies Latest reply on Oct 13, 2007 5:31 AM by Max Rydahl Andersen

    seam generate-entities failure

    John Wooten Newbie

      I have a simple database table queue that has a String name, and two
      int columns, NEXT_ENTRY, and ENTRY_INC;



      When I did seam generate-entities, it created the following and then fails when trying to fetch the list of entries. It fails thinking the NEXT_ENTRY is a small blob or such. Shouldn't this be easy for Seam? It's a MySQL database and very small, etc.

      Following generated by seam generate-entities
      The name in the table is a string and the other two entries
      are ints, like 9050, and 10 ( this is in MySQL )

      It trys to treat them as Serializeable and fails somehow.
      How do I change this to use integers (i.e. provide the correct mapping)? I would think this would be straightforward for this simple table.

      package com.shoulderscorp.queuedb;
      // Generated Oct 1, 2007 4:04:08 PM by Hibernate Tools 3.2.0.b9

      import java.io.Serializable;
      import javax.persistence.Column;
      import javax.persistence.Entity;
      import javax.persistence.Id;
      import javax.persistence.Table;
      import org.hibernate.validator.Length;
      import org.hibernate.validator.NotNull;

      /**
      * Queue generated by hbm2java
      */
      @Entity
      @Table(name = "queue", catalog = "queue_db")
      public class Queue implements java.io.Serializable {

      private String name;
      private Serializable nextEntry;
      private Serializable entryIncr;

      public Queue() {
      }

      public Queue(String name, Serializable nextEntry, Serializable entryIncr) {
      this.name = name;
      this.nextEntry = nextEntry;
      this.entryIncr = entryIncr;
      }

      @Id
      @Column(name = "NAME", unique = true, nullable = false, length = 32)
      @NotNull
      @Length(max = 32)
      public String getName() {
      return this.name;
      }

      public void setName(String name) {
      this.name = name;
      }

      @Column(name = "NEXT_ENTRY", nullable = false)
      @NotNull
      public Serializable getNextEntry() {
      return this.nextEntry;
      }

      public void setNextEntry(Serializable nextEntry) {
      this.nextEntry = nextEntry;
      }

      @Column(name = "ENTRY_INCR", nullable = false)
      @NotNull
      public Serializable getEntryIncr() {
      return this.entryIncr;
      }

      public void setEntryIncr(Serializable entryIncr) {
      this.entryIncr = entryIncr;
      }

      }