How to increment using TableGenerator?
Hi all,
I have a simple program which is customer entry. I use the TableGenerator which to increment the number of entry? i am using netbeans 5.5.
Here is the error.
javax.ejb.EJBException: javax.ejb.EJBException: nested exception is: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.RemoteException: Exception [TOPLINK-4011] (Oracle TopLink Essentials - 2006.8 (Build 060830)): oracle.toplink.essentials.exceptions.DatabaseException
Exception Description: Error preallocating sequence numbers. The sequence table information is not complete.
Thank you for reply..
Best Regards,
Chris
[690 byte] By [
CJ_125a] at [2007-11-27 8:52:01]

# 2
public class Customers implements Serializable {
@Id
@TableGenerator(name="CUST_GENERATOR",
table="GENERATOR_TABLE",
pkColumnName="PRIMARY_KEY_COLUMN",
valueColumnName="VALUE_COLUMN",
pkColumnValue="ID",
allocationSize=10)
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CUST_GENERATOR")
@Column(name = "ID", nullable = false)
private Integer id;
@Column(name = "FIRST_NAME")
private String firstName;
@Column(name = "MIDDLENAME")
private String middlename;
@Column(name = "LASTNAME")
private String lastname;
@Column(name = "ADDRESS")
private String address;
@Column(name = "TELEPHONE")
private String telephone;
@Column(name = "MOBILEPHONE")
private String mobilephone;