Your SlideShare is downloading. ×
Generic DAOs With Hades
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Generic DAOs With Hades

3,588
views

Published on

Slides from the talk on the open source project Hades - http://hades.synyx.org

Slides from the talk on the open source project Hades - http://hades.synyx.org

Published in: Technology, Education

0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,588
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
60
Comments
0
Likes
4
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. HadesOliver Gierke - Synyx GmbH & Co. KG „Simple things should be simple, complex things should be possible.“ Alan Kay
  • 2. www.devoxx.com Speaker ■ Oliver Gierke - gierke@synyx.de ■ Software Architect @ Synyx GmbH & Co. KG ■ JavaEE, Spring (beyond the obvious) ■ Financial industry, automotive ■ Hades project lead ■ olivergierke
  • 3. Java Persistence API
  • 4. www.devoxx.com GenericDao GenericJpaDao CRUD
  • 5. www.devoxx.com Demo I
  • 6. Query methods
  • 7. www.devoxx.com 1. Create interface 2. Declare methods 3. Tune queries
  • 8. www.devoxx.com GenericDao UserDao GenericJpaDao CRUD Query methods GenericDaoFactory / GenericDaoFactoryBean
  • 9. Derive User findByUsername( String username);
  • 10. Named Query @NamedQuery (name=“User.findByLastname“ query=“...“) List<User> findByLastname(...);
  • 11. @Query @Query(„from User u where ...“) List<User> findByLastname(...);
  • 12. www.devoxx.com Demo II
  • 13. Pagination Sorting
  • 14. @Query(„from User u where u.lastname = ?“) Page<User> findByLastname( String lastname, Pageable pageable);
  • 15. @Param(„name“)
  • 16. @Query(„from User u where u.lastname = :lastname or u.firstname = :firstname“) List<User> findByLastOrFirstname( @Param(„lastname“) String lname, @Param(„firstname“) String fname)
  • 17. @Modifying
  • 18. @Modifying @Query(„...“) int undefaultAllBut(Role role);
  • 19. Spring integration
  • 20. <hades:dao-config base-package=“foo.**.dao“ />
  • 21. Spring IDE Plugin
  • 22. Custom DAO code
  • 23. www.devoxx.com GenericDao UserDao UserDaoCustom GenericJpaDao UserDaoImpl CRUD Query methods Custom implementation GenericDaoFactory / GenericDaoFactoryBean
  • 24. www.devoxx.com Demo III
  • 25. Additional support
  • 26. Auditing
  • 27. Created? Modified? Who? When?
  • 28. Domain base classes
  • 29. Questions? WTF
  • 30. www.devoxx.com Meta stuff ■ Current version: 1.0 (stable 1.1-snapshot) ■ Apache license 2.0 ■ http://hades.synyx.org