[jboss-user] [Beginners Corner] - Re: Rather simple but doesn't work

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


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



More information about the jboss-user mailing list