How to create empty tables in JPA/Hierbnate# Java - 爪哇娇娃
F*n
1 楼
Normally I let hibernate automatically create tables for entities. But how to create empty tables without persist any entities?
g*g
2 楼
I normally don't use that, but I guess you can add a entry and delete it?
【在 F****n 的大作中提到】 : Normally I let hibernate automatically create tables for entities. But how : to create empty tables without persist any entities?
A*o
3 楼
or run a sql statement?
【在 g*****g 的大作中提到】 : I normally don't use that, but I guess you can add a : entry and delete it?
q*a
4 楼
you have to know more about hibernate
t*e
5 楼
Rephrase your question please. Steps I took, Use hbm2ddl to generate and run SQL script from entities, Run DBunit to insert testing data into the tables, or ask DBAs to load testing data for you Write Unit test cases with Transational annotation rollback=true.
F*n
6 楼
The step I took: directly write SQL to create tables in the DBMS. You can create all the indexes there while JPA cannot. I mean, it's not the point.
【在 t*******e 的大作中提到】 : Rephrase your question please. : Steps I took, : Use hbm2ddl to generate and run SQL script from entities, : Run DBunit to insert testing data into the tables, or ask DBAs to load : testing data for you : Write Unit test cases with Transational annotation rollback=true.