Nigel Kibble

Greenhorn
+ Follow
since May 26, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nigel Kibble

Hi Bram,

I've got some experience of using JPA with the AS/400, which I hope will be of some help.

The choice between SEQUENCE and IDENTIFIER comes down to whether you can modify the existing table or not.
If you are in a position where you can alter the table, then you can add an identifier column to it, like so:


then, in your java entity have the following:


If, on the other hand, you're not in a position to alter the table, you can create an SQL sequence to apply an identifier for you.
On the AS/400 you'll need to enter in:



And then in your java entity have the following:


You'll probably want a separate sequence for each table.

Hope this helps.

Nigel.