The primary key of a database row is its identity. There are a number of ways dealing with this issue.

TableOfContents

Natural Keys

ToBeWritten

Surrogate Keys

ToBeWritten

GUID strings

ToBeWritten

Sequence numbers

ToBeWritten

Inserted by code

ToBeWritten

Inserted by database trigger

This is a cool technique, because it offloads the responsibility of generating a unique key from the code, which shouldn't care about the value, to the database, which is already enforcing the unique constraint. Some databases offer an autonumber type to provide this, but with Oracle, you need to [http://www.jlcomp.demon.co.uk/faq/autonumb.html use a sequence and a trigger]. The simplistic way is to do this:

create sequence auto_seq;

create trigger aut_bri
before insert on auto_numb
for each row
begin
        select auto_seq.nextval into :new.n1 from dual;
end;

but that will get in the way if you try to use DbUnit to insert test data. I recommend

create sequence auto_seq;

create trigger aut_bri
before insert on auto_numb
for each row
begin
    if (:new.n1 is null) then
        select auto_seq.nextval into :new.n1 from dual;
    end if
end;

instead. This allows you to specify a particular key when desired. To avoid conflicts between your specified test keys and sequence generated keys, use negative values for the specified ones.