@Test publicvoidshouldClearAllRecords(){ // given dao.save(apartment); dao.save(apartment); dao.save(apartment);
// when dao.clear();
// then assertThat(dao.list().size(), is(0)); } }
1 2 3 4 5
2018-10-30 18:49:32.072 INFO 18424 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect Hibernate: drop table APARTMENT if exists Hibernate: drop table DAILY_SUMMARY if exists Hibernate: create table APARTMENT (id bigint generated by default as identity, AREA integer, DELETED boolean default false not null, FOR_RENT boolean default false not null, PUBLISHED_TODAY boolean, TITLE varchar(255), TOTAL_PRICE integer, UNIT_PRICE integer, URL varchar(255), primary key (id)) Hibernate: create table DAILY_SUMMARY (id bigint generated by default as identity, DATE varchar(255), DELETED boolean default false not null, FIRSTHAND_TURNOVER INT default -1 not null, SECONDHAND_TURNOVER INT default -1 not null, UNIT_RENTING_PRICE INT default -1 not null, UNIT_SELLING_PRICE INT default -1 not null, primary key (id))
评论(需梯子)