how to make bulk insert with hibernate and Java?

0

I have a problem, I need to insert thousands of records that are read from a file.properties, the idea is to make bulk insert but when I execute the batch it asks me that the ID of the table is not NULL, I do not understand why it asks for it, How can I make it automatic? Thanks

    
asked by MrDev 31.07.2018 в 02:13
source

1 answer

0

Oracle 11g does not have an autoincrement instruction like MySql or SQL Server, it must create a sequence and read the sequence to fill the ID's

link

CREATE SEQUENCE nombre_secuencia
INCREMENT BY numero_incremento
START WITH numero_por_el_que_empezara
MAXVALUE valor_maximo | NOMAXVALUE 
MINVALUE valor_minimo | NOMINVALUE
CYCLE | NOCYCLE
ORDER | NOORDER

And to use the sequence you use nombre_secuencia.NextVal

    
answered by 31.07.2018 в 05:27