Spring Data
Upcoming SlideShare
Loading in...5
×
 

Spring Data

on

  • 1,030 views

 

Statistics

Views

Total Views
1,030
Views on SlideShare
1,030
Embed Views
0

Actions

Likes
0
Downloads
14
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Spring Data Spring Data Presentation Transcript

  • SPRING DATA THE LIGHTEST DATA ACCESS Jakub Kubrynski jkubrynski@gmail.com www.kubrynski.com
  • AGENDA ------------------------------------------- - basics - core - missing 5 percent - polyglot persistence - live coding - questions
  • WHAT IS SPRING DATA ------------------------------------------- - Umbrella project - Repositories done right - no boilerplate - CRUD on steroids - Declarative query methods - magic finders - Different technologies - single API
  • MAIN ELEMENTS ------------------------------------------- - CrudRepository - Save(..), exists(..), delete(..) - findOne(id), findAll(), findAll(..) - Count() - PagingAndSortingRepository
  • QUERY PATTERNS ------------------------------------------- - ^(find | read | get | count)*By - „By” acts as a delimiter between Subject and Predicate - findByFieldPropertyName
  • QUERY PATTERNS ------------------------------------------- public interface UserRepository extends... User findByLogin(String login); User findByFirstNameAndLastName (String fname, String lname);
  • QUERY BLOCKS ------------------------------------------- - GreaterThan / LessThan - Like - Between - In - IsNull / IsNotNull - And / Or
  • QUERY EXAMPLES ------------------------------------------- - findDistinctByFirstname - find*AllIgnoreCase, find*IgnoreCase - countByUser_lastname - findByLastnameOrderByFirstnameDesc
  • PAGING AND SORTING ------------------------------------------- - PageRequest - Contains page size and offset - Page - Total number of elements and pages - Sort - List of properties and directions
  • CRITERIA QUERY ------------------------------------------- - Specifications - JpaSpecificationExecutor + Predicate - We can avoid repository method explosion - Not so beatiful code
  • QUERY DSL ------------------------------------------- - AnnotationProcessor - querydsl-maven-plugin - QueryDslPredicateExecutor - query.from(qAddress) .where(qAddress.city.eq(„Warsaw”))
  • ADDITIONAL FEATURES ------------------------------------------- - Auditable entities - AuditorAware - Custom methods implementation - Custom repositories - RepositoryFactoryBeanSupport - Caching - REST exporter
  • POLYGLOT PERSISTENCE ------------------------------------------- - Relational / JPA - MongoDB, Redis, Couchbase - Solr, ElasticSearch - Hadoop, Hbase - Neo4j - GemFire
  • DEMO ------------------------------------------- time for coding
  • QUESTIONS -------------------------------------------
  • THANK YOU! :-)