Could you please give me some examples of how to update database tables from java code using hibernate entity classes and liquibase.
Something like this, but for annotated classes
Connection connection = null;
try {
connection = DriverManager.getConnection("jdbc:postgresql://localhost:5432/dvdrental", "postgres", "admin");
Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(connection));
Liquibase liquibase = new Liquibase("C:/changelog.xml", new FileSystemResourceAccessor(), database);
liquibase.update(new Contexts());
} catch (SQLException | LiquibaseException e) {
e.printStackTrace();
} finally {
if (connection != null) {
try {
connection.rollback();
connection.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}