I am going to write some integration tests that will test interatcion with db. For each test, I need to have some db snapshot. Each db snapshot is saved in a .sql file. I want to execute a specific script file in a specific testing method, for example:
@Test public void test_stuff(){ executeScript(finame.sql); ... testing logic ... clean_database(); }
Does sleep mode have any means to do this?
You can automatically execute the SQL script when you run hibernate: write your SQL commands in a file named import.sql and put it in the root of CLASSPATH.
, . , , . , Spring:
@Transactional @TransactionConfiguration public class MyTest { ... }
Spring, .
Session.connection()
JDBC :
https://www.hibernate.org/hib_docs/v3/api/org/hibernate/Session.html#connection()
, executeScript(), hibernate, sql jdbc.
Hypersonic SQL? , , ( Read, update, insert, delete), , , . : http://www.hsqldb.org/
Source: https://habr.com/ru/post/1728612/More articles:"Разрешение SELECT было отклонено на объект" при работе с представлениями на отдельной схеме - sql-serverhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1728608/how-long-does-it-take-to-translate-sql-server-queries-to-mysql&usg=ALkJrhi-UsZ7GNALvpT-qTh93qcQVn4_hgwhile (var! = var) - javaКак вы устанавливаете разрешения для схемы, у которой есть объекты, обращающиеся к другим схемам? - sql-serverwhat is the difference between self.navigationController and delegate.navigationController - objective-cNull Reference Exception - c #Is there a very tiny CMS in Java with MySQL? - javaC # file is still used after using operator - c #jQuery hover does not capture all events when the mouse moves fast - jqueryКак установить определение внутри другого определения - jsfAll Articles