SlideShare ist ein Scribd-Unternehmen logo
1 von 57
Code Generation with Oracle SDDM
Rob van den Berg
Code Generation with Oracle SDDM
Presenter information
VX Company IT Services b.v.
Email rvdberg@vxcompany.com
Twitter twitter.com/rob_vd_berg
Blog rvdbergblog.wordpress.com
Code Generation with Oracle SQL Developer Data Modeler
Introduction
SDDM Features supporting Code Generation
Code Generation
Agenda
Oracle SQL Developer Data Modeler
Introduction
Introduction
Oracle SQL Developer Data Modeler
Main Features - Introduction
Last version as of December 21, 2015 is 4.1.3.901
Free
Create, browse and edit relational models
Create, browse and edit multi-dimensional models
Forward and reverse engineering
Integrated source code control
Since July 1, 2009
Jeff Smith
Heli Helskyaho
– This presentation is about Application Code Generation
– Focussing on:
application code that implements Business Rules
– Code as complex as Entity Rules, Inter Entity Rules,
Change Event Rules, etc.
– In short: Code Beyond DDL
– Supporting: thick database design
(Toon Koppelaars, Bryn Llewellyn)
Oracle SQL Developer Data Modeler
Main Features – Introduction – Presentation subject
Oracle SQL Developer Data Modeler
Setting the stage
Features
supporting
Application
Code
Generation
Oracle SQL Developer Data Modeler
Features – “Oh, pretty pictures – I can do that !!”
– ER diagramming (Barker, Bachman or IE notation)
– Engineering to and from relational models
– Supertypes and subtypes, arcs
– Compare and merge with logical model in another design
Oracle SQL Developer Data Modeler
Features – Logical Models
Explore different kinds of modeling!
– Database design and generation tool
– Model driven approach
– Models:
– Logical
– Data types
– Dimensional
– Relational
– Data Flow diagrams
– Physical models
Oracle SQL Developer Data Modeler
Features
Oracle SQL Developer Data Modeler
Features – Other types of models
– Importing – from Designer, Erwin (XML) and more
– Version Support – team development (Subversion)
Oracle SQL Developer Data Modeler
Features – import your model, put it in your VCS
Bring some color to your designs!
Oracle SQL Developer Data Modeler
Features – Logical Models
Oracle SQL Developer Data Modeler
Features – Logical Models – Actual Footage ! Corporate Identity applied !
Barker (Oracle Designer)
Oracle SQL Developer Data Modeler
Features – Logical Models – Actual Footage ! Corporate Identity applied !
Bachman
Barker (Oracle Designer)
Information Engineering
– Subviews can be used to represent objects related to given
subject area
– Subviews can be nested(linked) thus allowing to build
network (or hierarchy) of related subviews – navigation
between linked subviews is supported
Oracle SQL Developer Data Modeler
Features - Subject Area Management
Oracle SQL Developer Data Modeler
Features - Subviews
Do you have naming standards ?
Get some!
– Name structure for elements in Logical and Relational
models
– Model level restrictions for – name length, possible
characters, used letter case
– Name translation during engineering between logical and
relational models
– Naming templates for table constraints and indexes
– Prefix management
Oracle SQL Developer Data Modeler
Features – Naming Standards
Oracle SQL Developer Data Modeler
Features – Naming Standards
Right mouse menu on design
properties->settings->naming standard
Oracle SQL Developer Data Modeler
Features – Naming Standards
– Supports validation rules;
– Easy exchange and synchronization of domains;
– Assignable to group of attributes and columns
in different models;
– Set “Default value” property at domain level. This can be
updated at column/attribute level.
Oracle SQL Developer Data Modeler
Features - Domains
Example:
domain = Country Codes
mandatory = True
values = (NL = The Netherlands, UK = Great Britain)
default = NL
Oracle SQL Developer Data Modeler
Features – Object Model
The design is stored as an object model
That can be manipulated programmatically
(which is NOT the subject of this presentation)
That can be queried programmatically
Which enables you to synthesize PL/SQL scripts based on the
design and each detailed property of the design
Oracle SQL Developer Data Modeler
Relational Model AFTER some tuning ….
Design import needs tuning? Transform !
– A few transformation scripts are pre-supplied
– Like adding default columns to a range of tables, or
– Like re-ordering columns after engineering from logical
– Add your own transformation scripts
Oracle SQL Developer Data Modeler
Features – Relational Models – Transformation scripts
Oracle SQL Developer Data Modeler
Features – Relational Model – Custom Transformation Scripts
Oracle SQL Developer Data Modeler
Features – Relational Model – Custom Transformation Scripts
Oracle SQL Developer Data Modeler
Oracle Nashorn
Oracle SQL Developer Data Modeler
Code Generation
Code
Generation
Transformations is your Code Generator
– Add a custom transformation
– Set it up to output modeled design to the file system
– Model design properties
– Dynamic properties
Oracle SQL Developer Data Modeler
How to generate code
// Code shown below is JavaScript //
application_name = model.getName();
appfolder = "Documents/Oracle/SDDM/sql/"+application_name+"/";
Oracle SQL Developer Data Modeler
Basic setup: generated code output folder
– C:Oracledatamodelerdatamodelerxmlmetadatadoc
– SQLDeveloperDataModelerScripting.docx
– Index.html
Oracle SQL Developer Data Modeler
Object Model definition
// Code shown below is JavaScript //
application_name = model.getName();
appfolder = "Documents/Oracle/SDDM/sql/"+application_name+"/";
Oracle SQL Developer Data Modeler
Basic setup: generated code output folder
// Code shown below is JavaScript //
runFile = new java.io.FileWriter(appfolder+appname+ "_CREATE_ALL.sql");
run = new java.io.PrintWriter(runFile);
run.println("-----------------------------------------------------------");
run.println("-- Version : 1.0.0");
run.println("-- Proces : Zorgsturing");
run.println("-- File-name : <app_alias>_CREATE_ALL.sql");
run.println("-- Creator : Rob van den Berg");
run.println("-- Creation date : "+ today);
run.println("-- Description : Master create script");
run.println("--");
Oracle SQL Developer Data Modeler
Basic setup: include a master script
Oracle SQL Developer Data Modeler
Created Master Script
// Code shown below is (PL/)SQL //
/*
Maintain table level constraints on ZST_VERTALINGEN_MPG
Change History
Who When What
---------------- ---------- --------
Rob van den Berg 12/05/2016 Creation
*/
-- define check constraints
alter table ZST_VERTALINGEN_MPG add constraint ZST_BR_VMP003_TPL check
(datum_einde is null or (datum_ingang <= datum_einde));
Oracle SQL Developer Data Modeler
Implementation of Tuple Rule
Generated script
ZST_VMP_CON.sql
Oracle SQL Developer Data Modeler
Definition of Tuple Rule
// Code shown below is JavaScript //
tables = model.getTableSet().toArray();
for (var t = 0; t<tables.length;t++){
// check constraints
tccs=table.getCheckConstraints().toArray();
for (var n=0;n<tccs.length;n++){
con.println
( "alter table “ + table_name + " add constraint “ +
table.getProperty(tccs[n].getName()) +
" check (" + tccs[n].getRule() + ");"
);
}
}
Oracle SQL Developer Data Modeler
Let’s generate customized script layout for check constraints
– typical Entity Rule “rows should not OVERLAP”
– Which typically presumes data definition of
– Column start_date NOT NULL
– Column end_date
– Some unique key including start_date
next to (optional) columns identifying the group
– Analist would phrase the rule like
“Thou shalt not enter any conflicting time period (for the
group of tuples identified by X, Y, Z”
Oracle SQL Developer Data Modeler
Definition of Entity Rule
Oracle SQL Developer Data Modeler
Definition of Entity Rule: specify the name identifying the rule
// Code shown below is (PL/)SQL //
/*
Maintain Table ZST_VERTALINGEN_MPG
…
…
--define unique key(s)
alter table ZST_VERTALINGEN_MPG add constraint zst_vmp_un1 unique
( bte_id
, mpg_code
, oms_extern
, datum_ingang
);
Oracle SQL Developer Data Modeler
Implementation of Entity Rule: unique key including start_date
Generated script
ZST_VMP_TAB.sql
START_DATE
OVERLAP can still occur
// Code shown below is (PL/)SQL //
create or replace trigger ZST_VMP_BIR
before insert on ZST_VERTALINGEN_MPG
for each row
begin
-- support insert change event
ZST_VMP_PCK.trg_bir
( p_id => :new.ID
…
, p_datum_ingang => :new.DATUM_INGANG
…
, p_datum_einde => :new.DATUM_EINDE
);
end;
/
Oracle SQL Developer Data Modeler
Implementation of Entity Rule
Generated script
ZST_VMP_TRG.sql
START_DATE
END_DATE
– Triggers generated within each trigger definition file:
– Before insert, update, delete statement
– After insert, update, delete statement
– Same for row triggers
Oracle SQL Developer Data Modeler
Implementation of Entity Rule
// Code shown below is (PL/)SQL //
procedure trg_ais
is
begin
check_br_vmp002_ent;
…
end trg_ais;
Oracle SQL Developer Data Modeler
Implementation of Entity Rule
Generated script
ZST_VMP_PCK.sql
// Code shown below is (PL/)SQL //
…
procedure check_br_vmp002_ent
is
-- Check if any time overlap check does not get violated
-- find record overlapping in time
cursor c_overlap
( v_not_id in ZST_VERTALINGEN_MPG.ID%TYPE
, v_bte_id in ZST_VERTALINGEN_MPG.BTE_ID%TYPE
, v_mpg_code in ZST_VERTALINGEN_MPG.MPG_CODE%TYPE
…
…
Oracle SQL Developer Data Modeler
Implementation of Entity Rule
Generated script
ZST_VMP_PCK.sql
Where did that get me
Generating code
– Is efficient
– Follows standards and guidelines
– Leads to maintainable code. No exceptions.
Oracle SQL Developer Data Modeler
Conclusions
Oracle SQL Developer Data Modeler
Agenda
Improvement
s
Oracle SQL Developer Data Modeler
Improvements – documentation
Oracle SQL Developer Data Modeler
Improvements – documentation
Questions?
Code Generation with Oracle SDDM
Presenter information
VX Company IT Services b.v.
Email rvdberg@vxcompany.com
Twitter twitter.com/rob_vd_berg
Blog rvdbergblog.wordpress.com

Weitere ähnliche Inhalte

Was ist angesagt?

Oracle GoldenGate 21c New Features and Best Practices
Oracle GoldenGate 21c New Features and Best PracticesOracle GoldenGate 21c New Features and Best Practices
Oracle GoldenGate 21c New Features and Best PracticesBobby Curtis
 
Data Vault ReConnect Speed Presenting AM Part Two
Data Vault ReConnect Speed Presenting AM Part TwoData Vault ReConnect Speed Presenting AM Part Two
Data Vault ReConnect Speed Presenting AM Part TwoHans Hultgren
 
Oracle SQL Developer Tips & Tricks
Oracle SQL Developer Tips & TricksOracle SQL Developer Tips & Tricks
Oracle SQL Developer Tips & TricksJeff Smith
 
Postgresql database administration volume 1
Postgresql database administration volume 1Postgresql database administration volume 1
Postgresql database administration volume 1Federico Campoli
 
Parallel Running Automation Solution with Docker, Jenkins and Zalenium
Parallel Running Automation Solution with Docker, Jenkins and ZaleniumParallel Running Automation Solution with Docker, Jenkins and Zalenium
Parallel Running Automation Solution with Docker, Jenkins and ZaleniumEvozon Test Lab
 
Web Intelligence - Tutorial1
Web Intelligence - Tutorial1Web Intelligence - Tutorial1
Web Intelligence - Tutorial1Obily W
 
Why oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19cWhy oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19cSatishbabu Gunukula
 
Top 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQLTop 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQLJim Mlodgenski
 
Oracle Exadata Exam Dump
Oracle Exadata Exam DumpOracle Exadata Exam Dump
Oracle Exadata Exam DumpPooja C
 
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdfOracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdfSrirakshaSrinivasan2
 
Distributed SQL Databases Deconstructed
Distributed SQL Databases DeconstructedDistributed SQL Databases Deconstructed
Distributed SQL Databases DeconstructedYugabyte
 
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Sandesh Rao
 
Maximum Availability Architecture - Best Practices for Oracle Database 19c
Maximum Availability Architecture - Best Practices for Oracle Database 19cMaximum Availability Architecture - Best Practices for Oracle Database 19c
Maximum Availability Architecture - Best Practices for Oracle Database 19cGlen Hawkins
 
The Modern Data Team for the Modern Data Stack: dbt and the Role of the Analy...
The Modern Data Team for the Modern Data Stack: dbt and the Role of the Analy...The Modern Data Team for the Modern Data Stack: dbt and the Role of the Analy...
The Modern Data Team for the Modern Data Stack: dbt and the Role of the Analy...Databricks
 
Oracle RAC Internals - The Cache Fusion Edition
Oracle RAC Internals - The Cache Fusion EditionOracle RAC Internals - The Cache Fusion Edition
Oracle RAC Internals - The Cache Fusion EditionMarkus Michalewicz
 
An Introduction To Oracle Database
An Introduction To Oracle DatabaseAn Introduction To Oracle Database
An Introduction To Oracle DatabaseMeysam Javadi
 

Was ist angesagt? (20)

Oracle Data Integrator
Oracle Data Integrator Oracle Data Integrator
Oracle Data Integrator
 
Oracle GoldenGate 21c New Features and Best Practices
Oracle GoldenGate 21c New Features and Best PracticesOracle GoldenGate 21c New Features and Best Practices
Oracle GoldenGate 21c New Features and Best Practices
 
Data Vault ReConnect Speed Presenting AM Part Two
Data Vault ReConnect Speed Presenting AM Part TwoData Vault ReConnect Speed Presenting AM Part Two
Data Vault ReConnect Speed Presenting AM Part Two
 
Slowly changing dimensions informatica
Slowly changing dimensions informatica Slowly changing dimensions informatica
Slowly changing dimensions informatica
 
Oracle SQL Developer Tips & Tricks
Oracle SQL Developer Tips & TricksOracle SQL Developer Tips & Tricks
Oracle SQL Developer Tips & Tricks
 
Postgresql database administration volume 1
Postgresql database administration volume 1Postgresql database administration volume 1
Postgresql database administration volume 1
 
Parallel Running Automation Solution with Docker, Jenkins and Zalenium
Parallel Running Automation Solution with Docker, Jenkins and ZaleniumParallel Running Automation Solution with Docker, Jenkins and Zalenium
Parallel Running Automation Solution with Docker, Jenkins and Zalenium
 
Web Intelligence - Tutorial1
Web Intelligence - Tutorial1Web Intelligence - Tutorial1
Web Intelligence - Tutorial1
 
Why oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19cWhy oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19c
 
Top 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQLTop 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQL
 
Oracle Exadata Exam Dump
Oracle Exadata Exam DumpOracle Exadata Exam Dump
Oracle Exadata Exam Dump
 
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdfOracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
 
Distributed SQL Databases Deconstructed
Distributed SQL Databases DeconstructedDistributed SQL Databases Deconstructed
Distributed SQL Databases Deconstructed
 
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
 
Maximum Availability Architecture - Best Practices for Oracle Database 19c
Maximum Availability Architecture - Best Practices for Oracle Database 19cMaximum Availability Architecture - Best Practices for Oracle Database 19c
Maximum Availability Architecture - Best Practices for Oracle Database 19c
 
Oracle DBA
Oracle DBAOracle DBA
Oracle DBA
 
The Modern Data Team for the Modern Data Stack: dbt and the Role of the Analy...
The Modern Data Team for the Modern Data Stack: dbt and the Role of the Analy...The Modern Data Team for the Modern Data Stack: dbt and the Role of the Analy...
The Modern Data Team for the Modern Data Stack: dbt and the Role of the Analy...
 
Oracle RAC Internals - The Cache Fusion Edition
Oracle RAC Internals - The Cache Fusion EditionOracle RAC Internals - The Cache Fusion Edition
Oracle RAC Internals - The Cache Fusion Edition
 
An Introduction To Oracle Database
An Introduction To Oracle DatabaseAn Introduction To Oracle Database
An Introduction To Oracle Database
 
PostgreSQL replication
PostgreSQL replicationPostgreSQL replication
PostgreSQL replication
 

Andere mochten auch

Oracle SQL Developer Data Modeler - Version Control Your Designs
Oracle SQL Developer Data Modeler - Version Control Your DesignsOracle SQL Developer Data Modeler - Version Control Your Designs
Oracle SQL Developer Data Modeler - Version Control Your DesignsJeff Smith
 
Dimensional modeling in oracle sql developer
Dimensional modeling in oracle sql developerDimensional modeling in oracle sql developer
Dimensional modeling in oracle sql developerJeff Smith
 
Oracle Database In-Memory
Oracle Database In-MemoryOracle Database In-Memory
Oracle Database In-MemoryTrivadis
 
Designing for Performance: Database Related Worst Practices
Designing for Performance: Database Related Worst PracticesDesigning for Performance: Database Related Worst Practices
Designing for Performance: Database Related Worst PracticesChristian Antognini
 
Database application and design
Database application and designDatabase application and design
Database application and designsieedah
 
Pimping SQL Developer and Data Modeler
Pimping SQL Developer and Data ModelerPimping SQL Developer and Data Modeler
Pimping SQL Developer and Data ModelerKris Rice
 
Heli data modeler wildcard2013
Heli data modeler wildcard2013Heli data modeler wildcard2013
Heli data modeler wildcard2013Andrejs Vorobjovs
 
Your favorite data modeling tool, your partner in crime for Data Warehouse Au...
Your favorite data modeling tool, your partner in crime for Data Warehouse Au...Your favorite data modeling tool, your partner in crime for Data Warehouse Au...
Your favorite data modeling tool, your partner in crime for Data Warehouse Au...FrederikN
 
My Favorite Oracle SQL Developer Data Modeler Features
My Favorite Oracle SQL Developer Data Modeler FeaturesMy Favorite Oracle SQL Developer Data Modeler Features
My Favorite Oracle SQL Developer Data Modeler FeaturesJeff Smith
 
Top Five Cool Features in Oracle SQL Developer Data Modeler
Top Five Cool Features in Oracle SQL Developer Data ModelerTop Five Cool Features in Oracle SQL Developer Data Modeler
Top Five Cool Features in Oracle SQL Developer Data ModelerKent Graziano
 
Oracle SQL Developer for SQL Server?
Oracle SQL Developer for SQL Server?Oracle SQL Developer for SQL Server?
Oracle SQL Developer for SQL Server?Jeff Smith
 
PL/SQL All the Things in Oracle SQL Developer
PL/SQL All the Things in Oracle SQL DeveloperPL/SQL All the Things in Oracle SQL Developer
PL/SQL All the Things in Oracle SQL DeveloperJeff Smith
 
Worst Practices in Data Warehouse Design
Worst Practices in Data Warehouse DesignWorst Practices in Data Warehouse Design
Worst Practices in Data Warehouse DesignKent Graziano
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Aaron Shilo
 
Standards for Production Allocation
Standards for Production AllocationStandards for Production Allocation
Standards for Production AllocationEnergySys Limited
 
Oracle SQL Developer for the DBA
Oracle SQL Developer for the DBAOracle SQL Developer for the DBA
Oracle SQL Developer for the DBAJeff Smith
 
Pennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & Tricks
Pennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & TricksPennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & Tricks
Pennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & TricksJeff Smith
 
Data Vault: Data Warehouse Design Goes Agile
Data Vault: Data Warehouse Design Goes AgileData Vault: Data Warehouse Design Goes Agile
Data Vault: Data Warehouse Design Goes AgileDaniel Upton
 

Andere mochten auch (20)

Oracle SQL Developer Data Modeler - Version Control Your Designs
Oracle SQL Developer Data Modeler - Version Control Your DesignsOracle SQL Developer Data Modeler - Version Control Your Designs
Oracle SQL Developer Data Modeler - Version Control Your Designs
 
Dimensional modeling in oracle sql developer
Dimensional modeling in oracle sql developerDimensional modeling in oracle sql developer
Dimensional modeling in oracle sql developer
 
Oracle Database In-Memory
Oracle Database In-MemoryOracle Database In-Memory
Oracle Database In-Memory
 
Designing for Performance: Database Related Worst Practices
Designing for Performance: Database Related Worst PracticesDesigning for Performance: Database Related Worst Practices
Designing for Performance: Database Related Worst Practices
 
Database application and design
Database application and designDatabase application and design
Database application and design
 
Pimping SQL Developer and Data Modeler
Pimping SQL Developer and Data ModelerPimping SQL Developer and Data Modeler
Pimping SQL Developer and Data Modeler
 
Heli data modeler wildcard2013
Heli data modeler wildcard2013Heli data modeler wildcard2013
Heli data modeler wildcard2013
 
Your favorite data modeling tool, your partner in crime for Data Warehouse Au...
Your favorite data modeling tool, your partner in crime for Data Warehouse Au...Your favorite data modeling tool, your partner in crime for Data Warehouse Au...
Your favorite data modeling tool, your partner in crime for Data Warehouse Au...
 
My Favorite Oracle SQL Developer Data Modeler Features
My Favorite Oracle SQL Developer Data Modeler FeaturesMy Favorite Oracle SQL Developer Data Modeler Features
My Favorite Oracle SQL Developer Data Modeler Features
 
Top Five Cool Features in Oracle SQL Developer Data Modeler
Top Five Cool Features in Oracle SQL Developer Data ModelerTop Five Cool Features in Oracle SQL Developer Data Modeler
Top Five Cool Features in Oracle SQL Developer Data Modeler
 
Data control
Data controlData control
Data control
 
Oracle SQL Developer for SQL Server?
Oracle SQL Developer for SQL Server?Oracle SQL Developer for SQL Server?
Oracle SQL Developer for SQL Server?
 
PL/SQL All the Things in Oracle SQL Developer
PL/SQL All the Things in Oracle SQL DeveloperPL/SQL All the Things in Oracle SQL Developer
PL/SQL All the Things in Oracle SQL Developer
 
Worst Practices in Data Warehouse Design
Worst Practices in Data Warehouse DesignWorst Practices in Data Warehouse Design
Worst Practices in Data Warehouse Design
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
 
Standards for Production Allocation
Standards for Production AllocationStandards for Production Allocation
Standards for Production Allocation
 
Oracle SQL Developer for the DBA
Oracle SQL Developer for the DBAOracle SQL Developer for the DBA
Oracle SQL Developer for the DBA
 
Pennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & Tricks
Pennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & TricksPennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & Tricks
Pennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & Tricks
 
Visual Data Vault
Visual Data VaultVisual Data Vault
Visual Data Vault
 
Data Vault: Data Warehouse Design Goes Agile
Data Vault: Data Warehouse Design Goes AgileData Vault: Data Warehouse Design Goes Agile
Data Vault: Data Warehouse Design Goes Agile
 

Ähnlich wie Generating Code with Oracle SQL Developer Data Modeler

Bring your code to explore the Azure Data Lake: Execute your .NET/Python/R co...
Bring your code to explore the Azure Data Lake: Execute your .NET/Python/R co...Bring your code to explore the Azure Data Lake: Execute your .NET/Python/R co...
Bring your code to explore the Azure Data Lake: Execute your .NET/Python/R co...Michael Rys
 
Rajnish singh(presentation on oracle )
Rajnish singh(presentation on  oracle )Rajnish singh(presentation on  oracle )
Rajnish singh(presentation on oracle )Rajput Rajnish
 
Rapid SQL Datasheet - The Intelligent IDE for SQL Development
Rapid SQL Datasheet - The Intelligent IDE for SQL DevelopmentRapid SQL Datasheet - The Intelligent IDE for SQL Development
Rapid SQL Datasheet - The Intelligent IDE for SQL DevelopmentEmbarcadero Technologies
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsTeamstudio
 
Hamburg Data Science Meetup - MLOps with a Feature Store
Hamburg Data Science Meetup - MLOps with a Feature StoreHamburg Data Science Meetup - MLOps with a Feature Store
Hamburg Data Science Meetup - MLOps with a Feature StoreMoritz Meister
 
BI 2008 Simple
BI 2008 SimpleBI 2008 Simple
BI 2008 Simplellangit
 
Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...
Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...
Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...Chester Chen
 
Be a database professional
Be a database professionalBe a database professional
Be a database professionalSayed Ahmed
 
Be a database professional
Be a database professionalBe a database professional
Be a database professionalSayed Ahmed
 
Data modeling star schema
Data modeling star schemaData modeling star schema
Data modeling star schemaSayed Ahmed
 
Continuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Continuous Integration and the Data Warehouse - PASS SQL Saturday SloveniaContinuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Continuous Integration and the Data Warehouse - PASS SQL Saturday SloveniaDr. John Tunnicliffe
 
Continuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Continuous Integration and the Data Warehouse - PASS SQL Saturday SloveniaContinuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Continuous Integration and the Data Warehouse - PASS SQL Saturday SloveniaDr. John Tunnicliffe
 
SQLCLR For DBAs and Developers
SQLCLR For DBAs and DevelopersSQLCLR For DBAs and Developers
SQLCLR For DBAs and Developerswebhostingguy
 
Dr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. HydeDr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. Hydewebhostingguy
 
Sql Injection and Entity Frameworks
Sql Injection and Entity FrameworksSql Injection and Entity Frameworks
Sql Injection and Entity FrameworksRich Helton
 

Ähnlich wie Generating Code with Oracle SQL Developer Data Modeler (20)

Day2
Day2Day2
Day2
 
Bring your code to explore the Azure Data Lake: Execute your .NET/Python/R co...
Bring your code to explore the Azure Data Lake: Execute your .NET/Python/R co...Bring your code to explore the Azure Data Lake: Execute your .NET/Python/R co...
Bring your code to explore the Azure Data Lake: Execute your .NET/Python/R co...
 
Rajnish singh(presentation on oracle )
Rajnish singh(presentation on  oracle )Rajnish singh(presentation on  oracle )
Rajnish singh(presentation on oracle )
 
Rapid SQL Datasheet - The Intelligent IDE for SQL Development
Rapid SQL Datasheet - The Intelligent IDE for SQL DevelopmentRapid SQL Datasheet - The Intelligent IDE for SQL Development
Rapid SQL Datasheet - The Intelligent IDE for SQL Development
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational Controls
 
Hamburg Data Science Meetup - MLOps with a Feature Store
Hamburg Data Science Meetup - MLOps with a Feature StoreHamburg Data Science Meetup - MLOps with a Feature Store
Hamburg Data Science Meetup - MLOps with a Feature Store
 
BI 2008 Simple
BI 2008 SimpleBI 2008 Simple
BI 2008 Simple
 
Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...
Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...
Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...
 
Tips and Tricks for Toad
Tips and Tricks for ToadTips and Tricks for Toad
Tips and Tricks for Toad
 
resume
resumeresume
resume
 
Be a database professional
Be a database professionalBe a database professional
Be a database professional
 
Be a database professional
Be a database professionalBe a database professional
Be a database professional
 
Data modeling star schema
Data modeling star schemaData modeling star schema
Data modeling star schema
 
Continuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Continuous Integration and the Data Warehouse - PASS SQL Saturday SloveniaContinuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Continuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
 
Continuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Continuous Integration and the Data Warehouse - PASS SQL Saturday SloveniaContinuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Continuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
 
SQLCLR For DBAs and Developers
SQLCLR For DBAs and DevelopersSQLCLR For DBAs and Developers
SQLCLR For DBAs and Developers
 
Dr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. HydeDr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. Hyde
 
Sql Injection and Entity Frameworks
Sql Injection and Entity FrameworksSql Injection and Entity Frameworks
Sql Injection and Entity Frameworks
 
Ow
OwOw
Ow
 
Plantilla oracle
Plantilla oraclePlantilla oracle
Plantilla oracle
 

Kürzlich hochgeladen

CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxolyaivanovalion
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...SUHANI PANDEY
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightDelhi Call girls
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxMohammedJunaid861692
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxfirstjob4
 
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Delhi Call girls
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...amitlee9823
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...amitlee9823
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Researchmichael115558
 
Zuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxZuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxolyaivanovalion
 

Kürzlich hochgeladen (20)

CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptx
 
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Zuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxZuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptx
 

Generating Code with Oracle SQL Developer Data Modeler

  • 1.
  • 2. Code Generation with Oracle SDDM Rob van den Berg
  • 3. Code Generation with Oracle SDDM Presenter information VX Company IT Services b.v. Email rvdberg@vxcompany.com Twitter twitter.com/rob_vd_berg Blog rvdbergblog.wordpress.com
  • 4. Code Generation with Oracle SQL Developer Data Modeler Introduction SDDM Features supporting Code Generation Code Generation Agenda
  • 5. Oracle SQL Developer Data Modeler Introduction Introduction
  • 6. Oracle SQL Developer Data Modeler Main Features - Introduction Last version as of December 21, 2015 is 4.1.3.901 Free Create, browse and edit relational models Create, browse and edit multi-dimensional models Forward and reverse engineering Integrated source code control Since July 1, 2009 Jeff Smith Heli Helskyaho
  • 7. – This presentation is about Application Code Generation – Focussing on: application code that implements Business Rules – Code as complex as Entity Rules, Inter Entity Rules, Change Event Rules, etc. – In short: Code Beyond DDL – Supporting: thick database design (Toon Koppelaars, Bryn Llewellyn) Oracle SQL Developer Data Modeler Main Features – Introduction – Presentation subject
  • 8. Oracle SQL Developer Data Modeler Setting the stage Features supporting Application Code Generation
  • 9. Oracle SQL Developer Data Modeler Features – “Oh, pretty pictures – I can do that !!”
  • 10. – ER diagramming (Barker, Bachman or IE notation) – Engineering to and from relational models – Supertypes and subtypes, arcs – Compare and merge with logical model in another design Oracle SQL Developer Data Modeler Features – Logical Models
  • 11. Explore different kinds of modeling!
  • 12. – Database design and generation tool – Model driven approach – Models: – Logical – Data types – Dimensional – Relational – Data Flow diagrams – Physical models Oracle SQL Developer Data Modeler Features
  • 13. Oracle SQL Developer Data Modeler Features – Other types of models
  • 14. – Importing – from Designer, Erwin (XML) and more – Version Support – team development (Subversion) Oracle SQL Developer Data Modeler Features – import your model, put it in your VCS
  • 15. Bring some color to your designs!
  • 16. Oracle SQL Developer Data Modeler Features – Logical Models
  • 17. Oracle SQL Developer Data Modeler Features – Logical Models – Actual Footage ! Corporate Identity applied ! Barker (Oracle Designer)
  • 18. Oracle SQL Developer Data Modeler Features – Logical Models – Actual Footage ! Corporate Identity applied ! Bachman Barker (Oracle Designer) Information Engineering
  • 19. – Subviews can be used to represent objects related to given subject area – Subviews can be nested(linked) thus allowing to build network (or hierarchy) of related subviews – navigation between linked subviews is supported Oracle SQL Developer Data Modeler Features - Subject Area Management
  • 20. Oracle SQL Developer Data Modeler Features - Subviews
  • 21. Do you have naming standards ? Get some!
  • 22. – Name structure for elements in Logical and Relational models – Model level restrictions for – name length, possible characters, used letter case – Name translation during engineering between logical and relational models – Naming templates for table constraints and indexes – Prefix management Oracle SQL Developer Data Modeler Features – Naming Standards
  • 23. Oracle SQL Developer Data Modeler Features – Naming Standards Right mouse menu on design properties->settings->naming standard
  • 24. Oracle SQL Developer Data Modeler Features – Naming Standards
  • 25. – Supports validation rules; – Easy exchange and synchronization of domains; – Assignable to group of attributes and columns in different models; – Set “Default value” property at domain level. This can be updated at column/attribute level. Oracle SQL Developer Data Modeler Features - Domains Example: domain = Country Codes mandatory = True values = (NL = The Netherlands, UK = Great Britain) default = NL
  • 26. Oracle SQL Developer Data Modeler Features – Object Model The design is stored as an object model That can be manipulated programmatically (which is NOT the subject of this presentation) That can be queried programmatically Which enables you to synthesize PL/SQL scripts based on the design and each detailed property of the design
  • 27. Oracle SQL Developer Data Modeler Relational Model AFTER some tuning ….
  • 28. Design import needs tuning? Transform !
  • 29. – A few transformation scripts are pre-supplied – Like adding default columns to a range of tables, or – Like re-ordering columns after engineering from logical – Add your own transformation scripts Oracle SQL Developer Data Modeler Features – Relational Models – Transformation scripts
  • 30. Oracle SQL Developer Data Modeler Features – Relational Model – Custom Transformation Scripts
  • 31. Oracle SQL Developer Data Modeler Features – Relational Model – Custom Transformation Scripts
  • 32. Oracle SQL Developer Data Modeler Oracle Nashorn
  • 33. Oracle SQL Developer Data Modeler Code Generation Code Generation
  • 34. Transformations is your Code Generator
  • 35. – Add a custom transformation – Set it up to output modeled design to the file system – Model design properties – Dynamic properties Oracle SQL Developer Data Modeler How to generate code
  • 36. // Code shown below is JavaScript // application_name = model.getName(); appfolder = "Documents/Oracle/SDDM/sql/"+application_name+"/"; Oracle SQL Developer Data Modeler Basic setup: generated code output folder
  • 37. – C:Oracledatamodelerdatamodelerxmlmetadatadoc – SQLDeveloperDataModelerScripting.docx – Index.html Oracle SQL Developer Data Modeler Object Model definition
  • 38. // Code shown below is JavaScript // application_name = model.getName(); appfolder = "Documents/Oracle/SDDM/sql/"+application_name+"/"; Oracle SQL Developer Data Modeler Basic setup: generated code output folder
  • 39. // Code shown below is JavaScript // runFile = new java.io.FileWriter(appfolder+appname+ "_CREATE_ALL.sql"); run = new java.io.PrintWriter(runFile); run.println("-----------------------------------------------------------"); run.println("-- Version : 1.0.0"); run.println("-- Proces : Zorgsturing"); run.println("-- File-name : <app_alias>_CREATE_ALL.sql"); run.println("-- Creator : Rob van den Berg"); run.println("-- Creation date : "+ today); run.println("-- Description : Master create script"); run.println("--"); Oracle SQL Developer Data Modeler Basic setup: include a master script
  • 40. Oracle SQL Developer Data Modeler Created Master Script
  • 41. // Code shown below is (PL/)SQL // /* Maintain table level constraints on ZST_VERTALINGEN_MPG Change History Who When What ---------------- ---------- -------- Rob van den Berg 12/05/2016 Creation */ -- define check constraints alter table ZST_VERTALINGEN_MPG add constraint ZST_BR_VMP003_TPL check (datum_einde is null or (datum_ingang <= datum_einde)); Oracle SQL Developer Data Modeler Implementation of Tuple Rule Generated script ZST_VMP_CON.sql
  • 42. Oracle SQL Developer Data Modeler Definition of Tuple Rule
  • 43. // Code shown below is JavaScript // tables = model.getTableSet().toArray(); for (var t = 0; t<tables.length;t++){ // check constraints tccs=table.getCheckConstraints().toArray(); for (var n=0;n<tccs.length;n++){ con.println ( "alter table “ + table_name + " add constraint “ + table.getProperty(tccs[n].getName()) + " check (" + tccs[n].getRule() + ");" ); } } Oracle SQL Developer Data Modeler Let’s generate customized script layout for check constraints
  • 44. – typical Entity Rule “rows should not OVERLAP” – Which typically presumes data definition of – Column start_date NOT NULL – Column end_date – Some unique key including start_date next to (optional) columns identifying the group – Analist would phrase the rule like “Thou shalt not enter any conflicting time period (for the group of tuples identified by X, Y, Z” Oracle SQL Developer Data Modeler Definition of Entity Rule
  • 45. Oracle SQL Developer Data Modeler Definition of Entity Rule: specify the name identifying the rule
  • 46. // Code shown below is (PL/)SQL // /* Maintain Table ZST_VERTALINGEN_MPG … … --define unique key(s) alter table ZST_VERTALINGEN_MPG add constraint zst_vmp_un1 unique ( bte_id , mpg_code , oms_extern , datum_ingang ); Oracle SQL Developer Data Modeler Implementation of Entity Rule: unique key including start_date Generated script ZST_VMP_TAB.sql START_DATE OVERLAP can still occur
  • 47. // Code shown below is (PL/)SQL // create or replace trigger ZST_VMP_BIR before insert on ZST_VERTALINGEN_MPG for each row begin -- support insert change event ZST_VMP_PCK.trg_bir ( p_id => :new.ID … , p_datum_ingang => :new.DATUM_INGANG … , p_datum_einde => :new.DATUM_EINDE ); end; / Oracle SQL Developer Data Modeler Implementation of Entity Rule Generated script ZST_VMP_TRG.sql START_DATE END_DATE
  • 48. – Triggers generated within each trigger definition file: – Before insert, update, delete statement – After insert, update, delete statement – Same for row triggers Oracle SQL Developer Data Modeler Implementation of Entity Rule
  • 49. // Code shown below is (PL/)SQL // procedure trg_ais is begin check_br_vmp002_ent; … end trg_ais; Oracle SQL Developer Data Modeler Implementation of Entity Rule Generated script ZST_VMP_PCK.sql
  • 50. // Code shown below is (PL/)SQL // … procedure check_br_vmp002_ent is -- Check if any time overlap check does not get violated -- find record overlapping in time cursor c_overlap ( v_not_id in ZST_VERTALINGEN_MPG.ID%TYPE , v_bte_id in ZST_VERTALINGEN_MPG.BTE_ID%TYPE , v_mpg_code in ZST_VERTALINGEN_MPG.MPG_CODE%TYPE … … Oracle SQL Developer Data Modeler Implementation of Entity Rule Generated script ZST_VMP_PCK.sql
  • 51. Where did that get me
  • 52. Generating code – Is efficient – Follows standards and guidelines – Leads to maintainable code. No exceptions. Oracle SQL Developer Data Modeler Conclusions
  • 53. Oracle SQL Developer Data Modeler Agenda Improvement s
  • 54. Oracle SQL Developer Data Modeler Improvements – documentation
  • 55. Oracle SQL Developer Data Modeler Improvements – documentation
  • 57. Code Generation with Oracle SDDM Presenter information VX Company IT Services b.v. Email rvdberg@vxcompany.com Twitter twitter.com/rob_vd_berg Blog rvdbergblog.wordpress.com

Hinweis der Redaktion

  1. Welcome to my session, It’s the last session of the day, so Hello everybody welcome, welcome welcome, I will introduce myself and get going with the presentation. How are you guys doing today, everybody allright ?
  2. Let’s see. My session will cover Oracle PL/SQL code generation with Oracle SQL Developer Data Modeler in the role of the generator of this code. My name is Rob van den Berg.
  3. I have been working for VX Company for the last 18 years. VX Company is a Oracle Platinum Partner. I have worked on major Oracle implementations as a contractor, in particular for Oracle, whom I’ve been hired to for fourteen years. I have an email address, a twitter handle and a blog site.
  4. These are the main sections my presentation can be subdivided into. I’ll start with an introduction, like I’m doing right now, I’ll cover the features I think are crucial to allow Oracle SQL Data Modeler to generate custom application code, and finally I will get to the core of my presentation showing real examples of generated code and how it was setup that way. No let me tell you right off the bat, this is not a theoretical lecture of how things might be setup. I’ve used Oracle SQL Developer Data Modeler in a production situation to generate complex business rules. And I will show you how.
  5. First I will finish my introduction of this code generation theme I would like to discuss.
  6. The tool itself has evolved in the last years from a both licensed and not so comprehensive designer tool to a free tool with extensive options. It’s in existence sinds 2009, current version is 4.1.3. Both Jeff Smith and Heli Helskyaho have greatly contributed in explaining how this tool can be used. Heli wrote a book published by Oracle Press on the subject. THAT Jeff Smith owns a lively blog site on both SQL Developer and SQL Developer Data Modeler.
  7. My presentation zooms in on just one feature of the tool, the code generation feature. I focus on application code that implements Business Rules, which can be as complex as Entity Rules, Inter Entity Rules, Change Event Rules etcetera. In short: that’s application code which cannot be generated out of the box straight from your design. It goes beyond DDL. Now I have to pause here for a second. Why would we generate application code ? I can explain why I wanted to. It’s because I’m a do-everything-in-the-database guy, just like Toon Koppelaar and Bryn Llewellyn want us to. I’ve you have been able to attend to Bryn’s session, like he did today and many times before, you exactly know why. However, implementing business rules in the database can get repetitive by nature. If you code by hand, you might end up coding the same pattern over and over again. I know because it happened to me. And it happened to me AFTER I had been accustomed to generate application code from within Designer and Headstart for more than ten years. Suddenly I had been hired by a company that couldn’t offer me these tools. So I had to come up with my own replacement for Designer and Headstart. Maybe that situation sounds familiar to anyone?
  8. So which features did I stumble upon which got me going ?
  9. The CORE feature of SQL Developer Data Modeler of course is to visually model a database design. Click and drag entities or tables, draw lines between them representing relationships between them. Rearrange entities, create subviews.
  10. Entity Relationship Modeling with notations which can at the design level be changed according to the visualization method you are used to, like Barker, the notation you know from good old Oracle Designer, or Bachman or Information Engineering. Having designed a logical model, you can generate a relational model from it, or reverse engineer the other way around. Common design features like Supertypes, subtypes and arcs are fully supported. You can open multiple designs in parallel and compare differences between them.
  11. I would certainly encourage you to explore different kinds of modeling which you might not expect SQL Developer Data Modeler would also support.
  12. SQL Developer Data Modeler is a database design and generation tool, supporting a model driven application development approach, not limited to just entity-relationship and data modeling, but also other types of models
  13. This picture presents one example where you can find other types of models in the menu
  14. But wait! We might already HAVE modeled a database design, be it a full entity relationship model, a data model or just an existing data dictionary. Well we can import these models. We can import a data dictionary. For that matter, we can also export these models too. Should you be working in a team, SQL Developer Data Modeler supports putting the desig in version control, using Subversion.
  15. This is a bit of a side step. This is NOT a strictly indispensable feature enabling code generation that we WILL discuss very soon now, but it’s too cool not to mention now
  16. Here we have it: your first logical model build from scratch. But the colours…they more or less precisely lack any corporate identity. Which might or might not be an issue. But if it is… Open Design Properties – Settings – Diagram – Format. As you can see any distinguishable object can be set up to appear in any colour or font as you like. Doubleclick the colour and you see how. The other tab pages present other ways to specify a colour, including entering exact colour numbers.
  17. The result is the apply corporate identity, in this case VX Corporate identiy.
  18. Work with a notation method you are most used to.
  19. In case your design holds really a lot of tables, like more than fifteen, you will be interested in using a method to group tables together visually, which can be done using subviews. Subviews can be given a name.
  20. Like a “Core” subview, showing the “Core” tables and their relations of the application
  21. When you work in a team, you often have to adhere to the company’s coding standards. Make sure coding standards are in place.
  22. Oracle SQL Developer Data Modeler supports configuring and applying these standards. You can setup a naming structure for entities and for tables. You can restrict the length of names for your design. You can restrict which characters are used in a entity name to separate different parts of the name. You can set up how constraints and indexes are named as a derivative of the names or aliases of the tables.
  23. So just open design properties – settings – naming standard and find many options providing you the option to specify standards.
  24. Example of a standard about not using a forbidden word
  25. If you have just imported a design, it might just not be perfect already. Like this one. This one has been resized an aligned on a grid, using the graphical interface, but the content has also been polished quite a bit. I needed tuning.
  26. That’s where Optimus Prime kicks in. Autobot.
  27. Your design might have table name not all upper case. You can apply a pre-supplied transformation script to modify all tables names to upper case.
  28. Or rearrange the order of columns. If you want to start working with transformation scripts, reading and interpreting the pre-supplied scripts, which aren’t very complex, is a good start. As you, a transformation script has a name, and an engine it is supposed to run in. This can be ruby or Mozilla rhino for older versions of Java. If you already have Java 8, the engine is called Nashorn.
  29. You can find more information on Oracle Nashorn on OTN.
  30. Finally we get to the core.
  31. If you need to find out which methods are available, here’s where you can find more information. After installation, you will find the information in the datamodeler/xmlmetadata folder. The html file index.html gives access to all the information which you can browse through.
  32. Create the script, give it a name, and run it by clicking ‘ apply’.
  33. Create a runFile FileWriter object, a run PrintWriter object and call the println method.
  34. Just for the sake of this example, let us generate code to maintain a check constraint. Of course, there’s still no need to do it this way, check constraints are just a maintanable part of a design and code can already be generated for it out of the box, but suppose we need separate files for check constraints belonging to each table with commentary header like shown.
  35. Pass the println method to a previously defined con PrintWriter object for all check constraints of all tables.
  36. Wil je een grafiek toevoegen.