Java Experience @JavaExpShare
Java developer who just wants to share some experience with community Russia, Moscow Joined August 2019-
Tweets110
-
Followers126
-
Following31
-
Likes6K
Pageable object could specify sorting. Sort object have two properties: - Direction for ascending or descending sorting - Fields to make sorting on #Java #100DaysOfCode #spring
The difference between Pageable responses: - Page returns page + pages count. To achieve this, additional query count will be executed. So we have small overhead - Slice returns page and knows whether next slice is available - List returns just current page #Java #100DaysOfCode
To effective work with Pageable we extends JpaRepository from #spring data JPA. Now we can just pass Pageable as method parameter inside repository and spring will do pagination and sorting for us. Pageable can return: - Page - Slice - List #100DaysOfCode #Java
Now we can annotate parameter inside resource and #Jersey will construct and inject Pageable for us. Then we can simple pass it into spring data repository that supports pagination and that's all! #Java #100DaysOfCode #spring
Finally we can construct our Pageable from @queryparam with help of ValueParamProvider and InjectionManager. I use @defaultvalue to provide default value for property if none specified. By default there is no sorting and display first page with 15 items. #Java #100DaysOfCode
To make #Jersey know about our custom provider we should register it inside main configuration file with help of AbstractBinder. Here we specify binding and scope. From now on all the injections inside custom provider will start to work. #Java #100DaysOfCode
Here the interesting part. We pass the injection manager into function implementation class, so we can inject our @queryparam. Then we can construct Pageable class from them. #Java #100DaysOfCode
Next we implement ValueParamProvider interface from #Jersey. It has 2 abstract methods: - getValueProvider() here we check for method parameter and return Function that construct that parameter -getPriority() is priority for provider execution #Java #100DaysOfCode
First of all we need to declare our custom annotation. Here we specify: - @Target is where we can use this annotation. On methods, on classes etc - @retention is retention policy. Indicates whether annotation should be stored inside class and available to JVM #Java #100DaysOfCode
To make such pagination and sorting for request we will specify 3 @queryparam. Then construct Pageable. It is ok, but not perfect Imagine we can write single method parameter as Pageable and Jersey will inject @queryparam inside. Let's find out how to do that #Java #100DaysOfCode
For pagination i will pass 2 parameters: - page is page number - size is page size For sorting: - sort is sorting field + order The query string will be like: /rest/vacancies?page=0&size=5&sort=id+desc where page, size and sort our @queryparam values. #Java #Jersey #100DaysOfCode
Hello everyone! Hope all of you had good holidays and ready for learning :) Let's write something cool. As you might know good REST API should support pagination and sorting With #Jersey we can implement this with @queryparam and i will show how #100DaysOfCode #NewYear2020 #Java
For @queryparam in #swagger we can specify array of parameters contains: - in: PathParam.QUERY - name - description - schema with type, example and default value #Java #100DaysOfCode
Well documented API is very important. In #Java we have javadoc to document our code. It is basically block of comments. Common things we can specify: - description what is going on - @param method parameters - @return what is returned #100DaysOfCode
You can describe request body parameters with #swagger. No surprise annotation name is @RequestBody. Inside you can provide: - description - is body required or not - content with @schema with implementation or @ExampleObject with raw example. #Java #100DaysOfCode
To describe different parameters for resource, such as path parameters, query parameters, #swagger provides @parameter annotation: - in: where this parameter should be: header, query, cookie, path - name - description - required - examples #Java #100DaysOfCode
Inside @Operation in #swagger we can specify: - summary: basic description for endpoint - tags: to group up requests by tags - request body - responses: available server responses with codes and meanings - security: security requirements #Java #100DaysOfCode
Let's discuss basic annotations in #swagger. Once again, swagger allows us to describe our API, so others can easily use it. This technic also famous as OpenAPI. In REST application we have resources. To make it visible to swagger, annotate it with @Operation #Java #100DaysOfCode
Inside DTO class you may have circular references. As example: Vacancy contains VacancyDetails, same time Details have reference to Vacancy. To deserialize such classes with #Jackson use: - @JsonManagedReference on parent ref - @JsonBackReference on child ref #100DaysOfCode #Java
If we want to validate fields inside complex object, we should use @valid annotation. This launches cascade validation. If we have another complex object inside this object, annotate it with @valid as well to cascade further. #100DaysOfCode #Java

