This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public LiquibaseRunner(Properties properties, String changeLogSchema, String updateSchema) { | |
this.properties = properties; | |
this.changeLogSchema = changeLogSchema; | |
this.updateSchema= updateSchema; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Connection getConnection() throws SQLException { | |
return DriverManager.getConnection( | |
properties.getProperty("url"), | |
properties.getProperty("username"), | |
properties.getProperty("password")); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private Database getDatabase() throws SQLException, DatabaseException { | |
Connection connection = getConnection(); | |
connection.prepareStatement(String.format("SET search_path TO '%s'", updateSchema)).execute(); | |
Database database = DatabaseFactory.getInstance() | |
.findCorrectDatabaseImplementation(new JdbcConnection(connection)); | |
database.setDefaultSchemaName(changeLogSchema); | |
return database; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private Liquibase getLiquibase() throws DatabaseException, SQLException { | |
return new Liquibase(CHANGELOG_PATH, new ClassLoaderResourceAccessor(), getDatabase()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private Liquibase getLiquibase() throws DatabaseException, SQLException { | |
return new Liquibase(CHANGELOG_PATH, new ClassLoaderResourceAccessor(), getDatabase()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void doRun() throws Exception { | |
try (Liquibase liquibase = getLiquibase()) { | |
liquibase.update(new Contexts(), new LabelExpression()); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Stock { | |
private String symbol; | |
public String getSymbol() { | |
return symbol; | |
} | |
public void setSymbol(String symbol) { | |
this.symbol = symbol; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Stock { | |
private String symbol; | |
public String getSymbol() { | |
return symbol; | |
} | |
public void setSymbol(String symbol) { | |
this.symbol = symbol; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Endpoint | |
@AnonymousAllowed | |
public class StockService { | |
private static final Set<Stock> stocks = new HashSet<>(); | |
static { | |
Stock google = new Stock(); | |
google.setSymbol("GOOGL"); | |
stocks.add(google); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {LitElement, html, customElement} from 'lit-element'; | |
@customElement("stock-tracker") | |
export class StockTracker extends LitElement { | |
render() { | |
return html` | |
`; | |
} | |
} |
OlderNewer