A Persistence Journey: From XML to the Database and Back Again

885 views

Published on

Many people know about JPA, the standard for reading and writing Java objects to the database, and some people know about how JAXB can be used to map objects to XML, but did you know that you can use them together on the same object?.
The Eclipse Persistence Services Project is the next generation of persistence and the first open source project to offer a full suite of persistence technologies where all of the dominant persistence standards are implemented and accessible from a single source. The project, nicknamed EclipseLink, was created from the TopLink code base and is part of the Eclipse ecosystem of runtime technologies. It incorporates a set of individual runtime components, including JPA, JAXB, and SDO, that can be used separately or together in any runtime environment, including Java SE, Java EE, Spring and Tomcat.
In this tutorial we will show how you can use standard APIs, like JPA and JAXB, to bridge the object, relational and XML worlds and take a single object from a web service, to the database, and back to another service. Attendees will learn how to use the standard technologies it implements, and how these technologies can be used separately or together to meet advanced and diverse application requirements.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
885
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

A Persistence Journey: From XML to the Database and Back Again

  1. 1. !! ! "# $ %&% %
  2. 2. ( $ ) $ *( $ ) $ +"*( $ ) $ + ,%* ! ! - ) . . $ . ! . $" . ) $ / $ 01
  3. 3. # $$ % $ ! - ) .+2- 2 +2- % . , 2 &% 3 . & !!! . &3!% ! 4! , /,51 !6 / % 1 , /, 1 ! 2 / 1 ! 7 $ ) /! 71 8 9
  4. 4. & (%! 7 $ ) /! 71!6 / % 1 , / , 1& # ) *& +, . /, 1, .%2&- /% 2 & - 1 /! 2 1& # ): ) ;! - )< ! = . , ! 2 + = . +2- ! %3 = % 3 . ! 3">%= 3 > % ! !&%= : , % $
  5. 5. ) #&/ ) &&/ #, / # / -#0 - # - # &.# & # ) *& + , ,& ?@, & @ !! %! > % % 3" A%B-!(
  6. 6. & - . +2- $ $ )$ +2- . ! +2- 3% . +2- +" $ $ .& - $, . +%3 3 . 9@3 2 C +%3 +%3 2 C 2 C2 / +2-1% + % + 3 2 % +8 2 > )
  7. 7. & # -> * 2 AD . A +2- 3 5 A +%3 " +%3> $ * % A% ) $ 3 A $ ) +2- 3& #% > %, +2-2 $ A ) >%3 E +2-& $ % A%
  8. 8. & # $ ! " # "& &.# !! / 12 +2- ! 2 + & / &18 > ) = 2B% B % +2- 7
  9. 9. , ! " ! ,# 1 # 3 # # % " ! % ! " # # & " !# 2 # 4 % $ $ #-% %7 8 $ # ) 3 " " " & />%3-*1 ! "
  10. 10. 5 # 261 & +2- " > % % +, ?@? D +" +2- " - +" %! F / G1 " % >% % /25 21 +2- E ) /+ 1 >% & ?@ />%& 1 5 # 261 7 +" 2 AD " 2&2! ) , +2- +2- & 3 & /, 1 2 D 2&2!7 7 "! = , = 2 @ D @ H / 1 H/ 1
  11. 11. 5(# 161 & ,!%5 % !! $ ),!%5 $ D,&(55 + ,% ?@ / %, #??1 + ,% ?@? !! F 5(# &8 ! "# $ % & %
  12. 12. # % 9 , & 5(# & ( 5 ( )+2- /+%31 ) +2-+2- 8% + : ;A< ;IJ< & ;@<K : L M
  13. 13. 7 0 ! , +2-& % 6 ,3"2%& " " > % N ,!%5 % >%3-% & &% 5 . A +2- A + K 4;9<L M K L9KA L K L= K L =% A /1 9 = KA L A KA L KA L
  14. 14. % > $ +2- 2 +2- : . 3 2 > % $ $ $ + >% +2- >%3- + ,% +2- " . . : . +2- *:- # ;+D +2-& + 02 ) 3 2 A % +A% +!; <,
  15. 15. - # &8 ! @,! " # !# # $ #% " # $ &" " " " $ % % ( ) % % " $ &" % % $ % * % ! " " $ % + $! " ) # > ) 3 2$ $ * 5 O . % ) $ 2 $ +2- 6 7 %, #? / ?A 1 : $ @ @# +" ,& 3P F
  16. 16. 9 , <1 7 % % $ +2- % . # : $ $ +2- % 5 ) ! 6 , . % 6 +" +2- $ / $ 1> $ /$ 1& $ E %! 2 ) $ )&
  17. 17. " & / 01 & $ K L = , - . & . / , - / , - / ,0 - & / ,10 - / ,1 - / ,1 - / ,1 - . / # &8 ! / $ 1 $,0 - $ " 2 3 3 - " / ,0 - $ - . 11 45 6 . 78 / - ,0 39 31/ - $,0 3 11 - 45 6: 78 / ,0 - 3 ; 1/ ,10 - $ / ,10 - $ / <,10 - $ /
  18. 18. 08= $+2- % 0 4= 8 , " /, ) . 7- )
  19. 19. 9 , <2 7 9 % $ . +2- % # : $ $ +2- % 2 ) ! . ) 6 , % 6 > +" @ $ & +2- +2- $ $
  20. 20. > 3 ) $ I J = ) 868 6 6 ) ) / ) @. 1 A +2- N / ( & 1 7 +2- > 5> #5> . ? $9 @ " $9 ! & 5> 9 $ ! ; ! 5> # " $) 9 $ +" $9 ! ; +" $9 9 ! 5> # $) 9 $ $9 ! ; $9 9 !!
  21. 21. 0 ## " $ 4= 8 , /% $ $ / ) 1
  22. 22. . +" , 8 7 = 8 6 % ! - ) . @ ) ) =0 ; A $ 0 B9> & ( 5 , 8 , 8 & = 2 D +"& " $ E $ = / 1 2
  23. 23. . ? , 8- =& 48 & 4C8 4D8 $ & 4E8 $ 9& 4F8 $ G" %B9> & 0 & B9> &- E =B9> & 0 & B9> & 3 H 9D D +" D,- 3 2 % + @22 3 HI " " I "& & " "
  24. 24. D 2 +" % + 3 222J " " J " " " @ +
  25. 25. 9 , <3 7 % $ . +2- % / >%3-1 # 2 * # + 2 ) $ 6 , . > , $ 2 +2- +2- 2 ! +2- & +2-
  26. 26. .$ " ! , ) $ . +2- @ D . +2-@ $ . . @ &) ( . A @ +2- @ % - = . 2= = & = K 4;9<L K L9KA L K LQ 3 . KA K L9KA L L KA L = =
  27. 27. &8 2 +2- 2 ) +2- . @ 2 $ ! : 5 . +2- @ 5 . +2- @& % $ ! - ) . +2- % $ % A +2- ,2 !&% .
  28. 28. ) .* + &2 5 - ) ( 3 ! " ! " #@ F$ !! R% $ !! F& $ !! $ ! " ; <;" &< %! % &
  29. 29. $ & : A: 6 : 6 ) / $ 13 A / @ @ 12 % E 6 / 1# & 2 ! /M! 1 2 / ) 15# # 5 $ ! ; " !!
  30. 30. . & / 1 ) D 6 ?@ % N A 5 @ N AD 5 P 5 + $ #@ ! N P 5# # GK , 8 : ; ! ) $ @ @ ! 2 ! 2 &
  31. 31. & & ) 2 2 ! 2 / 1 5 - &! 2 &= 5& ( 53 & 5, $ 5% E $ & 5! P6 ) " 5 6 * ) " 5 6 * ( ) " 5 %B- 6 53 & 57 E
  32. 32. *+ & $ % $ ! & & @ + $ & & @ J $! $ *+ ) *+ /1 $ N /1 3 $ ; ; & 2 $ & J $ & @ J $ ;!
  33. 33. *+ % 2 & I & & J $ $! B 3 / A 1 B & : %B- /$ 6 1 : E % A . " ) % )
  34. 34. - BB ! 2B &=$ 2 N 6$ + $ N 6 I N ) N J N G N L N 6 "J N 6 $ BD B /1 B- 6D , - /1 % , /1 D /1B A ) $2 6
  35. 35. B 2 9 + $ % J $ M 3 H N % N 3 H J EDD $ 2 ! , B- @7 ; <$ B- $ =; $ <C BD : B /1 6B +2-B ; < 6 6
  36. 36. C B5% M 3+ & H@ ( 3 + " - H 2 + & & J $ % M 3+ & H G 3 H@ $ $ 2! , D- = >( 2 . 2 2 +2- / 1 - S . / @ @M 5 2 1 S3" / @ @ M5 1 +2- % A
  37. 37. # 3 A M"2 $ E @D . $ M3# 5# & ,9#%- &( 5 . C & ,(& .% "-%- + $ 5& :& # .; O $ 52 $ "!
  38. 38. ( M2 5 M 5 S M 5 2 M2 5 2 SD $ $ M ) M 5 % - 5# + # & 5 . 6 6 6 ,9#%D. 5J . ? ,9#%- &( & ! . 666 !
  39. 39. - % 5# & ,9#%- &( 5 . 666 5? . J : ; + ,+ /!5# # & + . 666 ,9#%D. 5 5J . ? &! ) #& : : .; ! 2 7 , ! 2 & % ! 2 : $ ! 2 :
  40. 40. & % , ! 2 & ! 2 5 ! 5 & /1 /1 )/1 /1 D / 3" 1 ! 2 6 ,! ( % % , ! 2 - & ) ! 2 7! ( % % "# $ + " ! 2
  41. 41. &8 G G $ ; + $48 $ # J $ G # J $ 3+ GI H # J $ # J $ $ . $ 11 G @ ( @ 11 @ $ . !!& 7 ?@, & @ % A:> ) $ 3"
  42. 42. & , ! - . A = /!21 5 %E => ) % > ) 7 : ! A& 5 5 & / 1 2 = 2% ,2& ," ,2& && 9 2 = %Q: %Q: C:!> &:8 -&3 5! : :!, ! 2 ! 2 7D > ) % . %% , , # , , , #* + ( . ,-( ..-
  43. 43. , $ ,3 = . 8 % E , " 6 / 1 / $ 1- ) $ $ 0 3 ) ) .3 )! - ) ) =: 5 %
  44. 44. BB ! 2 = B- ! B 3 = %B- % E - ) D , E = " , A% 3 %& &8! +2-2 M" 2 M" M $ M 7 M M5 M . 5M E 6M: % B &: A D5 A &: D5
  45. 45. & &8 - ) : M - ) 6 3" - =3 %B- 3 > E ) 3 % E ! 3 =M E M, % E &85#5& " +? .OP#9K@ . +#% O? B#&.O&L9%Q#+5? 2 R $ &L9%Q# O&?2IJ%+5& ; 3 H@ ; & J & ; # 5 ; ; + $ 5? . J 3 H 5G ; ? ; 2 ,G" % / " 5& ; 3 H ; J <!
  46. 46. $: %B- / 1 $% T7 / 1! 3 5 8 3A -% $3 3" 3" 8 3 ( ( 6 % . +2-3" @# ) $%! 3 5 3 % A 3" $ 2+ 2" - % 7 % % >-% > % "
  47. 47. $ %( = E E !7 $- 3"& &3! 5% . > 5 />5 1 , @+2- >> 6 6 >
  48. 48. , . !! % $ ) ( - =
  49. 49. # . 2 2 ,3"2% +2-- ,3"2% . $ @ ,2 . 6 !! . +2- $ +2 .+2- +2- > % 5> #5# & 5> 9 3 H 5 $ <! ; <! < 5> # 3 $) H 5? . ? 5B & 9 O 9 $ $9 <! ; $9 9 <!!
  50. 50. # . 2 2 2 +2- % !!$ +2 $ +%3 . +2 > % > % 3 +2-
  51. 51. #+2- 3 3 =3 3! ,52!:5 4? -( &3 2 : !, ? =! - = = & # 7 % ! = . , ! 2 + = . +2- ! %3 = % 3 . ! 3">%= 3 > % ! !&%= : , 2 > ,& @?
  52. 52. 0 . ) )D 5 ) 7 6 % $ & $ 0 . $ . =$$$@ @ A ): $ = @ @ )>)= $)@ @ A @ A! - ) 5 " = )@ @

×