Nace @Nace635
49 Followers 1K Following
AviDer @Avidgars
26 Followers 645 Following
Garin @Garin103
4 Followers 42 Following Pacific War enthusiast, vtubers/vocaloids enjoyer, and probably something else I forgot to mention. 仕方がない
sandrah1500 @iradukun3
2 Followers 92 Following
Dmitry Voilokov @wdzfxs
0 Followers 2 Following
Hēmanth @hemanth_gp
34 Followers 268 Following
Hemant Rajput @Hem_16
15 Followers 221 Following
Ishmael @Ishmael02024054
233 Followers 519 Following God loving and a patriot at heart,unapologetically so
Nicolás C. Ibarra @HikingCarrot7
25 Followers 1K Following
Sriram S @iamsrirams_
23 Followers 485 Following
yuriko @yuriko23406231
17 Followers 110 Following Full stack developper based in Tky. Pottarian🪄🧙♀️🐈⬛
Danny Adams @DoableDanny
3K Followers 1K Following Full Stack Web Developer Writer at @freeCodeCamp LinkedIn: https://t.co/wqEzG7abm0 Available for hire
Collins Cheruiyot @cherucole
10K Followers 3K Following iOS Developer. Building apps w/ Swift, SwiftUI & Javascript. Get my apps here 👉🏻 https://t.co/WCegL2mwoF
Doctor Kernel @doctorkernel1
56 Followers 565 Following Coding is art.. synchronizing with universe frequency..
theKelvincode @kelvKaizen
262 Followers 817 Following Solving problems with ones and zeroes(JAVA, PostgreSQL,Springboot) ✨
Emiliano Rivas @EmilianoRivasMX
55 Followers 310 Following 🇲🇽💻 Informatics Engineering | 🧑🏽💻 Full Stack Dev | 🏴☠️ Cybersecurity | 🧠 AI
Alian Software @aliansoftware
526 Followers 1K Following Official Twitter Account of Alian Software LLC. Contact us for Web Design & Development, eCommerce website & App Development.
Yosuke Uto @UtoYosuke
109 Followers 581 Following Product manager of task management application (Web App) #app #taskmanagement #reword #developer
Debojyoti Chakraborty... @sparkindebo
399 Followers 875 Following Artificial intelligence ll Machine learning || AGI - Tweeting daily youtube:https://t.co/xcMhcMTJdv contributor @activeloopai
Alex Lleida @kachundena
2K Followers 4K Following Happy IT Project Manager. #PMP, #tech, #digital, #projectmanagement, #softwaredevelopment, #coding, #librarian
Rösëmäry Mwändäm... @Samajhibhaa
290 Followers 885 Following Software Engineer | Python | Machine Learning | Data Science 😍...... 💻 🇹🇿
Paul Muchiri @TigoniPaul
67 Followers 215 Following
Manisha @mbhalesha
903 Followers 3K Following #TrainingConsulting #LearningandDevelopment #EdTech #DataAnalysis | alumna @UHouston @IOE_London | Lifelong Learner
Ariel F. Rodriguez T @_Aanttrax_
64 Followers 250 Following Drummer I Time Traveler I Engineer in Oil, Gas and Energies I Always learning
HONEY MASSEY @honeymassey2018
563 Followers 3K Following Aspiring #FrontEndDeveloper .#html #css #Bootstrap #android studio😇😇 I Love #JESUS 💝💝
Fit Coders World 😷 @fitcoderness
1K Followers 5K Following 🔁 {Eat-Move-Code-Move-Sleep}| The community of sharing for Coders: fitness tips, #jobOpps, quotes, good vibes & ++. Welcome 🙋♀️🙋♂️↗️ 🔽. ||By @amedajibola
Soyalinne 🌈 @AlinneBarrozo
74 Followers 251 Following Brazilian girl. ❤ #Feminist, #Buddhist, #engineer #tdah #alinnecriandorotina #desafio21dias
Osta @Ostatomi
223 Followers 912 Following Software Engineer @Classflick | Physicist | Internet Entrepreneur | Advocate for better Nigeria and Human Right #EndImpunity
Kevinton ⚡️ @kev1nt0n
393 Followers 1K Following FlutterFlow Expert + Customer Success Engineer @flutterflow
Ernest @OwojoriErnest
1K Followers 2K Following I use statistical methods to understand human behaviors on digital products, social media and online communities.
Hameedah Mohammed @mydar_lifestyle
443 Followers 466 Following Software developer || Fashion Enthusiast || Ibeauty TV Host || Face Model || Muslimah || Foodie
javaknowledgehub @javaknowledgeh1
241 Followers 934 Following account for informational website https://t.co/36aj8uj6lE
Chief @Chiefov1
278 Followers 1K Following Network Engineer | Penetration Tester | Software Developer | Gamer | Biker. https://t.co/CGVAP8589s https://t.co/Rlb2MMEacs
金昌 @TheJB63657115
40 Followers 632 Following 02的真人真照.可接视频 自己一个人.短暂出来兼职.空余时间自己聊自己过去.哥哥看见了可以私信我.👉https://t.co/CCWdzNIu51
Yozu @yozu_uk
718 Followers 1K Following Solving complex issues with forward-thinking, user-focused solutions - and just a little bit of flair. Drop us a message - [email protected]
KoaS @_KoaS_
14 Followers 135 Following Image yourself where you want to be. Computers are useless. They can only give you answers. - Pablo Picasso 🐨 T E C H N O - R A N G E R 🐨
Jason Hill @JasonHill161
465 Followers 350 Following Fledgling Full Stack Software Developer, Electrician/Foreman, Former Marine, Husband to THE most amazing woman, hopeful father.
Issacx 🇸🇬 @detrailblazer
328 Followers 491 Following I am no expert, learning new things is fun & hard at the same time.
Mike Minton @mikemintonuk
1K Followers 3K Following Software Engineer/Developer, JavaScript, Visual Basic .Net, Python, SQL, PHP, MS SQL, MongoDB, HTML, CSS, Flutter, Dart, Xamarin https://t.co/lsDPLwJTJy
contactnavarra @navarra54865041
27 Followers 378 Following Sebastian de la Vega python Software Development for GUI, Raspberry, Backend, Tools, social media advertisement. for questions please [email protected]
Андрей Голу... @DreadiSbaCk
86K Followers 59 Following Бывший профессиональный игрок в Dota 2. Стример. Спортсмен-любитель.
Scrum.org @Scrumdotorg
48K Followers 434 Following https://t.co/rqCo3pNsO1, the Home of Scrum, was founded by Scrum co-creator Ken Schwaber as a mission-based organization to help people and teams solve complex problems.
Trisha Gee @trisha_gee
36K Followers 2K Following Engineer, author, keynote speaker, developer champion, catalyst. Developer Advocate @ Gradle for Developer Productivity Engineering. She/her.
Ionut Balosin @ionutbalosin
5K Followers 170 Following 👨💻 Principal IT Architect • 🎓 Technical Trainer • 🏆 Java Champion • ♠️ Oracle ACE Associate • 🔑 Security Champion • 🎤 Speaker • ✍️ Blogger
Kefimochi @kefimochi
22K Followers 576 Following doing eng things, “hyperactive wondering weirdo” 🏳️🌈✨
IntelliJ IDEA, a JetB... @intellijidea
154K Followers 23 Following The Leading IDE for Pro Java and Kotlin Development, by @JetBrains Tips: #IntelliJIDEATips New Features: #NewInIntelliJIDEA Our YT channel https://t.co/GuAlWUIi7Q
JetBrains @jetbrains
205K Followers 53 Following The World's Leading Provider of Professional Development Tools. Makers of IntelliJ IDEA, ReSharper, PyCharm, TeamCity, Kotlin, and more.
Mark⚡️Heckler �... @mkheck
18K Followers 3K Following Senior Director of Field Engineering @Moderne, comp scientist+MBA, pilot, inglés+español. @Java_Champions, ⭐️presenter, author @springbootbook. Ex @Microsoft
Vlad Mihalcea @vlad_mihalcea
89K Followers 138 Following @Java Champion, author of High-Performance Java Persistence and @Hypersistence Optimizer. Blogging at https://t.co/GWdHta4mMO
Joshua Bloch @joshbloch
66K Followers 198 Following Effective Java author, API Designer, CMU Prof, Swell guy, No longer posting here. Find me at https://t.co/bNAfciJvWM
javinpaul @javinpaul
104K Followers 7K Following Blogger - https://t.co/Cxgp9zzN3y Creator - https://t.co/GYls4Lx9DW newsletter - https://t.co/P8jiQ5GW16 youtube - https://t.co/vs4WjwaEQ6
Marharyta Nedzelska �... @jMargaritaN
2K Followers 333 Following Ukrainian, Staff Software Engineer @SonarSource, ex Software Engineer @Wix, ex Kyiv Kotlin User Group organiser, passionate code quality improver, Kotlin GDE
OpenJDK @OpenJDK
42K Followers 0 Following The place to collaborate on an open-source implementation of the Java Platform, Standard Edition, and related projects · 🐘 https://t.co/UtKelUz9Xh
Dan Appleman @danappleman
3K Followers 136 Following
Java Certification @javacert
26K Followers 223 Following The Oracle Tweet for all Java Certified professionals or those looking to become Java certified.
InfoWorld @InfoWorld
88K Followers 224 Following We're your destination for #softwaredevelopment, #machinelearning, and #cloud news. Follow along for expert analysis of these #enterprise technologies.
Sri Gokul Krishnan �... @srigokulkrishn
852 Followers 484 Following I help early-stage startups 🚀 launch with websites that actually perform ⚡ Your design partner, on tap 💻✨
CodeNewbie @CodeNewbies
151K Followers 2K Following The most supportive community of programmers. #CodeNewbie Podcast | @codelandconf | Part of the @forem & @thepracticaldev family 💜
Java StackOverflow @StackJava
21K Followers 9 Following StackOverflow feed of Java questions matching certain criteria.
Java Champions @Java_Champions
53K Followers 359 Following The official Twitter account of the Java Champions, an exclusive group of Java technology and community leaders. Mastodon https://t.co/vghNLhalEo
Spring Security @SpringSecurity
45K Followers 13 Following Spring Security is a powerful and highly customizable authentication and access-control framework.
Baeldung @baeldung
76K Followers 846 Following Passionate about everything Java. Teaching Spring on https://t.co/vh3oOY6ka6. Java Champion.
Java Code Geeks @javacodegeeks
184K Followers 118 Following Java developers resource center. JCGs is one of the fastest growing Java developers community on the net. Created by Java developers for Java developers
Spring Framework @springframework
95K Followers 36 Following
SpringCentral @springcentral
100K Followers 671 Following Spring helps development teams everywhere build simple, portable, fast and flexible JVM-based systems and applications.