From XML to Database And Back Rob Ratcliff. Single Source Modeling The data model and persistence scheme described in one place – the XML Schema in this.

Slides:



Advertisements
Similar presentations
Introduction to ECO Malcolm Groves
Advertisements

1 XML Technologies You Need For Workflow Applications Roger L. Costello 2 January, 2009.
January 30, 2014 Copyright Jim Farley Beyond JDBC: Java Object- Relational Mappings Jim Farley e-Commerce Program Manager GE Research and Development
FpML Editor/Viewer Tutorial
1 Copyright © 2005, Oracle. All rights reserved. Introduction.
Paolo Atzeni - Pierluigi Del Nostro Università Roma Tre Dipartimento di Informatica e Automazione T-Araneus: Management of temporal data-intensive Web.
Arthur Brost Portals and Collaboration Practice Manager twentysix New York I BP402.
RIM Based Application Architecture
JAXB Java Architecture for XML Binding Andy Fanton Khalid AlBayat.
XML Parsing Using Java APIs AIP Independence project Fall 2010.
 Java  Python  Bigtable(Bt) is a distributed storage system for managing structured data that is designed to scale to a very large size.  Query Language.
Hibernate 1. Introduction ORM goal: Take advantage of the things SQL databases do well, without leaving the Java language of objects and classes. ORM.
March Ron McFadyen1 Using Rational Rose to create a database.
CS526 George E. Turner Spring Current Implementation  Four standard methods used to manipulate complex types in SOAP o Create o Read o Update o.
Hibernatification! Roadmap for Migrating from Plain Old SQL on JDBC to JPA on Hibernate Duke Banerjee Senior Developer, DrillingInfo.com.
Setting up PDP Set up your bank Set up the Disbursement Range Set up Customer Profile ACH Bank Payee ACH Accounts.
Apache Chemistry face-to-face meeting April 2010.
1 Lecture 22 George Koutsogiannakis Summer 2011 CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES.
Object-oriented tools for XML Schema JAXB (Java Architecture for XML Binding) –object connectivity for XML documents HyperJAXB –relational persistence.
Research Field: Extending the Schema-based Data Type Specifications for Web Services.
Developing Web Services Oracle SOA Suite 11g (JDeveloper)
Data on the Web Life Cycle Bernadette Farias Lóscio March, 2014.
WSDL Usage Experience with XML Schema 1.0 Jonathan Marsh Chair, WS Description WG.
Databases ? 2014, Fall Pusan National University Ki-Joune Li.
Curation Editor Flexible web based editor for non gene model data. FlyBase – Harvard University Frank Smutniak.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 1 Quick Tutorial – Part 2 Open Data Web Services for Oracle BPM August, 2013 Forms.
Large Taxonomies, Small Footprint Native XBRL Processing/Storage with ABRA/PDOM Thomas Klement, ABZ Informatik, XBRL Germany Konstantin Pussep, Fraunhofer.
SQL Schemas DATA SCIENCE BOOTCAMP. Schema The structure of the database (relationships between tables)
OVERVIEW ON HOW ENTITY FRAMEWORK CODE FIRST CAN EASE THE DEVELOPMENT PROCESS Entity Framework Code First 11/19/2013 Joe Walling Copyright Walling Info.
1 Committed to Shaping the Next Generation of IT Experts. Chapter 8 Exchanging Data Between Access and Other Applications Exploring Microsoft Office Access.
Steven Seida D2RQ Blog Integration Lab. Data to RDF Integration Approaches* 1 of 2 *Summarized from Ch 9 of Semantiic Web Programming, 2009, by Hebeler.
The Glance Project ATLAS Management January 2012.
1 © 1999 Microsoft Corp.. Microsoft Repository Phil Bernstein Microsoft Corp.
1 SCO MeInc. and EdgeClick – How does it work Martin Batz - SCO Senior System Engineer.
May 24, 2004IVOA Interop Meeting1 An AXIS-based Java SkyNode Ramon Williamson NCSA T HE US N ATIONAL V IRTUAL O BSERVATORY.
UPortal 3 RC2 PreviewJA-SIG Conference, Summer 2007 uPortal RC2 Preview Moving on Up Reviewing current work and future plans Standardizing the framework.
MySQL and GRID status Gabriele Carcassi 9 September 2002.
ModTransf A Simple Model to Model Transformation Engine Cédric Dumoulin.
Rupen/MoeserWIDAR Face-to-Face Meeting December 11-12, Science Data Model Michael P. Rupen & Rich Moeser.
Introduction to Software Components: the JavaBeans specs Babak Esfandiari.
XML Tools (Chapter 4 of XML Book). What tools are needed for a complete XML application? n Fundamental components n Web infrasructure n XML development.
The ATLAS DAQ System Online Configurations Database Service Challenge J. Almeida, M. Dobson, A. Kazarov, G. Lehmann-Miotto, J.E. Sloper, I. Soloviev and.
Login Screen. Fixed Deposit Customer Master List.
Simplifying the Code First Approach in the Entity Framework Dhananjay Kumar Infragistics Consultant Microsoft MVP
2 Copyright © 2004, Oracle. All rights reserved. ADF Development Process.
Wednesday, March 16, 2016 PESC + SOA A flexible and distributed SOA architecture to implement the PESC Standard Jam Hamidi
Design Overview. Generated Packages ► fUML.Library.* - generated ► fUML.Semantics.* - generated ► fUML.Syntax.* - generated ► fUML.Test.* - generated.
Schema Replication. Some Requirements Schema Service must be ‘globally’ consistent Schema Service must continue under duress.
Hibernate Online Training. Introduction to Hibernate Hibernate is a high-performance Object-Relational persistence and query service which takes care.
The Django Web Application Framework zhixiong.hong
Data generators by Jan Kincl. Data Generators - Jan Kincl2 Outline Introduction Introduction Main features Main features MySQL Data Generators MySQL Data.
4 Starting Tips to Keep Your Car in Top Condition
The Java API for XML Binding. The Need for Data Binding To support unmarshlling to convert XML data into Java objects. To support marshalling to convert.
The Holmes Platform and Applications
Java Web Services Orca Knowledge Center – Web Service key concepts.
NOSQL Data Models.
Dynamic Creative Optimization with Dynamic Creative Optimization with
Entity Framework: Code First
Data Modeling II XML Schema & JAXB Marc Dumontier May 4, 2004
Microsoft Office Illustrated

Phil Bernstein Microsoft Corp.
Enterprise & Infrastructure Team
2018, Fall Pusan National University Ki-Joune Li
READY?.
Multiplication Facts How fast are you?.
Data Access Layer (Con’t) (Overview)
JAXB 2.0 (Very short lecture) 4-Jun-19.
Final Version (after MS revision)
Presentation transcript:

From XML to Database And Back Rob Ratcliff

Single Source Modeling The data model and persistence scheme described in one place – the XML Schema in this case All JavaBean code related to the data model is auto-generated from this one source Database schema driven by same source

JAXB 2.x Version 2 is ready for Prime Time Fast and Clean (no claptrap code) Part of the Metro Project (JAXB, JAXWS, etc.)

Customizing Timestamps <xjc:javaType name="java.sql.Timestamp“ xmlType="TimestampStringType" adapter="TimeConverter"/>

Timestamp Customization XMLGregorian Calendar the default Need global custom type to change this (Why is MySQL going to get a decent timestamp!) Use datetime string for timestamps rather than longs

JAXB Customizations with JAXB 2.0 Commons Fluent design Return “this” from setter USAddress address = new USAddress().setName(name).setStreet(street).setCity(city).setState(state).setZip(new BigDecimal(zip)); toString() of all properties Contructors – default and all instance variables Code snippets – add functionality to generated classes

JAXB Support for XML ID/IDREF/IDREFS Advantages Referential Integrity Reference objects in XML document by ID to limit duplication of data Model cyclic graphs Disadvantages IDRef doesn’t specify type JAXB generates type Object for the referenced type

ID Example

Generated Class for Related class Apple String id; class AppleRef Object ref; class Orange String id; class OrangeRef Object ref; } class Box List fruits; }

Serialization Bidirectional Relationships can make serialization more complicated Must us ID/IDREF for XML Must use ValueTypes for CORBA rather than struct GWT and RMI support Bidirectional Relationships

HyperJaxB 3 Generates JPA and Hibernate Bindings from XML Schema Leverages all of JAXB’s capabilities

Getting Latest HyperJaxB3 svn checkout hj3 --username usernamehttps://hj3.dev.java.net/svn/hj3/trunk cvs -d login cvs -d checkout jaxb2-commons svn checkout plugin.dev.java.net/svn/maven-jaxb2-plugin/trunk maven-jaxb2-plugin --username usernamehttps://maven-jaxb2- plugin.dev.java.net/svn/maven-jaxb2-plugin/trunk mvn clean install each module Lots of stuff gets downloaded using Maven 

Running HyperJaXB 1-3 Put your schema files into the src/main/resources. Schemas should have the *.xsd extensions. Put your binding files into the same directory (src/main/resources). Binding files should have the *.xjb extensions. Put your sample XML (*.xml) into the src/test/samples directory. These samples will be used for the automatic roundtrip testing. Run mvn clean install.

Surrogate Keys VS. Natural Keys Surrogate Keys are computer generated unique keys Natural Keys come from the actual data that is naturally unique like zipcode or phone number

Best Options for Surrogate Keys Autoincrement Simple Data may not be importable GUID Nastier Key No round trips to database Data importable to other databases Other?

One to Many Relationships Join Table Child Has Foreign Key to Parent Two way relationships between parent and child Serialization issues

Equals and Hashcode Best Practices What is the best approach? Equals Primary Key? Apache commons equals builder All properties? Hashcode Apache commons hashcode builder?

Enumerations Use Strings rather than ordinals when persisting Less Brittle More Readable

Disadvantages JPA doesn’t support custom types (like Hibernate) Maven complicates things a bit Can’t leverage IDEs support for annotations Harder to add custom methods

Hibernate Custom Types

Reverse Engineering JPA Classes using NetBeans Demo

Generating a Simple CRUD Editor with NetBeans

Soap Communication with JAXWS Starting with XML guarantees that clean generation from Java class Faster and more robust than Apache Axis 2

JAXFront Generation of Forms from XML Schema