parent
a102717338
commit
10c8e48ac5
@ -1,27 +0,0 @@
|
||||
package space.kklochko.jdbc_hospital_example;
|
||||
|
||||
import space.kklochko.jdbc_hospital_example.cli.CLI;
|
||||
import space.kklochko.jdbc_hospital_example.config.factories.LoadDataBaseConfigFromEnvFile;
|
||||
import space.kklochko.jdbc_hospital_example.config.models.DataBaseConfig;
|
||||
import space.kklochko.jdbc_hospital_example.db.factories.DataBaseConnection;
|
||||
import space.kklochko.jdbc_hospital_example.db.repositories.blocks.CreateTables;
|
||||
import space.kklochko.jdbc_hospital_example.db.repositories.blocks.TurnOnUUIDPlugin;
|
||||
|
||||
import java.sql.*;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
DataBaseConfig db = (new LoadDataBaseConfigFromEnvFile()).load();
|
||||
DataBaseConnection dbc = new DataBaseConnection(db);
|
||||
|
||||
TurnOnUUIDPlugin turnOnUUIDPlugin = new TurnOnUUIDPlugin();
|
||||
turnOnUUIDPlugin.create(dbc);
|
||||
|
||||
CreateTables createTables = new CreateTables();
|
||||
createTables.create(dbc);
|
||||
|
||||
CLI cli = new CLI(dbc);
|
||||
cli.run();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
package space.kklochko.jpa_hospital_example;
|
||||
|
||||
import jakarta.persistence.EntityManager;
|
||||
import space.kklochko.jpa_hospital_example.cli.CLI;
|
||||
import space.kklochko.jpa_hospital_example.db.factories.EntityManagerConnection;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
EntityManager manager = (new EntityManagerConnection()).connect();
|
||||
|
||||
CLI cli = new CLI(manager);
|
||||
cli.run();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue