Are you languishing in the trenches of SQL Views, UDFs, and ORM? Are you struggling to stay afloat in a massing pool of technical debt? Watch this now and be saved!
Introduction to Quill - Postgres Conf Philly 2019Alexander Ioffe
Quill is an open source Scala library for creating Language Integrated Queries: https://getquill.io/. It allows you to polymorphically create database-portable SQL queries and then execute them using JDBC as well as other protocols. Quill's superpower is that it generates most kinds of SQL Queries during Compile-Time, allowing you to know exactly what you are going to execute against your database well-before shipping to production!
Since Quill is written in Scala, it can integrate with other Java/JVM applications and live within the same codebase.
This document discusses best practices for using mocks in test-driven development. It explains that mocks should be used to assert on messages between objects, not to stub internal object behavior. Mocks represent roles that objects play, not concrete objects themselves. The document also advises only mocking types that the code owns, not external dependencies or internal implementation details. By following these principles, mocks can drive the design of well-structured, loosely-coupled code and enable tests to focus on public behavior without brittle assertions on private state.
This document contains 18 multiple choice questions from an Oracle 1z0-001 practice exam. The questions cover topics such as SQL statements, joins, cursors, PL/SQL, and database objects. For each question, there are 4 possible answers listed from which the user must select the correct answer.
The document provides information about Oracle 1Z0-007 exam preparation materials and free exam questions for various IT certification exams. It guarantees users can pass certification exams in 10-12 hours by studying the provided guides containing actual exam questions and answers. It also lists several free exam guides available for download.
This document contains sample questions from an Oracle Database SQL Expert exam. It includes 21 multiple choice questions about SQL concepts like joins, aggregation, regular expressions, and data dictionary views. The questions are testing knowledge of SQL syntax, functions, and techniques like hierarchical queries, inline views, and subqueries.
This document contains questions and answers related to Oracle SQL and PL/SQL. It begins with 29 multiple choice questions about SQL queries, functions, joins, views, constraints and other database concepts. The questions are numbered and include possible answer choices with the correct answers marked in red.
Bernhard Schussek gave a presentation on leveraging Symfony2 forms at the Symfony Live conference in March 2011. He discussed the evolution of the Symfony form component, its service-oriented architecture, and how forms are decoupled from business logic. He provided an example of an online sausage shop order form to demonstrate how form data is bound to objects and submitted. The presentation covered the form configuration class, form processing, field types, validation, embedding forms, and form themes.
Introduction to Quill - Postgres Conf Philly 2019Alexander Ioffe
Quill is an open source Scala library for creating Language Integrated Queries: https://getquill.io/. It allows you to polymorphically create database-portable SQL queries and then execute them using JDBC as well as other protocols. Quill's superpower is that it generates most kinds of SQL Queries during Compile-Time, allowing you to know exactly what you are going to execute against your database well-before shipping to production!
Since Quill is written in Scala, it can integrate with other Java/JVM applications and live within the same codebase.
This document discusses best practices for using mocks in test-driven development. It explains that mocks should be used to assert on messages between objects, not to stub internal object behavior. Mocks represent roles that objects play, not concrete objects themselves. The document also advises only mocking types that the code owns, not external dependencies or internal implementation details. By following these principles, mocks can drive the design of well-structured, loosely-coupled code and enable tests to focus on public behavior without brittle assertions on private state.
This document contains 18 multiple choice questions from an Oracle 1z0-001 practice exam. The questions cover topics such as SQL statements, joins, cursors, PL/SQL, and database objects. For each question, there are 4 possible answers listed from which the user must select the correct answer.
The document provides information about Oracle 1Z0-007 exam preparation materials and free exam questions for various IT certification exams. It guarantees users can pass certification exams in 10-12 hours by studying the provided guides containing actual exam questions and answers. It also lists several free exam guides available for download.
This document contains sample questions from an Oracle Database SQL Expert exam. It includes 21 multiple choice questions about SQL concepts like joins, aggregation, regular expressions, and data dictionary views. The questions are testing knowledge of SQL syntax, functions, and techniques like hierarchical queries, inline views, and subqueries.
This document contains questions and answers related to Oracle SQL and PL/SQL. It begins with 29 multiple choice questions about SQL queries, functions, joins, views, constraints and other database concepts. The questions are numbered and include possible answer choices with the correct answers marked in red.
Bernhard Schussek gave a presentation on leveraging Symfony2 forms at the Symfony Live conference in March 2011. He discussed the evolution of the Symfony form component, its service-oriented architecture, and how forms are decoupled from business logic. He provided an example of an online sausage shop order form to demonstrate how form data is bound to objects and submitted. The presentation covered the form configuration class, form processing, field types, validation, embedding forms, and form themes.
This document describes several extensions to DML and DDL statements in Oracle9i:
1) Multitable INSERT statements allow inserting rows into multiple tables in a single statement. Types include unconditional INSERT, conditional ALL INSERT, conditional FIRST INSERT, and pivoting INSERT.
2) External tables allow querying data stored outside the database in flat files using SQL. Metadata is defined using CREATE TABLE with the external_table_clause.
3) Indexes can be created at the same time as tables using the CREATE INDEX syntax within the CREATE TABLE statement.
Everything you always wanted to know about forms* *but were afraid to askAndrea Giuliano
La componente dei Form di Symfony2 rende possibile la costruzione di diverse tipologie di form in modo del tutto semplice. La sua architettura flessibile e altamente scalabile permette di poter gestire strutture adatte ad ogni tipo di esigenza. Tuttavia, conoscere come utilizzare appieno tutta la sua potenza non è banale. In questo talk verrà trattato in profondità la componente Form di Symfony2, mostrando i suoi meccanismi di base e come utilizzarli per estenderli ed introdurre la propria logica di business, così da costruire form cuciti a misura delle tue necessità.
Forms are inevitable. Forms are hard. Forms with React sometimes even harder. In this talk, we’ll start by exploring best practices to efficiently work with react/redux forms and proceed with building a custom abstraction layer for easier form management.
The document describes a job portal project called JobCentre. It includes sections on project scope, system requirements, data modeling, use cases and activity diagrams for the main user roles of administrator, employer and jobseeker. The system allows these users to perform functions like creating user accounts, posting and searching for jobs, applying for jobs and managing profiles. It also outlines future enhancements such as payment integration and improved email/SMS alerts.
This document contains SQL commands that create tables, views, and relationships between them for an education database. Tables are created for entities like students, courses, scholarships etc. and relationships are defined through foreign keys. Views are then created to select and combine specific columns from these tables for different reporting purposes.
This document provides summaries of SQL statements and concepts including:
1. Select statements with various clauses like WHERE, ORDER BY, GROUP BY, DISTINCT
2. Data definition language statements like CREATE, ALTER, DROP for databases, tables, indexes, views
3. Data manipulation language statements like INSERT, UPDATE, DELETE
4. Joins - equijoin, natural join, cross join
5. Constraints - primary key, foreign key, unique, check, default
The document describes the creation of database tables for a bank. It defines tables for customers, accounts, transactions, employees, branches, and other core banking entities. Primary keys are defined for each table and foreign keys are specified to link the tables together. Sample data is inserted into some of the tables to illustrate the structure.
This document contains code snippets for:
1) A SQL stored procedure that validates account transactions and applies overdraft fees;
2) An HTML form and PHP code to validate form submissions;
3) An SSRS report generated from a SQL stored procedure to display customer transactions.
The document provides an overview of a C/C++ tutorial, including:
- Contact information for the teaching assistant and class website.
- An outline of topics covered, such as Hello World programs, data types, operators, conditionals, loops, arrays, strings, pointers, functions, command line arguments, data structures, and memory allocation.
- Brief explanations and examples of key concepts like variable types, arithmetic operations, conditional statements, loops, functions, pointers, and dynamic memory allocation. It also discusses differences between C and C++.
Below is my code- I have an error that I still have difficulty figurin.pdfarmanuelraj
Below is my code. I have an error that I still have difficulty figuring out. Please explain and
teach me the solution to fix it specifically (e.g. changing which line in the code). Thank you!
main.cpp
/*
Overloaded stream insertion operator <<
- used to display reports and write data to file.
Overloaded relational operator (<)
- used to sort the array in ascending order by name (insertion sort)
*/
#include "Sales.h"
#include <iostream>
#include <sstream>
#include <iomanip>
#include <fstream>
#include <string>
using namespace std;
const int MAX_SIZE = 30;
/* Write your code here:
declare the function you are going to call in this program
*/
void readData(string fileName, Sales *salesArr, int &size);
void insertSort(Sales *salesArr, int size);
double calcSalesAvg(Sales *salesArr, int size);
void displayOverAvg(Sales *salesArr, int size, double avg);
void writeReport(Sales *salesArr, int size, string fileName);
void showReport(string fileName);
int main() {
Sales salesArr[MAX_SIZE];
int size = 0;
string fileName;
cout << "Please enter the input file's name: ";
getline(cin, fileName);
readData(fileName, salesArr, size);
insertSort(salesArr, size);
double avg = calcSalesAvg(salesArr, size);
displayOverAvg(salesArr, size, avg);
writeReport(salesArr, size, fileName);
string option;
cout << "Show report?" << endl;
getline(cin, option);
if (option == "Y" || option == "y")
showReport(fileName);
return 0;
}
// function definitions
void readData(string fileName, Sales *salesArr, int &size) {
string temp;
int i = 0;
fstream ptr;
ptr.open(fileName, ios::in);
while (getline(ptr, temp)) {
size++;
stringstream chk(temp);
string t2;
int id, year, amountSold;
string fname, lname;
int j = 0;
while (getline(chk, t2, ' ')) {
if (j == 0) {
id = stoi(t2);
}
if (j == 1) {
year = stoi(t2);
}
if (j == 2) {
fname = t2;
}
if (j == 3) {
lname = t2;
}
if (j == 4) {
amountSold = stoi(t2);
}
j++;
}
string gg = fname + " " + lname;
gg[gg.size() - 1] = 0;
Sales ss(id, year, gg, amountSold);
salesArr[i] = ss;
i++;
}
ptr.close();
}
void insertSort(Sales *salesArr, int size) {
for (int i = 0; i < size; i++) {
for (int j = i + 1; j < size; j++) {
if (salesArr[j] < salesArr[i]) {
Sales temp(salesArr[i]);
salesArr[i] = salesArr[j];
salesArr[j] = temp;
}
}
}
}
double calcSalesAvg(Sales *salesArr, int size) {
double d = 0;
for (int i = 0; i < size; i++) {
d += (salesArr[i].getAmountSold());
}
return (double) d / size;
}
void displayOverAvg(Sales *salesArr, int size, double avg) {
cout << "Average Sales: " << avg << endl;
string nm ;
cout << "Salespeople with above average sales:" << endl;
for (int i = 0; i < size; i++) {
if (salesArr[i].getAmountSold() > avg) {
cout << salesArr[i];
}
}
}
void writeReport(Sales *salesArr, int size, string fileName) {
fileName.insert(fileName.find("."), "Report");
fstream ptr;
ptr.open(fileName, ios::out);
for (int i = 0; i < size; i++) {
ptr << salesArr[i];
}
ptr.close();
}
/*
This function receives the name of a file and
displays its contents to the s.
The document contains SQL scripts that define several tables for a finance module, including tables for general ledger codes, subledger types, subledgers, addresses, banks, taxes, and vouchers. Foreign key constraints are defined to link the tables together. The tables will be used to store and link financial data such as general ledger codes, subledgers, addresses, banks, taxes, and vouchers.
Security Slicing for Auditing XML, XPath, and SQL Injection VulnerabilitiesLionel Briand
This document discusses security slicing for auditing XML, XPath, and SQL injection vulnerabilities. It presents an approach using taint analysis and system dependence graph construction to extract security-relevant program slices. These slices can then be filtered and chopped to aid security auditing. The approach was evaluated on several test subjects and was shown to significantly reduce the number of slices that need to be examined compared to traditional chopping. Future work areas include handling more complex string operations and integrating with constraint solvers.
The document contains SQL scripts that create tables for a finance module database. The scripts create tables for general ledger masters, subledger types, subledgers, subledger addresses, banks, and taxes. Foreign key constraints are added to link the tables together and enforce referential integrity of the data. In total, 6 tables are created along with 8 alter statements to add foreign key constraints between the tables.
A complete list of MySQL commands with little description.
These are the available commands used for administration.
This was prepared while I was in CSIT VII Semester and would like to share with
you.
This document discusses functional domain-driven design and the use of monads. It begins by stating that functional domain-driven design is still a work in progress. It then provides definitions of monads and functions as they relate to category theory. The document discusses how monads can be used with a functional approach to domain-driven design. It also includes brief biographical information about the software developer who posted this content.
The document discusses value semantics vs reference semantics in Swift. It explains that value types (structs, enums, tuples) use value semantics where copies are made, while reference types (classes) use reference semantics where copies of references are made but the instances are shared. It provides examples to illustrate how value types stored on the stack are copied, while reference types stored on the heap are referenced. The document also covers topics like identity vs equality, mutability, reference counting, and static vs dynamic method dispatch in Swift.
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesQuickdice ERP
Explore the seamless transition to e-invoicing with this comprehensive guide tailored for Saudi Arabian businesses. Navigate the process effortlessly with step-by-step instructions designed to streamline implementation and enhance efficiency.
This document describes several extensions to DML and DDL statements in Oracle9i:
1) Multitable INSERT statements allow inserting rows into multiple tables in a single statement. Types include unconditional INSERT, conditional ALL INSERT, conditional FIRST INSERT, and pivoting INSERT.
2) External tables allow querying data stored outside the database in flat files using SQL. Metadata is defined using CREATE TABLE with the external_table_clause.
3) Indexes can be created at the same time as tables using the CREATE INDEX syntax within the CREATE TABLE statement.
Everything you always wanted to know about forms* *but were afraid to askAndrea Giuliano
La componente dei Form di Symfony2 rende possibile la costruzione di diverse tipologie di form in modo del tutto semplice. La sua architettura flessibile e altamente scalabile permette di poter gestire strutture adatte ad ogni tipo di esigenza. Tuttavia, conoscere come utilizzare appieno tutta la sua potenza non è banale. In questo talk verrà trattato in profondità la componente Form di Symfony2, mostrando i suoi meccanismi di base e come utilizzarli per estenderli ed introdurre la propria logica di business, così da costruire form cuciti a misura delle tue necessità.
Forms are inevitable. Forms are hard. Forms with React sometimes even harder. In this talk, we’ll start by exploring best practices to efficiently work with react/redux forms and proceed with building a custom abstraction layer for easier form management.
The document describes a job portal project called JobCentre. It includes sections on project scope, system requirements, data modeling, use cases and activity diagrams for the main user roles of administrator, employer and jobseeker. The system allows these users to perform functions like creating user accounts, posting and searching for jobs, applying for jobs and managing profiles. It also outlines future enhancements such as payment integration and improved email/SMS alerts.
This document contains SQL commands that create tables, views, and relationships between them for an education database. Tables are created for entities like students, courses, scholarships etc. and relationships are defined through foreign keys. Views are then created to select and combine specific columns from these tables for different reporting purposes.
This document provides summaries of SQL statements and concepts including:
1. Select statements with various clauses like WHERE, ORDER BY, GROUP BY, DISTINCT
2. Data definition language statements like CREATE, ALTER, DROP for databases, tables, indexes, views
3. Data manipulation language statements like INSERT, UPDATE, DELETE
4. Joins - equijoin, natural join, cross join
5. Constraints - primary key, foreign key, unique, check, default
The document describes the creation of database tables for a bank. It defines tables for customers, accounts, transactions, employees, branches, and other core banking entities. Primary keys are defined for each table and foreign keys are specified to link the tables together. Sample data is inserted into some of the tables to illustrate the structure.
This document contains code snippets for:
1) A SQL stored procedure that validates account transactions and applies overdraft fees;
2) An HTML form and PHP code to validate form submissions;
3) An SSRS report generated from a SQL stored procedure to display customer transactions.
The document provides an overview of a C/C++ tutorial, including:
- Contact information for the teaching assistant and class website.
- An outline of topics covered, such as Hello World programs, data types, operators, conditionals, loops, arrays, strings, pointers, functions, command line arguments, data structures, and memory allocation.
- Brief explanations and examples of key concepts like variable types, arithmetic operations, conditional statements, loops, functions, pointers, and dynamic memory allocation. It also discusses differences between C and C++.
Below is my code- I have an error that I still have difficulty figurin.pdfarmanuelraj
Below is my code. I have an error that I still have difficulty figuring out. Please explain and
teach me the solution to fix it specifically (e.g. changing which line in the code). Thank you!
main.cpp
/*
Overloaded stream insertion operator <<
- used to display reports and write data to file.
Overloaded relational operator (<)
- used to sort the array in ascending order by name (insertion sort)
*/
#include "Sales.h"
#include <iostream>
#include <sstream>
#include <iomanip>
#include <fstream>
#include <string>
using namespace std;
const int MAX_SIZE = 30;
/* Write your code here:
declare the function you are going to call in this program
*/
void readData(string fileName, Sales *salesArr, int &size);
void insertSort(Sales *salesArr, int size);
double calcSalesAvg(Sales *salesArr, int size);
void displayOverAvg(Sales *salesArr, int size, double avg);
void writeReport(Sales *salesArr, int size, string fileName);
void showReport(string fileName);
int main() {
Sales salesArr[MAX_SIZE];
int size = 0;
string fileName;
cout << "Please enter the input file's name: ";
getline(cin, fileName);
readData(fileName, salesArr, size);
insertSort(salesArr, size);
double avg = calcSalesAvg(salesArr, size);
displayOverAvg(salesArr, size, avg);
writeReport(salesArr, size, fileName);
string option;
cout << "Show report?" << endl;
getline(cin, option);
if (option == "Y" || option == "y")
showReport(fileName);
return 0;
}
// function definitions
void readData(string fileName, Sales *salesArr, int &size) {
string temp;
int i = 0;
fstream ptr;
ptr.open(fileName, ios::in);
while (getline(ptr, temp)) {
size++;
stringstream chk(temp);
string t2;
int id, year, amountSold;
string fname, lname;
int j = 0;
while (getline(chk, t2, ' ')) {
if (j == 0) {
id = stoi(t2);
}
if (j == 1) {
year = stoi(t2);
}
if (j == 2) {
fname = t2;
}
if (j == 3) {
lname = t2;
}
if (j == 4) {
amountSold = stoi(t2);
}
j++;
}
string gg = fname + " " + lname;
gg[gg.size() - 1] = 0;
Sales ss(id, year, gg, amountSold);
salesArr[i] = ss;
i++;
}
ptr.close();
}
void insertSort(Sales *salesArr, int size) {
for (int i = 0; i < size; i++) {
for (int j = i + 1; j < size; j++) {
if (salesArr[j] < salesArr[i]) {
Sales temp(salesArr[i]);
salesArr[i] = salesArr[j];
salesArr[j] = temp;
}
}
}
}
double calcSalesAvg(Sales *salesArr, int size) {
double d = 0;
for (int i = 0; i < size; i++) {
d += (salesArr[i].getAmountSold());
}
return (double) d / size;
}
void displayOverAvg(Sales *salesArr, int size, double avg) {
cout << "Average Sales: " << avg << endl;
string nm ;
cout << "Salespeople with above average sales:" << endl;
for (int i = 0; i < size; i++) {
if (salesArr[i].getAmountSold() > avg) {
cout << salesArr[i];
}
}
}
void writeReport(Sales *salesArr, int size, string fileName) {
fileName.insert(fileName.find("."), "Report");
fstream ptr;
ptr.open(fileName, ios::out);
for (int i = 0; i < size; i++) {
ptr << salesArr[i];
}
ptr.close();
}
/*
This function receives the name of a file and
displays its contents to the s.
The document contains SQL scripts that define several tables for a finance module, including tables for general ledger codes, subledger types, subledgers, addresses, banks, taxes, and vouchers. Foreign key constraints are defined to link the tables together. The tables will be used to store and link financial data such as general ledger codes, subledgers, addresses, banks, taxes, and vouchers.
Security Slicing for Auditing XML, XPath, and SQL Injection VulnerabilitiesLionel Briand
This document discusses security slicing for auditing XML, XPath, and SQL injection vulnerabilities. It presents an approach using taint analysis and system dependence graph construction to extract security-relevant program slices. These slices can then be filtered and chopped to aid security auditing. The approach was evaluated on several test subjects and was shown to significantly reduce the number of slices that need to be examined compared to traditional chopping. Future work areas include handling more complex string operations and integrating with constraint solvers.
The document contains SQL scripts that create tables for a finance module database. The scripts create tables for general ledger masters, subledger types, subledgers, subledger addresses, banks, and taxes. Foreign key constraints are added to link the tables together and enforce referential integrity of the data. In total, 6 tables are created along with 8 alter statements to add foreign key constraints between the tables.
A complete list of MySQL commands with little description.
These are the available commands used for administration.
This was prepared while I was in CSIT VII Semester and would like to share with
you.
This document discusses functional domain-driven design and the use of monads. It begins by stating that functional domain-driven design is still a work in progress. It then provides definitions of monads and functions as they relate to category theory. The document discusses how monads can be used with a functional approach to domain-driven design. It also includes brief biographical information about the software developer who posted this content.
The document discusses value semantics vs reference semantics in Swift. It explains that value types (structs, enums, tuples) use value semantics where copies are made, while reference types (classes) use reference semantics where copies of references are made but the instances are shared. It provides examples to illustrate how value types stored on the stack are copied, while reference types stored on the heap are referenced. The document also covers topics like identity vs equality, mutability, reference counting, and static vs dynamic method dispatch in Swift.
Similar to Slick in Practice. Salvation from the Trenches of SQL (13)
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesQuickdice ERP
Explore the seamless transition to e-invoicing with this comprehensive guide tailored for Saudi Arabian businesses. Navigate the process effortlessly with step-by-step instructions designed to streamline implementation and enhance efficiency.
Graspan: A Big Data System for Big Code AnalysisAftab Hussain
We built a disk-based parallel graph system, Graspan, that uses a novel edge-pair centric computation model to compute dynamic transitive closures on very large program graphs.
We implement context-sensitive pointer/alias and dataflow analyses on Graspan. An evaluation of these analyses on large codebases such as Linux shows that their Graspan implementations scale to millions of lines of code and are much simpler than their original implementations.
These analyses were used to augment the existing checkers; these augmented checkers found 132 new NULL pointer bugs and 1308 unnecessary NULL tests in Linux 4.4.0-rc5, PostgreSQL 8.3.9, and Apache httpd 2.2.18.
- Accepted in ASPLOS ‘17, Xi’an, China.
- Featured in the tutorial, Systemized Program Analyses: A Big Data Perspective on Static Analysis Scalability, ASPLOS ‘17.
- Invited for presentation at SoCal PLS ‘16.
- Invited for poster presentation at PLDI SRC ‘16.
DDS Security Version 1.2 was adopted in 2024. This revision strengthens support for long runnings systems adding new cryptographic algorithms, certificate revocation, and hardness against DoS attacks.
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemPeter Muessig
Learn about the latest innovations in and around OpenUI5/SAPUI5: UI5 Tooling, UI5 linter, UI5 Web Components, Web Components Integration, UI5 2.x, UI5 GenAI.
Recording:
https://www.youtube.com/live/MSdGLG2zLy8?si=INxBHTqkwHhxV5Ta&t=0
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsPeter Muessig
The UI5 tooling is the development and build tooling of UI5. It is built in a modular and extensible way so that it can be easily extended by your needs. This session will showcase various tooling extensions which can boost your development experience by far so that you can really work offline, transpile your code in your project to use even newer versions of EcmaScript (than 2022 which is supported right now by the UI5 tooling), consume any npm package of your choice in your project, using different kind of proxies, and even stitching UI5 projects during development together to mimic your target environment.
Artificia Intellicence and XPath Extension FunctionsOctavian Nadolu
The purpose of this presentation is to provide an overview of how you can use AI from XSLT, XQuery, Schematron, or XML Refactoring operations, the potential benefits of using AI, and some of the challenges we face.
Takashi Kobayashi and Hironori Washizaki, "SWEBOK Guide and Future of SE Education," First International Symposium on the Future of Software Engineering (FUSE), June 3-6, 2024, Okinawa, Japan
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j
Dr. Jesús Barrasa, Head of Solutions Architecture for EMEA, Neo4j
Découvrez les dernières innovations de Neo4j, et notamment les dernières intégrations cloud et les améliorations produits qui font de Neo4j un choix essentiel pour les développeurs qui créent des applications avec des données interconnectées et de l’IA générative.
Zoom is a comprehensive platform designed to connect individuals and teams efficiently. With its user-friendly interface and powerful features, Zoom has become a go-to solution for virtual communication and collaboration. It offers a range of tools, including virtual meetings, team chat, VoIP phone systems, online whiteboards, and AI companions, to streamline workflows and enhance productivity.
Atelier - Innover avec l’IA Générative et les graphes de connaissancesNeo4j
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Allez au-delà du battage médiatique autour de l’IA et découvrez des techniques pratiques pour utiliser l’IA de manière responsable à travers les données de votre organisation. Explorez comment utiliser les graphes de connaissances pour augmenter la précision, la transparence et la capacité d’explication dans les systèmes d’IA générative. Vous partirez avec une expérience pratique combinant les relations entre les données et les LLM pour apporter du contexte spécifique à votre domaine et améliorer votre raisonnement.
Amenez votre ordinateur portable et nous vous guiderons sur la mise en place de votre propre pile d’IA générative, en vous fournissant des exemples pratiques et codés pour démarrer en quelques minutes.
Flutter is a popular open source, cross-platform framework developed by Google. In this webinar we'll explore Flutter and its architecture, delve into the Flutter Embedder and Flutter’s Dart language, discover how to leverage Flutter for embedded device development, learn about Automotive Grade Linux (AGL) and its consortium and understand the rationale behind AGL's choice of Flutter for next-gen IVI systems. Don’t miss this opportunity to discover whether Flutter is right for your project.
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeAftab Hussain
Understanding variable roles in code has been found to be helpful by students
in learning programming -- could variable roles help deep neural models in
performing coding tasks? We do an exploratory study.
- These are slides of the talk given at InteNSE'23: The 1st International Workshop on Interpretability and Robustness in Neural Software Engineering, co-located with the 45th International Conference on Software Engineering, ICSE 2023, Melbourne Australia
SOCRadar's Aviation Industry Q1 Incident Report is out now!
The aviation industry has always been a prime target for cybercriminals due to its critical infrastructure and high stakes. In the first quarter of 2024, the sector faced an alarming surge in cybersecurity threats, revealing its vulnerabilities and the relentless sophistication of cyber attackers.
SOCRadar’s Aviation Industry, Quarterly Incident Report, provides an in-depth analysis of these threats, detected and examined through our extensive monitoring of hacker forums, Telegram channels, and dark web platforms.
GraphSummit Paris - The art of the possible with Graph TechnologyNeo4j
Sudhir Hasbe, Chief Product Officer, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
WhatsApp offers simple, reliable, and private messaging and calling services for free worldwide. With end-to-end encryption, your personal messages and calls are secure, ensuring only you and the recipient can access them. Enjoy voice and video calls to stay connected with loved ones or colleagues. Express yourself using stickers, GIFs, or by sharing moments on Status. WhatsApp Business enables global customer outreach, facilitating sales growth and relationship building through showcasing products and services. Stay connected effortlessly with group chats for planning outings with friends or staying updated on family conversations.
3. Theory
class Cat extends Animal
{
...
}
Practice
class ManagerFactory extends Factory {
...
}
Noun Verb
4. Theory
class Cat extends Animal
{
...
}
Practice
class ManagerFactory extends Factory {
Manager construct() {…}
} <- The Real verb
* https://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html
Noun Verb Chaperone
11. SELECT DISTINCT
account.name, alias,
CASE WHEN code = 'EV'
THEN cast(account.number AS VARCHAR)
ELSE cast(account.number AS VARCHAR) + substring(alias, 1, 2) END AS OFFICIAL_IDENTITY,
CASE WHEN order_permission IN ('A', 'S')
THEN 'ST' ELSE 'ENH' END
FROM (
SELECT DISTINCT mc.alias, mc.code, order_permission, mc.account_tag
FROM MERCHANT_CLIENTS mc
JOIN REGISTRY r ON r.alias = mc.alias
WHERE r.market = 'us' AND r.record_type = 'M'
UNION ALL
SELECT DISTINCT sc.alias, 'EV' AS code, part.order_permission, sc.account_tag
FROM SERVICE_CLIENTS sc
JOIN REGISTRY r ON r.alias = sc.alias AND r.record_type = 'S' AND r.market = 'us'
JOIN PARTNERSHIPS part ON part.id = sc.partnership_fk) client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON account.type = accountType.account_type
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON dedicated.account_number = account.number)
ON (accountType.mapping_type = 0)
OR (accountType.mapping_type = 2 AND account.tag = client.account_tag)
OR (accountType.mapping_type = 1 AND dedicated.client_alias = client.alias)
13. SELECT DISTINCT
account.name, alias,
CASE (...) AS OFFICIAL_IDENTITY,
CASE (...)
FROM (
SELECT DISTINCT
mc.alias, mc.code, order_permission, mc.account_tag (code, alias, perm, tag)
FROM MERCHANT_CLIENTS mc
JOIN REGISTRY r ON (alias) AND (otherConditions)
UNION ALL
SELECT DISTINCT
sc.alias, 'EV' AS code, part.order_permission, sc.account_tag (code, alias, perm, tag)
FROM SERVICE_CLIENTS sc
JOIN REGISTRY r ON (alias) AND (otherConditions)
JOIN PARTNERSHIPS part ON (id <-> fk)) client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON (account_type)
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON (account_number)
)
ON (possibly anything...)
OR (possibly the account tag...)
OR (possibly the alias...) → All Depending on the accountType
14. SELECT DISTINCT
account.name, alias,
CASE (...) AS OFFICIAL_IDENTITY,
CASE (...)
FROM (
SELECT DISTINCT
mc.alias, mc.code, order_permission, mc.account_tag (code, alias, perm, tag)
FROM MERCHANT_CLIENTS mc
JOIN REGISTRY r ON (alias) AND (otherConditions)
UNION ALL
SELECT DISTINCT
sc.alias, 'EV' AS code, part.order_permission, sc.account_tag (code, alias, perm, tag)
FROM SERVICE_CLIENTS sc
JOIN REGISTRY r ON (alias) AND (otherConditions)
JOIN PARTNERSHIPS part ON (id <-> fk)) client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON (account_type)
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON (account_number)
)
ON (possibly anything...)
OR (possibly the account tag...)
OR (possibly the alias...) → All Depending on the accountType
15. SELECT DISTINCT
account.name, alias,
CASE (...) AS OFFICIAL_IDENTITY,
CASE (...)
FROM (
SELECT DISTINCT
mc.alias, mc.code, order_permission, mc.account_tag (code, alias, perm, tag)
FROM MERCHANT_CLIENTS mc
JOIN REGISTRY r ON (alias) AND (otherConditions)
UNION ALL
SELECT DISTINCT
sc.alias, 'EV' AS code, part.order_permission, sc.account_tag (code, alias, perm, tag)
FROM SERVICE_CLIENTS sc
JOIN REGISTRY r ON (alias) AND (otherConditions)
JOIN PARTNERSHIPS part ON (id <-> fk)) client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON (account_type)
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON (account_number)
)
ON (possibly anything...)
OR (possibly the account tag...)
OR (possibly the alias...) → All Depending on the accountType
Alias RecType Mkt Description
ACMC M ca ACME Canada.
ACME M us ACME Corp.
ACMI M eu ACME International Corp.
FNF S us Frin and Flyn Association
FNJ S us
Krueger and Voorhees
Alliance
Alias Code Perm
ACME INC T
ACMI INC T
ACMC INC T
ALIAS FK Account Tag
YOGL 1 YOG
FNF 2 SID
FNJ 3 FF
ID PERM DESCRIPTION
1 S Y.G. Schwartz Supplies Procurement
2 T Frin and Flyn Procurement
3 H Special Individuals Fulfillment
4 H Special Individuals Fulfillment International
Alias Code Perm Tag
ACME INC T
ACMI INC T
ACMC INC T
YOGL S S YOG
FNF T T SID
FNJ H H FF
16. SELECT DISTINCT
account.name, alias,
CASE (...) AS OFFICIAL_IDENTITY,
CASE (...)
FROM (...) client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON (account_type)
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON (account_number)
)
ON (accountType.mapping_type = 0)
OR (possibly the account tag...)
OR (possibly the alias...)
name alias OFFICIAL_IDENTITY perm
TUNV FNF 111 ENH
TUNV ACME 111AC ENH
SIADV FNF 456 ENH
AUNV FNF 222 ENH
AUNV ACME 222AC ENH
ACMEINV ACME 808AC ENH
YOGADV YOGL 123 ST
TUNV YOGL 111 ST
AUNV YOGL 222 ST
17. SELECT DISTINCT
account.name, alias,
CASE (...) AS OFFICIAL_IDENTITY,
CASE (...)
FROM (...) client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON (account_type)
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON (account_number)
)
ON (possibly anything...)
OR (accountType.mapping_type = 2 AND account.tag = client.account_tag)
OR (possibly the alias...)
name alias OFFICIAL_IDENTITY perm
TUNV FNF 111 ENH
TUNV ACME 111AC ENH
SIADV FNF 456 ENH
AUNV FNF 222 ENH
AUNV ACME 222AC ENH
ACMEINV ACME 808AC ENH
YOGADV YOGL 123 ST
TUNV YOGL 111 ST
AUNV YOGL 222 ST
18. SELECT DISTINCT
account.name, alias,
CASE (...) AS OFFICIAL_IDENTITY,
CASE (...)
FROM (...) client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON (account_type)
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON (account_number)
)
ON (possibly anything...)
OR (possibly the account tag...)
OR (accountType.mapping_type = 1 AND dedicated.client_alias = client.alias)
name alias OFFICIAL_IDENTITY perm
TUNV FNF 111 ENH
TUNV ACME 111AC ENH
SIADV FNF 456 ENH
AUNV FNF 222 ENH
AUNV ACME 222AC ENH
ACMEINV ACME 808AC ENH
YOGADV YOGL 123 ST
TUNV YOGL 111 ST
AUNV YOGL 222 ST
20. SELECT DISTINCT
account.name, alias,
CASE WHEN code = 'EV'
THEN cast(account.number AS VARCHAR)
ELSE cast(account.number AS VARCHAR) + substring(alias, 1, 2) END AS OFFICIAL_IDENTITY,
CASE WHEN order_permission IN ('A', 'S')
THEN 'ST' ELSE 'ENH' END
FROM (
SELECT DISTINCT mc.alias, mc.code, order_permission, mc.account_tag
FROM MERCHANT_CLIENTS mc
JOIN REGISTRY r ON r.alias = mc.alias
WHERE r.market = 'us' AND r.record_type = 'M'
UNION ALL
SELECT DISTINCT sc.alias, 'EV' AS code, part.order_permission, sc.account_tag
FROM SERVICE_CLIENTS sc
JOIN REGISTRY r ON r.alias = sc.alias AND r.record_type = 'S' AND r.market = 'us'
JOIN PARTNERSHIPS part ON part.id = sc.partnership_fk) client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON account.type = accountType.account_type
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON dedicated.account_number = account.number)
ON (accountType.mapping_type = 0)
OR (accountType.mapping_type = 2 AND account.tag = client.account_tag)
OR (accountType.mapping_type = 1 AND dedicated.client_alias = client.alias)
21. WITH merchantClients AS (
SELECT DISTINCT mc.alias, mc.code, order_permission, mc.account_tag
FROM MERCHANT_CLIENTS mc
JOIN REGISTRY r ON r.alias = mc.alias),
serviceClients AS (SELECT DISTINCT
sc.alias, 'EV' AS code, partnership.order_permission, sc.account_tag
FROM SERVICE_CLIENTS sc
JOIN REGISTRY r ON r.alias = sc.alias AND r.record_type = 'S' AND r.market = 'us'
JOIN PARTNERSHIPS partnership ON partnership.id = sc.partnership_fk),
client AS (SELECT * FROM merchantClients UNION ALL SELECT * FROM serviceClients)
SELECT DISTINCT account.name, alias,
CASE WHEN code = 'EV'
THEN cast(account.number AS VARCHAR)
ELSE cast(account.number AS VARCHAR) + substring(alias, 1, 2) END AS OFFICIAL_IDENTITY,
CASE WHEN order_permission IN ('A', 'S')
THEN 'ST' ELSE 'ENH' END
FROM client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON account.type = accountType.account_type
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON dedicated.account_number = account.number)
ON (accountType.mapping_type = 0)
OR (accountType.mapping_type = 2 AND account.tag = client.account_tag)
OR (accountType.mapping_type = 1 AND dedicated.client_alias = client.alias)
22. CREATE VIEW MERCHANT_CLIENTS_V AS
SELECT DISTINCT
mc.alias,
mc.code,
order_permission,
mc.account_tag
FROM MERCHANT_CLIENTS mc
JOIN REGISTRY entry ON entry.alias = mc.alias
WHERE entry.market = 'us'
AND entry.record_type = 'M'
CREATE VIEW SERVICE_CLIENTS_V AS
SELECT DISTINCT
sc.alias,
'EV' AS code,
partnership.order_permission,
sc.account_tag
FROM SERVICE_CLIENTS sc
JOIN REGISTRY entry ON entry.alias = sc.alias
AND entry.record_type = 'S'
AND entry.market = 'us'
JOIN PARTNERSHIPS partnership
ON partnership.id = sc.partnership_fk
CREATE VIEW CLIENTS AS
SELECT * FROM MERCHANT_CLIENTS_V
UNION ALL SELECT * FROM SERVICE_CLIENTS_V
23. CREATE VIEW MERCHANT_CLIENTS_V AS
SELECT DISTINCT (...)
FROM MERCHANT_CLIENTS mc
JOIN REGISTRY entry ON entry.alias = mc.alias
WHERE entry.market = 'us'
AND entry.record_type = 'M'
CREATE VIEW SERVICE_CLIENTS_V AS
SELECT DISTINCT (...)
FROM SERVICE_CLIENTS sc
JOIN REGISTRY entry ON entry.alias = sc.alias
AND entry.record_type = 'S'
AND entry.market = 'us'
JOIN PARTNERSHIPS partnership
ON partnership.id = sc.partnership_fk
CREATE VIEW CLIENT_ACCOUNTS AS
SELECT DISTINCT
account.name, alias,
CASE WHEN code = 'EV'
THEN cast(account.number AS VARCHAR)
ELSE cast(account.number AS VARCHAR) + substring(alias, 1, 2) END AS OFFICIAL_IDENTITY,
CASE WHEN order_permission IN ('A', 'S')
THEN 'ST' ELSE 'ENH' END
FROM CLIENTS AS client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON account.type = accountType.account_type
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON dedicated.account_number = account.number)
ON (accountType.mapping_type = 0)
OR (accountType.mapping_type = 2 AND account.tag = client.account_tag)
OR (accountType.mapping_type = 1 AND dedicated.client_alias = client.alias)
CREATE VIEW CLIENTS AS
SELECT * FROM MERCHANT_CLIENTS_V
UNION ALL SELECT * FROM SERVICE_CLIENTS_V
24. New Requirements
1.New European Business Unit
with Client Codes from
the Partnership
2.New Canadian Business Unit
without Service Clients
25. CREATE VIEW EU_MERCHANT_CLIENTS AS
SELECT DISTINCT (...)
FROM MERCHANT_CLIENTS mc
JOIN REGISTRY entry ON entry.alias = mc.alias
WHERE entry.market = 'eu'
AND entry.record_type = 'M'
CREATE VIEW EU_SERVICE_CLIENTS AS
SELECT DISTINCT (... pc.code, ...)
FROM SERVICE_CLIENTS sc
JOIN REGISTRY entry ON entry.alias = sc.alias
AND entry.record_type = 'S'
AND entry.market = 'eu'
JOIN PARTNERSHIPS partnership
ON partnership.id = sc.partnership_fk
JOIN PARTNERSHIP_CODES pc
ON partnership.ID = pc.partnership_fk
CREATE VIEW EU_CLIENT_ACCOUNTS AS
SELECT DISTINCT
account.name, alias,
CASE WHEN code = 'EV'
THEN cast(account.number AS VARCHAR)
ELSE cast(account.number AS VARCHAR) + substring(alias, 1, 2) END AS OFFICIAL_IDENTITY,
CASE WHEN order_permission IN ('A', 'S')
THEN 'ST' ELSE 'ENH' END
FROM EU_CLIENTS AS client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON account.type = accountType.account_type
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON dedicated.account_number = account.number)
ON (accountType.mapping_type = 0)
OR (accountType.mapping_type = 2 AND account.tag = client.account_tag)
OR (accountType.mapping_type = 1 AND dedicated.client_alias = client.alias)
CREATE VIEW EU_CLIENTS AS
SELECT * FROM EU_MERCHANT_CLIENTS
UNION ALL SELECT * FROM US_SERVICE_CLIENTS
26. CREATE VIEW CA_MERCHANT_CLIENTS AS
SELECT DISTINCT (...)
FROM MERCHANT_CLIENTS mc
JOIN REGISTRY entry ON entry.alias = mc.alias
WHERE entry.market = 'ca'
AND entry.record_type = 'M'
CREATE VIEW CA_CLIENT_ACCOUNTS AS
SELECT DISTINCT
account.name, alias,
CASE WHEN code = 'EV'
THEN cast(account.number AS VARCHAR)
ELSE cast(account.number AS VARCHAR) + substring(alias, 1, 2) END AS OFFICIAL_IDENTITY,
CASE WHEN order_permission IN ('A', 'S')
THEN 'ST' ELSE 'ENH' END
FROM CA_MERCHANT_CLIENTS AS client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON account.type = accountType.account_type
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON dedicated.account_number = account.number)
ON (accountType.mapping_type = 0)
OR (accountType.mapping_type = 2 AND account.tag = client.account_tag)
OR (accountType.mapping_type = 1 AND dedicated.client_alias = client.alias)
28. CREATE FUNCTION dbo.merchantClientsUdf (@market)
RETURNS table as RETURN (
SELECT DISTINCT
alias, code, order_permission, account_tag
FROM MERCHANT_CLIENTS merchantClient
JOIN REGISTRY entry
ON entry.alias = merchantClient.alias
WHERE entry.market = @market
AND entry.record_type = 'M')
CREATE VIEW CLIENT_ACCOUNTS AS
SELECT DISTINCT
account.name, alias,
CASE WHEN code = 'EV'
THEN cast(account.number AS VARCHAR)
ELSE cast(account.number AS VARCHAR) + substring(alias, 1, 2) END AS OFFICIAL_IDENTITY,
CASE WHEN order_permission IN ('A', 'S')
THEN 'ST' ELSE 'ENH' END
FROM (select * from merchantClientsUdf ('us') union
select * from serviceClientsUdf ('us')) as client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON account.type = accountType.account_type
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON dedicated.account_number = account.number)
ON (accountType.mapping_type = 0)
OR (accountType.mapping_type = 2 AND account.tag = client.account_tag)
OR (accountType.mapping_type = 1 AND dedicated.client_alias = client.alias)
CREATE FUNCTION dbo.serviceClientsUdf (@market)
RETURNS table as RETURN (
SELECT DISTINCT
alias, code, order_permission, account_tag
FROM SERVICE_CLIENTS serviceClient
JOIN REGISTRY entry
ON entry.alias = serviceClient.alias
AND entry.record_type = 'S'
AND entry.market = @market
JOIN PARTNERSHIPS partnership
ON partnership.id = serviceClient.partnership_fk)
29. CREATE FUNCTION dbo.merchantClientsUdf (@market)
RETURNS table as RETURN (…)
CREATE VIEW EU_CLIENT_ACCOUNTS AS
SELECT DISTINCT
account.name, alias,
CASE WHEN code = 'EV'
THEN cast(account.number AS VARCHAR)
ELSE cast(account.number AS VARCHAR) + substring(alias, 1, 2) END AS OFFICIAL_IDENTITY,
CASE WHEN order_permission IN ('A', 'S')
THEN 'ST' ELSE 'ENH' END
FROM (select * from merchantClientsUdf ('eu') union
select * from enhancedServiceClientsUdf ('eu')) as client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON account.type = accountType.account_type
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON dedicated.account_number = account.number)
ON (accountType.mapping_type = 0)
OR (accountType.mapping_type = 2 AND account.tag = client.account_tag)
OR (accountType.mapping_type = 1 AND dedicated.client_alias = client.alias)
CREATE FUNCTION dbo.enhancedServiceClientsUdf (@market)
RETURNS table as RETURN (
SELECT DISTINCT
alias, code, order_permission, account_tag
FROM SERVICE_CLIENTS serviceClient
JOIN REGISTRY entry
ON (... entry.market = @market ...)
JOIN PARTNERSHIPS partnership ON (…)
JOIN PARTNERSHIP_CODES pc
ON partnership.ID = pc.partnership_fk
30. CREATE FUNCTION dbo.merchantClientsUdf (@market)
RETURNS table as RETURN (…)
CREATE VIEW CA_CLIENT_ACCOUNTS AS
SELECT DISTINCT
account.name, alias,
CASE WHEN code = 'EV'
THEN cast(account.number AS VARCHAR)
ELSE cast(account.number AS VARCHAR) + substring(alias, 1, 2) END AS OFFICIAL_IDENTITY,
CASE WHEN order_permission IN ('A', 'S')
THEN 'ST' ELSE 'ENH' END
FROM (select * from merchantClientsUdf ('ca') union
select * from enhancedServiceClientsUdf ('ca')) as client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON account.type = accountType.account_type
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON dedicated.account_number = account.number)
ON (accountType.mapping_type = 0)
OR (accountType.mapping_type = 2 AND account.tag = client.account_tag)
OR (accountType.mapping_type = 1 AND dedicated.client_alias = client.alias)
31. ~O(N)/2 Codebase Size Per N Business Units!
Tables:
• merchantClientsUdf
• serviceClientsUdf
• CLIENT_ACCOUNTS
• merchantClientsUdf
• serviceClientsUdf
• US_CLIENT_ACCOUNTS
• enhancedServiceClientsUdf +
• EU_CLIENT_ACCOUNTS +
• CA_CLIENT_ACCOUNTS +
Tables:
= (Still) Lots of Technical Debt
40. @Entity
class Registry {...}
@Entity
class MerchantClient {...}
List<MerchantClient> merchantClients = em.createQuery(
"select distinct mc from Registry r, MerchantClient mc
where r.alias = mc.alias and r.market = :market and r.recordType = 'M'"
)
List<ServiceClient> serviceClients = em.createQuery(
"select distinct u from Registry r, ServiceClient sc, Partnership a
where r.alias = mc.alias and r.market = :market and r.recordType = 'S'"
)
@Entity
class ServiceClient {...}
@Entity
class Partnership {...}
41. @Entity
class Registry {...}
@Entity
class MerchantClient {...}
List<MerchantClient> merchantClients = em.createQuery(
"select distinct mc from Registry r, MerchantClient mc
where r.alias = mc.alias and r.market = :market and r.recordType = 'M'"
)
List<ServiceClient> serviceClients = em.createQuery(
"select distinct u from Registry r, ServiceClient sc, Partnership a
where r.alias = mc.alias and r.market = :market and r.recordType = 'S'"
)
@Entity
class ServiceClient {...}
@Entity
class Partnership {...}
How Can We Compose them???
merchantClients ++ serviceClients
43. @Entity
class AccountType {...}
@Entity
class Account {...}
@Entity
class DedicatedAccount {...}
List<Accounts> allAccounts() = em.createQuery(
"select distinct a from Account a, AccountType at
where a.accountType = at.type and "
)
List<Accounts> taggedAccounts(String tag) = em.createQuery(
"select distinct a from Account a, AccountType at
where a.accountType = at.type and a.tag = :tag"
)
List<Accounts> dedicatedAccounts(String alias) = em.createQuery(
"select distinct a from Account a, AccountType at, DedicatedAccount da
where a.accountType = at.type and da.account = a.name and da.alias = :alias"
)
44. List<Pair<Client, Account>> output = new ArrayList<>()
for (MerchantClient mc : merchantClients()) {
output.addAll(Tuple.of(mc, allAccounts()))
output.addAll(Tuple.of(taggedAccounts(mc.tag))
output.addAll(Tuple.of(dedicatedAccounts(mc.alias))
}
List<Pair<Client, Account>> output = new ArrayList<>()
for (ServiceClient sc : serviceClients()) {
output.addAll(Tuple.of(allAccounts()))
output.addAll(Tuple.of(taggedAccounts(sc.tag)))
output.addAll(Tuple.of(dedicatedAccounts(sc.alias)))
}
45. select merchantClients0_.alias as subsidiary1_0_ (MORE COLUMNS) from merchantClients
merchantClinets0_
where upper(merchantClients0_.alias) like ?
select merchantClients0_.alias as subsidiary1_0_ (MORE COLUMNS) from merchantClients
merchantClinets0_
where upper(merchantClients0_.alias) like ?
select merchantClients0_.alias as subsidiary1_0_ (MORE COLUMNS) from merchantClients
merchantClinets0_
where upper(merchantClients0_.alias) like ?
select merchantClients0_.alias as subsidiary1_0_ (MORE COLUMNS) from merchantClients
merchantClinets0_
where upper(merchantClients0_.alias) like ?
select merchantClients0_.alias as subsidiary1_0_ (MORE COLUMNS) from merchantClients
merchantClinets0_
where upper(merchantClients0_.alias) like ?
select merchantClients0_.alias as subsidiary1_0_ (MORE COLUMNS) from merchantClients
merchantClinets0_
where upper(merchantClients0_.alias) like ?
select merchantClients0_.alias as subsidiary1_0_ (MORE COLUMNS) from merchantClients
merchantClinets0_
where upper(merchantClients0_.alias) like ?
select merchantClients0_.alias as subsidiary1_0_ (MORE COLUMNS) from merchantClients
merchantClinets0_
where upper(merchantClients0_.alias) like ?
46. select merchantClients0_.alias as subsidiary1_0_ (MORE COLUMNS) from merchantClients
merchantClinets0_
where upper(merchantClients0_.alias) like ?
select merchantClients0_.alias as subsidiary1_0_ (MORE COLUMNS) from merchantClients
merchantClinets0_
where upper(merchantClients0_.alias) like ?
select merchantClients0_.alias as subsidiary1_0_ (MORE COLUMNS) from merchantClients
merchantClinets0_
where upper(merchantClients0_.alias) like ?
select merchantClients0_.alias as subsidiary1_0_ (MORE COLUMNS) from merchantClients
merchantClinets0_
where upper(merchantClients0_.alias) like ?
select merchantClients0_.alias as subsidiary1_0_ (MORE COLUMNS) from merchantClients
merchantClinets0_
where upper(merchantClients0_.alias) like ?
select merchantClients0_.alias as subsidiary1_0_ (MORE COLUMNS) from merchantClients
merchantClinets0_
where upper(merchantClients0_.alias) like ?
select merchantClients0_.alias as subsidiary1_0_ (MORE COLUMNS) from merchantClients
merchantClinets0_
where upper(merchantClients0_.alias) like ?
select merchantClients0_.alias as subsidiary1_0_ (MORE COLUMNS) from merchantClients
merchantClinets0_
where upper(merchantClients0_.alias) like ?
N+1
47. Criteria Queries?
List<MerchantClient> merchantClients() = em.createQuery(
select distinct mc from Registry r, MerchantClient mc
where r.alias = mc.alias and r.market = :market and r.recordType = 'M’)
Root<MerchantClient> fromMerchantClient = query.from(MerchantClient.class);
Join<MerchantClient, Registry> registry = fromUpdates.join("alias");
List<Predicate> conditions = new ArrayList();
conditions.add(builder.equal(registry.get("market"), market));
conditions.add(builder.equal(registry.get("recordType"), "M"));
TypedQuery<Update> typedQuery = em.createQuery(query
.select(fromMerchantClient)
.where(conditions.toArray(new Predicate[] {}))
.distinct(true)
);
48. I’ll Stick with HQL Thanks
List<MerchantClient> merchantClients() = em.createQuery(
select distinct mc from Registry r, MerchantClient mc
where r.alias = mc.alias and r.market = :market and r.recordType = 'M’)
Root<MerchantClient> fromMerchantClient = query.from(MerchantClient.class);
Join<MerchantClient, Registry> registry = fromUpdates.join("alias");
List<Predicate> conditions = new ArrayList();
conditions.add(builder.equal(registry.get("market"), market));
conditions.add(builder.equal(registry.get("recordType"), "M"));
TypedQuery<Update> typedQuery = em.createQuery(query
.select(fromMerchantClient)
.where(conditions.toArray(new Predicate[] {}))
.distinct(true)
);
49. ORM does not give us
define Client = Table[alias, code, perm, tag]
It just pretends it doesn’t exist!
* https://blog.codinghorror.com/object-relational-mapping-is-the-vietnam-of-computer-science/
51. SELECT DISTINCT
account.name, alias,
CASE (...) AS OFFICIAL_IDENTITY,
CASE (...)
FROM (
SELECT DISTINCT
mc.alias, mc.code, order_permission, mc.account_tag
FROM MERCHANT_CLIENTS mc
JOIN REGISTRY r ON ((alias) AND (otherConditions))
UNION ALL
SELECT DISTINCT
sc.alias, 'EV' AS code, part.order_permission, sc.account_tag
FROM SERVICE_CLIENTS sc
JOIN REGISTRY r ON ((alias) AND (otherConditions))
JOIN PARTNERSHIPS part ON (id <-> fk)) client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON (account_type)
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON (account_number))
ON (possibly anything...)
OR (possibly the account tag...)
OR (possibly the alias...)
52. SELECT DISTINCT
account.name, alias,
CASE (...) AS OFFICIAL_IDENTITY,
CASE (...)
FROM (
SELECT DISTINCT
mc.alias, mc.code, order_permission, mc.account_tag
FROM MERCHANT_CLIENTS mc
JOIN REGISTRY r ON ((alias) AND (otherConditions))
UNION ALL
SELECT DISTINCT
sc.alias, 'EV' AS code, part.order_permission, sc.account_tag
FROM SERVICE_CLIENTS sc
JOIN REGISTRY r ON ((alias) AND (otherConditions))
JOIN PARTNERSHIPS part ON (id <-> fk)) client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON (account_type)
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON (account_number))
ON (possibly anything...)
OR (possibly the account tag...)
OR (possibly the alias...)
𝝀( ) →(String, String, Char, String)
𝝀( ) →(Boolean)
53. SELECT DISTINCT
account.name, alias,
CASE (...) AS OFFICIAL_IDENTITY,
CASE (...)
FROM (
SELECT DISTINCT
mc.alias, mc.code, order_permission, mc.account_tag
FROM MERCHANT_CLIENTS mc
JOIN REGISTRY r ON ((alias) AND (otherConditions))
UNION ALL
SELECT DISTINCT
sc.alias, 'EV' AS code, part.order_permission, sc.account_tag
FROM SERVICE_CLIENTS sc
JOIN REGISTRY r ON ((alias) AND (otherConditions))
JOIN PARTNERSHIPS part ON (id <-> fk)) client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON (account_type)
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON (account_number))
ON (possibly anything...)
OR (possibly the account tag...)
OR (possibly the alias...)
𝝀( ) →(String, String, Char, String)
𝝀( ) →(Boolean)
𝝀( ) →(String, String, Char, String)
𝝀( ) →(Boolean)
𝝀( ) →(Boolean)
54. SELECT DISTINCT
account.name, alias,
CASE (...) AS OFFICIAL_IDENTITY,
CASE (...)
FROM (
SELECT DISTINCT
mc.alias, mc.code, order_permission, mc.account_tag
FROM MERCHANT_CLIENTS mc
JOIN REGISTRY r ON ((alias) AND (otherConditions))
UNION ALL
SELECT DISTINCT
sc.alias, 'EV' AS code, part.order_permission, sc.account_tag
FROM SERVICE_CLIENTS sc
JOIN REGISTRY r ON ((alias) AND (otherConditions))
JOIN PARTNERSHIPS part ON (id <-> fk)) client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON (account_type)
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON (account_number))
ON (possibly anything...)
OR (possibly the account tag...)
OR (possibly the alias...)
𝝀( ) →(String, String, Char, String)
𝝀( ) →(Boolean)
𝝀( ) →(String, String, Char, String)
𝝀( ) →(Boolean)
𝝀( ) →(Boolean)
𝝀( ) →(String, String, Char, String)
55. SELECT DISTINCT
account.name, alias,
CASE (...) AS OFFICIAL_IDENTITY,
CASE (...)
FROM (
SELECT DISTINCT
mc.alias, mc.code, order_permission, mc.account_tag
FROM MERCHANT_CLIENTS mc
JOIN REGISTRY r ON ((alias) AND (otherConditions))
UNION ALL
SELECT DISTINCT
sc.alias, 'EV' AS code, part.order_permission, sc.account_tag
FROM SERVICE_CLIENTS sc
JOIN REGISTRY r ON ((alias) AND (otherConditions))
JOIN PARTNERSHIPS part ON (id <-> fk)) client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON (account_type)
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON (account_number))
ON (possibly anything...)
OR (possibly the account tag...)
OR (possibly the alias...)
𝝀( ) →(String, String, Char, String)
𝝀( ) →(Boolean)
𝝀( ) →(String, String, Char, String)
𝝀( ) →(Boolean)
𝝀( ) →(Boolean)
𝝀( ) →(String, String, Char, String)
𝝀( ) →(Boolean)
𝝀( ) →(Boolean)
𝝀( ) →(Boolean)
𝝀( ) →(Boolean)
𝝀( ) →(String, String, Int, String)
𝝀( ) →(String, Int)
𝝀( ) →(Int, String)
𝝀( ) →(Boolean)
56. SELECT DISTINCT
account.name, alias,
CASE (...) AS OFFICIAL_IDENTITY,
CASE (...)
FROM (
SELECT DISTINCT
mc.alias, mc.code, order_permission, mc.account_tag
FROM MERCHANT_CLIENTS mc
JOIN REGISTRY r ON ((alias) AND (otherConditions))
UNION ALL
SELECT DISTINCT
sc.alias, 'EV' AS code, part.order_permission, sc.account_tag
FROM SERVICE_CLIENTS sc
JOIN REGISTRY r ON ((alias) AND (otherConditions))
JOIN PARTNERSHIPS part ON (id <-> fk)) client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON (account_type)
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON (account_number))
ON (possibly anything...)
OR (possibly the account tag...)
OR (possibly the alias...)
𝝀( ) →(String, String, Char, String)
𝝀( ) →(Boolean)
𝝀( ) →(String, String, Char, String)
𝝀( ) →(Boolean)
𝝀( ) →(Boolean)
𝝀( ) →(String, String, Char, String)
𝝀( ) →(Boolean)
𝝀( ) →(Boolean)
𝝀( ) →(Boolean)
𝝀( ) →(Boolean)
𝝀( ) →(String, String, String, String)
𝝀( ) →(String, String, Int, String)
𝝀( ) →(String, Int)
𝝀( ) →(Int, String)
𝝀( ) →(Boolean)
57. SELECT DISTINCT
account.name, alias,
CASE (...) AS OFFICIAL_IDENTITY,
CASE (...)
FROM (
SELECT DISTINCT
mc.alias, mc.code, order_permission, mc.account_tag
FROM MERCHANT_CLIENTS mc
JOIN REGISTRY r ON ((alias) AND (otherConditions))
UNION ALL
SELECT DISTINCT
sc.alias, 'EV' AS code, part.order_permission, sc.account_tag
FROM SERVICE_CLIENTS sc
JOIN REGISTRY r ON ((alias) AND (otherConditions))
JOIN PARTNERSHIPS part ON (id <-> fk)) client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON (account_type)
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON (account_number))
ON (possibly anything...)
OR (possibly the account tag...)
OR (possibly the alias...)
𝑴(String, String, Char, String)
𝝀( ) →(Boolean)
𝑴(String, String, Char, String)
𝝀( ) →(Boolean)
𝝀( ) →(Boolean)
𝑴 →(String, String, Char, String)
𝝀( ) →(Boolean)
𝝀( ) →(Boolean)
𝝀( ) →(Boolean)
𝝀( ) →(Boolean)
𝑴(String, String, String, String)
𝑴(String, String, Int, String)
𝑴(String, Int)
𝑴(Int, String)
58. SELECT DISTINCT
account.name, alias,
CASE (...) AS OFFICIAL_IDENTITY,
CASE (...)
FROM (
SELECT DISTINCT
mc.alias, mc.code, order_permission, mc.account_tag
FROM MERCHANT_CLIENTS mc
JOIN REGISTRY r ON ((alias) AND (otherConditions))
UNION ALL
SELECT DISTINCT
sc.alias, 'EV' AS code, part.order_permission, sc.account_tag
FROM SERVICE_CLIENTS sc
JOIN REGISTRY r ON ((alias) AND (otherConditions))
JOIN PARTNERSHIPS part ON (id <-> fk)) client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON (account_type)
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON (account_number))
ON (possibly anything...)
OR (possibly the account tag...)
OR (possibly the alias...)
𝑴(String, String, Char, String)
𝝀( ) →(Boolean)
𝑴(String, String, Char, String)
𝝀( ) →(Boolean)
𝝀( ) →(Boolean)
𝑴 →(String, String, Char, String)
𝝀( ) →(Boolean)
𝝀( ) →(Boolean)
𝝀( ) →(Boolean)
𝝀( ) →(Boolean)
𝑴(String, String, String, String)
𝑴(String, String, Int, String)
𝑴(String, Int)
𝑴(Int, String)
59. SELECT DISTINCT
account.name, alias,
CASE (...) AS OFFICIAL_IDENTITY,
CASE (...)
FROM (
SELECT DISTINCT
mc.alias, mc.code, order_permission, mc.account_tag
FROM MERCHANT_CLIENTS mc
JOIN REGISTRY r ON ((alias) AND (otherConditions))
UNION ALL
SELECT DISTINCT
sc.alias, 'EV' AS code, part.order_permission, sc.account_tag
FROM SERVICE_CLIENTS sc
JOIN REGISTRY r ON ((alias) AND (otherConditions))
JOIN PARTNERSHIPS part ON (id <-> fk)) client
INNER JOIN (
dbo.ACCOUNTS account
INNER JOIN ACCOUNT_TYPES accountType ON (account_type)
LEFT JOIN DEDICATED_ACCOUNTS dedicated ON (account_number))
ON (possibly anything...)
OR (possibly the account tag...)
OR (possibly the alias...)
𝑸𝒖𝒆𝒓𝒚[Client]
𝝀( ) →(Boolean)
𝑸𝒖𝒆𝒓𝒚 [Client]
𝝀( ) →(Boolean)
𝝀( ) →(Boolean)
𝑸𝒖𝒆𝒓𝒚 [Client]
𝝀( ) →(Boolean)
𝝀( ) →(Boolean)
𝝀( ) →(Boolean)
𝝀( ) →(Boolean)
𝑸𝒖𝒆𝒓𝒚[ClientAccountMapping]
𝑸𝒖𝒆𝒓𝒚[Account]
𝑸𝒖𝒆𝒓𝒚[AccountType]
𝑸𝒖𝒆𝒓𝒚[DedicatedAccount]
60. def merchantClientsUdf(market:String):Query[(String, String, Char, String)] = {
for {
mc <- mercantClients
r <- registry
if (r.alias === mc.alias && r.market === market
&& r.recordType === 'M')
} yield (mc.alias, mc.code, mc.orderPermission, mc.accountTag)
}
SELECT DISTINCT mc.alias, mc.code, order_permission, mc.account_tag
FROM MERCHANT_CLIENTS mc
JOIN REGISTRY r ON r.alias = mc.alias
WHERE r.market = 'us' AND r.record_type = 'M'
61. def serviceClientsUdf(market:String):Query[(String, String, Char, String)] = {
for {
sc <- serviceClients
r <- registry
if (r.alias === sc.alias && r.market === market
&& r.recordType === 'S')
part <- parnerships
if (part.id === sc.partnershipFk)
} yield (sc.alias, "EV".bind.?, part.orderPermission, sc.accountTag)
}
SELECT DISTINCT sc.alias, 'EV' AS code, part.order_permission, sc.account_tag
FROM SERVICE_CLIENTS sc
JOIN REGISTRY r ON r.alias = sc.alias AND r.record_type = 'S' AND r.market = 'us'
JOIN PARTNERSHIPS part ON part.id = sc.partnership_fk) client
62. def merchantClientsUdf(market:String):Query[(String, String, Char, String)] =
for {
mc <- mercantClients
r <- registry
if (r.alias === mc.alias && r.market === market && r.recordType === 'M')
} yield (mc.alias, mc.code, mc.orderPermission, mc.accountTag)
def serviceClientsUdf(market:String):Query[(String, String, Char, String)] =
for {
sc <- serviceClients
r <- registry
if (r.alias === sc.alias && r.market === market && r.recordType === 'S')
part <- parnerships
if (part.id === sc.partnershipFk)
} yield (sc.alias, "EV".bind.?, part.orderPermission, sc.accountTag)
def clients(market:String):Query[(String, String, Char, String)]
= merchantClientsUdf(market) ++ serviceClientsUdf(market)
63. def merchantClientsUdf(market:String):Query[Client] =
for {
mc <- mercantClients
r <- registry
if (r.alias === mc.alias && r.market === market && r.recordType === 'M')
} yield Client(mc.alias, mc.code, mc.orderPermission, mc.accountTag)
def serviceClientsUdf(market:String):Query[Client] =
for {
sc <- serviceClients
r <- registry
if (r.alias === sc.alias && r.market === market && r.recordType === 'S')
part <- parnerships
if (part.id === sc.partnershipFk)
} yield Client(sc.alias, "EV".bind.?, part.orderPermission, sc.accountTag)
def clients(market:String):Query[Client]
= merchantClientsUdf(market) ++ serviceClientsUdf(market)
65. def render(
query: Query[(Client, Accounts, AccountTypes, Option[DedicatedAccounts])]) = {
for {
(client, account, accountType, dedicatedAccount) <- query
} yield (
account.name,
Case.If(client.code === "EV")
.Then(account.number.asString)
.Else(account.number.asString.substring(1,2)),
Case.If(client.permission.min.inSet(Seq('A','S'))).Then("ST").Else("ENH")
)
}
SELECT DISTINCT
account.name, alias,
CASE WHEN code = 'EV'
THEN cast(account.number AS VARCHAR)
ELSE cast(account.number AS VARCHAR) + substring(alias, 1, 2) END AS OFFICIAL_IDENTITY,
CASE WHEN order_permission IN ('A', 'S')
THEN 'ST' ELSE 'ENH' END
67. def render(
query: Query[(Client, Accounts, AccountTypes, Option[DedicatedAccounts])]) = {
for {
(client, account, accountType, dedicatedAccount) <- query
} yield (
account.name,
Case.If(client.code === "EV")
.Then(account.number.asString)
.Else(account.number.asString.substring(1,2)),
Case.If(client.permission.min.inSet(Seq('A','S'))).Then("ST").Else("ENH")
)
}
SELECT DISTINCT
account.name, alias,
CASE WHEN code = 'EV'
THEN cast(account.number AS VARCHAR)
ELSE cast(account.number AS VARCHAR) + substring(alias, 1, 2) END AS OFFICIAL_IDENTITY,
CASE WHEN order_permission IN ('A', 'S')
THEN 'ST' ELSE 'ENH' END
68. New Requirements… Re-examined
1.New European Business Unit
with Client Codes from
the Partnership
2.New Canadian Business Unit
without Service Clients
69. Can We Do Better?
def serviceClientsUdf(market:String) =
for {
sc <- serviceClients
r <- registry if (r.alias === sc.alias && r.market === market && r.recordType === 'S')
part <- parnerships if (part.id === sc.partnershipFk)
} yield (Client(sc.alias, "EV".bind.?, part.orderPermission, sc.accountTag))
def serviceClientsUdfEnhanced(market:String) =
for {
sc <- serviceClients
r <- registry if (r.alias === sc.alias && r.market === market && r.recordType === 'S')
part <- parnerships if (part.id === sc.partnershipFk)
pc <- parnershipCodes if (part.id === pc.partnershipFk)
} yield (Client(sc.alias, pc.code, part.orderPermission, sc.accountTag))
70. Here is How
def serviceClientsDual(market:String, usePartnershipCodes:Boolean) = {
val clientsAndPartnerships = for {
sc <- serviceClients
r <- registry if (r.alias === sc.alias && r.market === market && r.recordType === 'S')
part <- parnerships if (part.id === sc.partnershipFk)
} yield (sc.alias, part.orderPermission, sc.accountTag, part.id)
usePartnershipCodes match {
case true => for {
(alias, permission, tag, partnershipId) <- clientsAndPartnerships
pc <- parnershipCodes if (partnershipId === pc.partnershipFk)
} yield Client(alias, pc.code, permission, tag)
case false => for {
(alias, permission, tag, partnershipId) <- clientsAndPartnerships
} yield Client(alias, "EV".bind.?, permission, tag)
}
}
75. def filterByRegistry[E, U](q:Query[E, U, Seq],
recordType:Char, market:String)(f:(E) => Rep[String])(
implicit shape: Shape[_ <: FlatShapeLevel, E, U, E]):Query[E, U, Seq] = {
for {
record <- q
r <- registry if (f(record) === r.alias && r.recordType === recordType
&& r.market === market)
} yield (record)
}
def merchantClientsUdf(market:String) = {
for {
mc <- filterByRegistry(mercantClients, 'M', market)(_.alias.oe)
} yield (Client(mc.alias, mc.code, mc.orderPermission, mc.accountTag))
}
def serviceClientsUdf(market:String) = {
for {
sc <- filterByRegistry(serviceClients, 'M', market)(_.alias.oe)
part <- parnerships if (part.id === sc.partnershipFk)
} yield (Client(sc.alias, "EV".bind.?, part.orderPermission, sc.accountTag))
}
Better!
76. Some Caveats
• Query[(String, String, Char, String)]
• Query[(Option[String], Option[String], Option[Char], Option[String])]
• Query[(Rep[Option[String]], Rep[Option[String]], Rep[Option[Char]], Rep[Option[String]])]
• Query[(Rep[Option[String]], Rep[Option[String]], Rep[Option[Char]], Rep[Option[String]]),
(Option[String], Option[String], Option[Char], Option[String]),
Seq]
• Query[Client], Client(String, String, Char, String)
• Query[Client], Client(Option[String], Option[String], Option[Char], Option[String])
• Query[Client, ClientRow, Seq]
Client(Rep[Option[String]], Rep[Option[String]], Rep[Option[Char]], Rep[Option[String]])
ClientRow(Option[String], Option[String], Option[Char], Option[String],
Seq)
Type Inferencing mostly does this for us
77. Some Caveats
• Query[(String, String, Char, String)]
• Query[(Option[String], Option[String], Option[Char], Option[String])]
• Query[(Rep[Option[String]], Rep[Option[String]], Rep[Option[Char]], Rep[Option[String]])]
• Query[(Rep[Option[String]], Rep[Option[String]], Rep[Option[Char]], Rep[Option[String]]),
(Option[String], Option[String], Option[Char], Option[String]),
Seq]
• Query[Client], Client(String, String, Char, String)
• Query[Client], Client(Option[String], Option[String], Option[Char], Option[String])
• Query[Client, ClientRow, Seq]
Client(Rep[Option[String]], Rep[Option[String]], Rep[Option[Char]], Rep[Option[String]])
ClientRow(Option[String], Option[String], Option[Char], Option[String],
Seq)
Type Inferencing mostly does this for us
78. Some Caveats
• Query[(String, String, Char, String)]
• Query[(Option[String], Option[String], Option[Char], Option[String])]
• Query[(Rep[Option[String]], Rep[Option[String]], Rep[Option[Char]], Rep[Option[String]])]
• Query[(Rep[Option[String]], Rep[Option[String]], Rep[Option[Char]], Rep[Option[String]]),
(Option[String], Option[String], Option[Char], Option[String]),
Seq]
• Query[Client], Client(String, String, Char, String)
• Query[Client], Client(Option[String], Option[String], Option[Char], Option[String])
• Query[Client, ClientRow, Seq]
Client(Rep[Option[String]], Rep[Option[String]], Rep[Option[Char]], Rep[Option[String]])
ClientRow(Option[String], Option[String], Option[Char], Option[String],
Seq)
Type Inferencing mostly does this for us
79. Some Caveats
• Query[(String, String, Char, String)]
• Query[(Option[String], Option[String], Option[Char], Option[String])]
• Query[(Rep[Option[String]], Rep[Option[String]], Rep[Option[Char]], Rep[Option[String]])]
• Query[(Rep[Option[String]], Rep[Option[String]], Rep[Option[Char]], Rep[Option[String]]),
(Option[String], Option[String], Option[Char], Option[String]),
Seq]
• Query[Client], Client(String, String, Char, String)
• Query[Client], Client(Option[String], Option[String], Option[Char], Option[String])
• Query[Client, ClientRow, Seq]
Client(Rep[Option[String]], Rep[Option[String]], Rep[Option[Char]], Rep[Option[String]])
ClientRow(Option[String], Option[String], Option[Char], Option[String],
Seq)
Type Inferencing mostly does this for us
80. Some Caveats
• Query[(String, String, Char, String)]
• Query[(Option[String], Option[String], Option[Char], Option[String])]
• Query[(Rep[Option[String]], Rep[Option[String]], Rep[Option[Char]], Rep[Option[String]])]
• Query[(Rep[Option[String]], Rep[Option[String]], Rep[Option[Char]], Rep[Option[String]]),
(Option[String], Option[String], Option[Char], Option[String]),
Seq]
• Query[Client], Client(String, String, Char, String)
• Query[Client], Client(Option[String], Option[String], Option[Char], Option[String])
• Query[Client, ClientRow, Seq]
Client(Rep[Option[String]], Rep[Option[String]], Rep[Option[Char]], Rep[Option[String]])
ClientRow(Option[String], Option[String], Option[Char], Option[String],
Seq)
Type Inferencing mostly does this for us
81. Some Caveats
• Query[(String, String, Char, String)]
• Query[(Option[String], Option[String], Option[Char], Option[String])]
• Query[(Rep[Option[String]], Rep[Option[String]], Rep[Option[Char]], Rep[Option[String]])]
• Query[(Rep[Option[String]], Rep[Option[String]], Rep[Option[Char]], Rep[Option[String]]),
(Option[String], Option[String], Option[Char], Option[String]),
Seq]
• Query[Client], Client(String, String, Char, String)
• Query[Client], Client(Option[String], Option[String], Option[Char], Option[String])
• Query[Client, ClientRow, Seq]
Client(Rep[Option[String]], Rep[Option[String]], Rep[Option[Char]], Rep[Option[String]])
ClientRow(Option[String], Option[String], Option[Char], Option[String],
Seq)
Type Inferencing mostly does this for us
82. Some Caveats
• Query[(String, String, Char, String)]
• Query[(Option[String], Option[String], Option[Char], Option[String])]
• Query[(Rep[Option[String]], Rep[Option[String]], Rep[Option[Char]], Rep[Option[String]])]
• Query[(Rep[Option[String]], Rep[Option[String]], Rep[Option[Char]], Rep[Option[String]]),
(Option[String], Option[String], Option[Char], Option[String]),
Seq]
• Query[Client], Client(String, String, Char, String)
• Query[Client], Client(Option[String], Option[String], Option[Char], Option[String])
• Query[Client, ClientRow, Seq]
Client(Rep[Option[String]], Rep[Option[String]], Rep[Option[Char]], Rep[Option[String]])
ClientRow(Option[String], Option[String], Option[Char], Option[String],
Seq)
Type Inferencing mostly does this for us
83. Conclusions
• Scala solves Old and New Problems in great ways!
• Check out Scala’s No-ORM Frameworks:
Slick - http://slick.lightbend.com/
Quill - http://getquill.io/
Editor's Notes
3
4
6
7
8
9
The RG device. YS
12
All G in K until it’s not
European service industry not necessarily EV
EU_Client_accounts almost all technical debt
EU_Client_accounts almost all technical debt
Whenever introduce new business unit, copy almost all code
EU_Client_accounts almost all technical debt, pretend inline udf exists that can return parameterized views
EU_Client_accounts almost all technical debt
EU_Client_accounts almost all technical debt
Whenever introduce new business unit, copy almost all code
Whenever introduce new business unit, copy almost all code
Whenever introduce new business unit, copy almost all code
Whenever introduce new business unit, copy almost all code
Whenever introduce new business unit, copy almost all code (i.e. codebase size increase after constant effects)
Whenever introduce new business unit, copy almost all code
Whenever introduce new business unit, copy almost all code
Lambdas in context, associative, have unit function (select of select –sto)
Lambdas in context, associative, have unit function (select of select –sto)
Lambdas in context, associative, have unit function (select of select –sto)
Lambdas in context, associative, have unit function (select of select –sto)
Lambdas in context, associative, have unit function (select of select –sto)
Lambdas in context, associative, have unit function (select of select –sto)
These-things-are-iso-morphic
Note, that union operator is possible because same type is returned
Note, that union operator is possible because same type is returned
European service industry not necessarily EV
Note, that union operator is possible because same type is returned