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'; | |
| import * as StockService from '../generated/StockService'; | |
| @customElement("stock-tracker") | |
| export class StockTracker extends LitElement { | |
| render() { | |
| return html` | |
| <h1>StockTracker</h1> | |
| `; |
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
| const routes = [ | |
| { | |
| path: '', | |
| component: 'stock-tracker', | |
| action: async () => { await import('./views/stock-tracker'); } | |
| }, | |
| // fallback to server-side Flow routes if no client-side routes match | |
| ...serverSideRoutes | |
| ]; |
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` | |
| `; | |
| } | |
| } |
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
| 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
| 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
| 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 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; | |
| } |