[jboss-user] [JBoss Seam] - seam generate-entities failure

woo37830 do-not-reply at jboss.com
Tue Oct 2 11:57:48 EDT 2007


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; 
} 

} 

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

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



More information about the jboss-user mailing list