Add data to database with Entity Bean

I am new to EJB. I understand that using home.create(int productID, String description...etc) will call the the ejbCreate(int productID, String description...etc) in the Bean (container managed) and the new data will be added to the database. What happen if the productID in my database is a sequential number generate by a sequence in the database. What to do, please help !!

[390 byte] By [petermok] at [2007-9-26 4:08:39]
# 1

u may get the id from the sequence and then send this value as a parameter to the create() method. or another solution is to include a finder method which gives u the bean with max id. now u may call the get method for the id attribute and get its value, say val. now the new id value will be val+1. send it as a parameter.

hope that will work,

amt

amtanoli at 2007-6-29 13:11:01 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...