[JBoss Seam] - seam generate-entities failure
by woo37830
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
18Â years, 6Â months
[JBoss Seam] - Re: Semantics of @Name, @DataModelSelection
by jacob.orshalick
There is a new release of the Yuan/Heute book coming out (the examples in the current release are a little out of date for the latest release of Seam), but likely not until early next year some time. I will be posting an article soon that may help understanding of the semantics of conversations (it covers conversations and nested conversations) along with an example, but the best documentation out there that I've seen is the Seam reference manual.
I read the Nusairat book when I was getting started but past that I've kept the Seam source in my IDE at all times. I've heard that Java Persistence with Hibernate (Bauer, King) provides a good introduction to Seam, but I have not yet read this text. The forum here is great and I would recommend posting JIRA issues as you have difficulties with the documentation (the Seam team is very good about resolving these) as it will help everybody out. Sorry I can't be of more help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4090735#4090735
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4090735
18Â years, 6Â months
[Beginners Corner] - Re: Rather simple but doesn't work
by woo37830
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=4090730#4090730
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4090730
18Â years, 6Â months