E
E
Evhen2015-07-10 10:42:33
css
Evhen, 2015-07-10 10:42:33

Why does hibernate make an extra select query before insert?

Hibernate: drop table java_class if exists
Hibernate: create table java_class (nameClass varchar(255) not null, class blob(255) not null, primary key (nameClass))
Jul 10, 2015 10:38:08 AM org.hibernate.tool .hbm2ddl.SchemaExport execute
INFO: HHH000230: Schema export complete
Hibernate: select javaclass0_.nameClass as nameClass0_0_, javaclass0_.class as class0_0_ from java_class javaclass0_ where javaclass0_.nameClass=?
Hibernate: insert into java_class (class, nameClass) values ​​(?, ?)
Hibernate: select javaclass0_.nameClass as nameClass0_0_, javaclass0_.class as class0_0_ from java_class javaclass0_ where javaclass0_.nameClass=?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
tyzberd, 2018-11-09
@tyzberd

move the modal window before the closing body tag somewhere on that level

N
Noobkesan, 2015-07-10
@EugeneP2

probably, so that the bean to which the recording takes place is in the Persistence context.
more details in the book www.apress.com/9781430219569

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question