<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-1900114228369772729</atom:id><lastBuildDate>Sun, 25 Oct 2026 17:41:19 +0000</lastBuildDate><category>Tech Articles</category><category>Insurance</category><category>Auto Insurance</category><category>Health</category><category>AI</category><category>AI Prompts</category><category>Artificial Intelligence</category><category>Health Insurance</category><category>Vehicle Insurance</category><category>Backlinks</category><category>Buy Me a Coffee</category><category>CCTV</category><category>Contest</category><category>Contest Alert</category><category>Coupon Code</category><category>Courses</category><category>Deals</category><category>Discounts</category><category>GST 2025</category><category>India’s GST 2025</category><category>Insurance Quotes</category><category>Learning</category><category>ML</category><category>Machine Learning</category><category>Motor Insurance</category><category>News</category><category>Offers</category><category>Online Quiz</category><category>Product Review</category><category>Prompt Engineering</category><category>SEO</category><category>eci</category><category>gst</category><category>indian new tax rules</category><category>indian tax</category><category>new gst 2025</category><category>tax</category><title>Value2Read</title><description>Providing valuable contents - Learn them! Share them!</description><link>https://value2read.blogspot.com/</link><managingEditor>noreply@blogger.com (Online Shopping)</managingEditor><generator>Blogger</generator><openSearch:totalResults>126</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-713848629631238153</guid><pubDate>Tue, 07 Jul 2026 18:09:30 +0000</pubDate><atom:updated>2026-07-07T11:09:30.738-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">AI</category><category domain="http://www.blogger.com/atom/ns#">AI Prompts</category><category domain="http://www.blogger.com/atom/ns#">Artificial Intelligence</category><title>50+ ChatGPT Prompts You Can Copy and Paste Today</title><description>&lt;h3&gt;Why reinvent the wheel?&lt;/h3&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjcd4rVCayQcPWmkWv2_BMmZjonv4caP2Mv2b0oOQxh87nKM6tcXnQ1dyppFELAy5bMvIG9roWv58q3CDuMUVyRIflSOn8cmxKmFPizoRqb-AJtO9lZtQAK372gMB_Oz_81lc2SBsuRKrLONSDugfwyV4jI6urB1oHR-fE5ddvxD0oG5TcZdNX_Oxqh3a0&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Prompts You Can Copy and Paste Today&quot; data-original-height=&quot;1024&quot; data-original-width=&quot;1024&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjcd4rVCayQcPWmkWv2_BMmZjonv4caP2Mv2b0oOQxh87nKM6tcXnQ1dyppFELAy5bMvIG9roWv58q3CDuMUVyRIflSOn8cmxKmFPizoRqb-AJtO9lZtQAK372gMB_Oz_81lc2SBsuRKrLONSDugfwyV4jI6urB1oHR-fE5ddvxD0oG5TcZdNX_Oxqh3a0=w640-h640&quot; title=&quot;Prompts You Can Copy and Paste Today&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;For common tasks, you don&#39;t need to craft a new prompt every time. This post is a treasure trove of &lt;b&gt;ready-to-use ChatGPT prompts&lt;/b&gt; that you can simply copy and paste to get started immediately.&lt;/p&gt;&lt;p&gt;Our goal is to give you a powerful starting point. Each prompt is designed to be a template you can customize with your specific details. Think of this as your personal cheat sheet for boosting productivity, whether you&#39;re a marketer, writer, student, or business professional.&lt;/p&gt;&lt;h3&gt;Prompts for Marketers&lt;/h3&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Take your marketing efforts to the next level with these prompts for social media content, email campaigns, ad copy, and SEO. Just replace the bracketed text with your information.&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Email Marketing:&lt;/b&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&quot;Draft 5 attention-grabbing subject lines for an email announcing a flash sale on &lt;b&gt;[product name]&lt;/b&gt;.&quot;&lt;/li&gt;&lt;li&gt;&quot;Write an email to our subscribers offering an exclusive discount on &lt;b&gt;[new product]&lt;/b&gt;. The tone should be &lt;b&gt;[enthusiastic/professional/casual]&lt;/b&gt;.&quot;&lt;/li&gt;&lt;li&gt;&quot;Craft a welcome email series (3 emails) for new subscribers. Email 1: Welcome and introduce our brand. Email 2: Highlight a popular product. Email 3: Share a customer testimonial and call to action.&quot;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Social Media:&lt;/b&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&quot;Generate 10 engaging social media post ideas for our &lt;b&gt;[product/service]&lt;/b&gt; on &lt;b&gt;[platform, e.g., Instagram, LinkedIn]&lt;/b&gt;. Include a mix of educational, promotional, and community-building content.&quot;&lt;/li&gt;&lt;li&gt;&quot;Write 5 short, catchy captions for a product launch on Instagram. Include relevant hashtags for the &lt;b&gt;[industry/niche]&lt;/b&gt;.&quot;&lt;/li&gt;&lt;li&gt;&quot;Create a 30-day content calendar for a &lt;b&gt;[type of business, e.g., coffee shop, fitness brand]&lt;/b&gt; on &lt;b&gt;[platform]&lt;/b&gt;. Include daily post ideas and a theme for each week.&quot;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Ad Copy &amp;amp; SEO:&lt;/b&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&quot;Write 3 variations of a Google Ad headline and description for &lt;b&gt;[product/service]&lt;/b&gt;. Focus on highlighting &lt;b&gt;[key benefit]&lt;/b&gt;.&quot;&lt;/li&gt;&lt;li&gt;&quot;Generate a meta description and title tag for a blog post titled &#39;&lt;b&gt;[Blog Post Title]&lt;/b&gt;&#39; that targets the keyword &#39;&lt;b&gt;[Target Keyword]&lt;/b&gt;&#39;.&quot;&lt;/li&gt;&lt;li&gt;&quot;Give me 5 long-tail keywords related to &#39;&lt;b&gt;[your topic]&lt;/b&gt;&#39; that a blog post could target.&quot;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;h3&gt;Prompts for Writers&lt;/h3&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Whether you&#39;re battling writer&#39;s block or need a quick outline, these prompts are perfect for generating new ideas, structuring content, and developing characters.&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Story &amp;amp; Character Development:&lt;/b&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&quot;Write a compelling short story (500 words) that starts with the line: &#39;The old lighthouse keeper had seen many storms, but none like this one.&#39;&quot;&lt;/li&gt;&lt;li&gt;&quot;Describe a character who is a &lt;b&gt;[job, e.g., detective]&lt;/b&gt; but has a secret passion for &lt;b&gt;[hobby, e.g., knitting]&lt;/b&gt;. Detail their physical appearance, personality, and a unique habit.&quot;&lt;/li&gt;&lt;li&gt;&quot;Outline a plot for a &lt;b&gt;[genre, e.g., sci-fi, romance]&lt;/b&gt; novel. Include the main conflict, a major turning point, and the resolution.&quot;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Blog Posts &amp;amp; Articles:&lt;/b&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&quot;Create a detailed blog post outline for the topic &#39;&lt;b&gt;[Topic]&lt;/b&gt;&#39;. The outline should include an introduction, 3-5 subheadings, and a conclusion.&quot;&lt;/li&gt;&lt;li&gt;&quot;Write an engaging introduction for a blog post about &#39;&lt;b&gt;[Topic]&lt;/b&gt;&#39;. The tone should be &lt;b&gt;[tone, e.g., informative, humorous, persuasive]&lt;/b&gt;.&quot;&lt;/li&gt;&lt;li&gt;&quot;Rewrite the following paragraph to be more concise and easy to read: &lt;b&gt;[Paste your paragraph here]&lt;/b&gt;.&quot;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;h3&gt;Prompts for Students&lt;/h3&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Make your academic life easier with these prompts for summarizing articles, brainstorming essay topics, and preparing for interviews.&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Essay &amp;amp; Research:&lt;/b&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&quot;Summarize the key arguments of the following article about &lt;b&gt;[topic]&lt;/b&gt; in three bullet points: &lt;b&gt;[Paste the article or a link here]&lt;/b&gt;.&quot;&lt;/li&gt;&lt;li&gt;&quot;Brainstorm 5 potential essay topics for a course on &lt;b&gt;[course name, e.g., Renaissance Art, Environmental Policy]&lt;/b&gt;. For each topic, provide a brief thesis statement.&quot;&lt;/li&gt;&lt;li&gt;&quot;Explain the concept of &lt;b&gt;[complex topic, e.g., quantum entanglement, the American Civil War&#39;s economic causes]&lt;/b&gt; in a way that a &lt;b&gt;[age group, e.g., high school student, 5-year-old]&lt;/b&gt; could understand.&quot;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Study &amp;amp; Planning:&lt;/b&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&quot;Create a study plan for an exam on &lt;b&gt;[subject]&lt;/b&gt; covering &lt;b&gt;[list of topics]&lt;/b&gt;. Suggest a schedule for the next 7 days.&quot;&lt;/li&gt;&lt;li&gt;&quot;Generate 10 potential interview questions for a &lt;b&gt;[type of job, e.g., software engineering, marketing analyst]&lt;/b&gt; position. Provide a brief answer for each.&quot;&lt;/li&gt;&lt;li&gt;&quot;Draft a professional email to my professor, &lt;b&gt;[Professor&#39;s Name]&lt;/b&gt;, asking for an extension on the &lt;b&gt;[assignment name]&lt;/b&gt; and explaining my reason: &lt;b&gt;[your reason]&lt;/b&gt;.&quot;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;h3&gt;Prompts for Business Professionals&lt;/h3&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Streamline your daily tasks, from writing professional emails to creating detailed meeting agendas and preparing for presentations.&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Email &amp;amp; Communication:&lt;/b&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&quot;Create a professional email requesting a follow-up meeting with &lt;b&gt;[client name]&lt;/b&gt; to discuss the &lt;b&gt;[project name]&lt;/b&gt; proposal.&quot;&lt;/li&gt;&lt;li&gt;&quot;Draft a professional email to a colleague, &lt;b&gt;[Colleague&#39;s Name]&lt;/b&gt;, providing an update on the progress of &lt;b&gt;[Project Name]&lt;/b&gt;. Be sure to mention &lt;b&gt;[specific details]&lt;/b&gt;.&quot;&lt;/li&gt;&lt;li&gt;&quot;Write a polite but firm email to a vendor about a late delivery, asking for an estimated new delivery date.&quot;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Meetings &amp;amp; Presentations:&lt;/b&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&quot;Generate a detailed meeting agenda for a team meeting to discuss the &lt;b&gt;[Q3 sales report]&lt;/b&gt;. Include discussion topics, key goals, and an action item section.&quot;&lt;/li&gt;&lt;li&gt;&quot;Create a script for the introduction of a business presentation about our company&#39;s new product, &lt;b&gt;[Product Name]&lt;/b&gt;. The intro should hook the audience and state the presentation&#39;s purpose.&quot;&lt;/li&gt;&lt;li&gt;&quot;Give me 5 key talking points to discuss during a performance review with an employee who is doing well but needs to improve in &lt;b&gt;[area of improvement]&lt;/b&gt;.&quot;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Customize to Maximize&lt;/h3&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Remember, these prompts are just the beginning. The real power of ChatGPT is in its ability to adapt. Once you get a response, you can always ask for a revision.&lt;/p&gt;&lt;b&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;&quot;Make it more [adjective, e.g., formal, friendly, creative].&quot;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;&quot;Shorten this to [number] words.&quot;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;&quot;Rewrite this from a [specific point of view, e.g., a CEO, a customer].&quot;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/b&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;p&gt;By using these templates and adding your own details, you can save valuable time and get high-quality results instantly.&lt;/p&gt;</description><link>https://value2read.blogspot.com/2026/07/50-chatgpt-prompts-you-can-copy-and.html</link><author>noreply@blogger.com (Online Shopping)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEjcd4rVCayQcPWmkWv2_BMmZjonv4caP2Mv2b0oOQxh87nKM6tcXnQ1dyppFELAy5bMvIG9roWv58q3CDuMUVyRIflSOn8cmxKmFPizoRqb-AJtO9lZtQAK372gMB_Oz_81lc2SBsuRKrLONSDugfwyV4jI6urB1oHR-fE5ddvxD0oG5TcZdNX_Oxqh3a0=s72-w640-h640-c" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-9009239802551435655</guid><pubDate>Fri, 16 Jan 2026 18:04:00 +0000</pubDate><atom:updated>2026-01-16T10:04:06.915-08:00</atom:updated><title>MySQL is installed, but it is NOT added to Windows PATH  Let’s fix it step-by-step (no confusion)</title><description>&lt;p&gt;&amp;nbsp;👉 &lt;strong data-end=&quot;96&quot; data-start=&quot;37&quot;&gt;MySQL is installed, but it is NOT added to Windows PATH&lt;/strong&gt;&lt;/p&gt;
&lt;p data-end=&quot;143&quot; data-start=&quot;98&quot;&gt;Let’s fix it &lt;strong data-end=&quot;127&quot; data-start=&quot;111&quot;&gt;step-by-step&lt;/strong&gt; (no confusion).&lt;/p&gt;
&lt;hr data-end=&quot;148&quot; data-start=&quot;145&quot; /&gt;
&lt;h2 data-end=&quot;193&quot; data-start=&quot;150&quot;&gt;✅ OPTION 1 (FASTEST – works immediately)&lt;/h2&gt;
&lt;h3 data-end=&quot;226&quot; data-start=&quot;195&quot;&gt;1️⃣ Find MySQL &lt;code data-end=&quot;219&quot; data-start=&quot;214&quot;&gt;bin&lt;/code&gt; folder&lt;/h3&gt;
&lt;p data-end=&quot;240&quot; data-start=&quot;227&quot;&gt;Usually here:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible! px-0!&quot; data-end=&quot;292&quot; data-start=&quot;241&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre!&quot;&gt;C:\Program Files\MySQL\MySQL &lt;span class=&quot;hljs-built_in&quot;&gt;Server&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;8.0&lt;/span&gt;\bin
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;329&quot; data-start=&quot;294&quot;&gt;Inside this folder, you should see:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible! px-0!&quot; data-end=&quot;347&quot; data-start=&quot;330&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre!&quot;&gt;mysql.exe
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;352&quot; data-start=&quot;349&quot; /&gt;
&lt;h3 data-end=&quot;387&quot; data-start=&quot;354&quot;&gt;2️⃣ Run MySQL using FULL PATH&lt;/h3&gt;
&lt;p data-end=&quot;411&quot; data-start=&quot;388&quot;&gt;In Command Prompt, run:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible! px-0!&quot; data-end=&quot;490&quot; data-start=&quot;413&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-cmd&quot;&gt;&quot;C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe&quot; -u root -p
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;536&quot; data-start=&quot;492&quot;&gt;✔ This will work even &lt;strong data-end=&quot;536&quot; data-start=&quot;514&quot;&gt;without PATH setup&lt;/strong&gt;&lt;/p&gt;
&lt;hr data-end=&quot;541&quot; data-start=&quot;538&quot; /&gt;
&lt;h2 data-end=&quot;586&quot; data-start=&quot;543&quot;&gt;✅ OPTION 2 (PERMANENT FIX – RECOMMENDED)&lt;/h2&gt;
&lt;p data-end=&quot;637&quot; data-start=&quot;588&quot;&gt;This allows you to run &lt;code data-end=&quot;618&quot; data-start=&quot;611&quot;&gt;mysql&lt;/code&gt; from &lt;strong data-end=&quot;636&quot; data-start=&quot;624&quot;&gt;anywhere&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 data-end=&quot;666&quot; data-start=&quot;639&quot;&gt;1️⃣ Copy MySQL bin path&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible! px-0!&quot; data-end=&quot;718&quot; data-start=&quot;667&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre!&quot;&gt;C:\Program Files\MySQL\MySQL &lt;span class=&quot;hljs-built_in&quot;&gt;Server&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;8.0&lt;/span&gt;\bin
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;723&quot; data-start=&quot;720&quot; /&gt;
&lt;h3 data-end=&quot;744&quot; data-start=&quot;725&quot;&gt;2️⃣ Add to PATH&lt;/h3&gt;
&lt;ol data-end=&quot;1047&quot; data-start=&quot;745&quot;&gt;
&lt;li data-end=&quot;769&quot; data-start=&quot;745&quot;&gt;
&lt;p data-end=&quot;769&quot; data-start=&quot;748&quot;&gt;Press &lt;strong data-end=&quot;769&quot; data-start=&quot;754&quot;&gt;Windows + R&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;805&quot; data-start=&quot;770&quot;&gt;
&lt;p data-end=&quot;778&quot; data-start=&quot;773&quot;&gt;Type:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible! px-0!&quot; data-end=&quot;805&quot; data-start=&quot;782&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre!&quot;&gt;sysdm.cpl
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li data-end=&quot;833&quot; data-start=&quot;806&quot;&gt;
&lt;p data-end=&quot;833&quot; data-start=&quot;809&quot;&gt;Go to &lt;strong data-end=&quot;827&quot; data-start=&quot;815&quot;&gt;Advanced&lt;/strong&gt; tab&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;868&quot; data-start=&quot;834&quot;&gt;
&lt;p data-end=&quot;868&quot; data-start=&quot;837&quot;&gt;Click &lt;strong data-end=&quot;868&quot; data-start=&quot;843&quot;&gt;Environment Variables&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;915&quot; data-start=&quot;869&quot;&gt;
&lt;p data-end=&quot;915&quot; data-start=&quot;872&quot;&gt;Under &lt;strong data-end=&quot;898&quot; data-start=&quot;878&quot;&gt;System variables&lt;/strong&gt;, select &lt;strong data-end=&quot;915&quot; data-start=&quot;907&quot;&gt;Path&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;933&quot; data-start=&quot;916&quot;&gt;
&lt;p data-end=&quot;933&quot; data-start=&quot;919&quot;&gt;Click &lt;strong data-end=&quot;933&quot; data-start=&quot;925&quot;&gt;Edit&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;950&quot; data-start=&quot;934&quot;&gt;
&lt;p data-end=&quot;950&quot; data-start=&quot;937&quot;&gt;Click &lt;strong data-end=&quot;950&quot; data-start=&quot;943&quot;&gt;New&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1021&quot; data-start=&quot;951&quot;&gt;
&lt;p data-end=&quot;960&quot; data-start=&quot;954&quot;&gt;Paste:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible! px-0!&quot; data-end=&quot;1021&quot; data-start=&quot;964&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre!&quot;&gt;C:\Program Files\MySQL\MySQL &lt;span class=&quot;hljs-built_in&quot;&gt;Server&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;8.0&lt;/span&gt;\bin
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1047&quot; data-start=&quot;1022&quot;&gt;
&lt;p data-end=&quot;1047&quot; data-start=&quot;1025&quot;&gt;Click &lt;strong data-end=&quot;1047&quot; data-start=&quot;1031&quot;&gt;OK → OK → OK&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr data-end=&quot;1052&quot; data-start=&quot;1049&quot; /&gt;
&lt;h3 data-end=&quot;1084&quot; data-start=&quot;1054&quot;&gt;3️⃣ Restart Command Prompt&lt;/h3&gt;
&lt;p data-end=&quot;1111&quot; data-start=&quot;1085&quot;&gt;Close &lt;strong data-end=&quot;1098&quot; data-start=&quot;1091&quot;&gt;cmd&lt;/strong&gt;, open again.&lt;/p&gt;
&lt;p data-end=&quot;1117&quot; data-start=&quot;1113&quot;&gt;Run:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible! px-0!&quot; data-end=&quot;1144&quot; data-start=&quot;1118&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-cmd&quot;&gt;mysql --version
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1161&quot; data-start=&quot;1146&quot;&gt;You should see:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible! px-0!&quot; data-end=&quot;1197&quot; data-start=&quot;1162&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre!&quot;&gt;mysql  Ver &lt;span class=&quot;hljs-number&quot;&gt;8.0&lt;/span&gt;.xx &lt;span class=&quot;hljs-keyword&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;Win64&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1207&quot; data-start=&quot;1199&quot;&gt;Now try:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible! px-0!&quot; data-end=&quot;1235&quot; data-start=&quot;1208&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-cmd&quot;&gt;mysql -u root -p
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;1240&quot; data-start=&quot;1237&quot; /&gt;
&lt;h2 data-end=&quot;1269&quot; data-start=&quot;1242&quot;&gt;🔑 If &lt;code data-end=&quot;1257&quot; data-start=&quot;1251&quot;&gt;root&lt;/code&gt; login fails&lt;/h2&gt;
&lt;p data-end=&quot;1274&quot; data-start=&quot;1270&quot;&gt;Try:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible! px-0!&quot; data-end=&quot;1367&quot; data-start=&quot;1275&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-cmd&quot;&gt;mysql -u admin -p -h database-1.c96awkikufpe.ap-south-1.rds.amazonaws.com -P 3306
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1424&quot; data-start=&quot;1369&quot;&gt;(Remember: &lt;strong data-end=&quot;1423&quot; data-start=&quot;1380&quot;&gt;AWS RDS does NOT allow local root login&lt;/strong&gt;)&lt;/p&gt;
&lt;hr data-end=&quot;1429&quot; data-start=&quot;1426&quot; /&gt;
&lt;h2 data-end=&quot;1448&quot; data-start=&quot;1431&quot;&gt;🧠 Quick check&lt;/h2&gt;
&lt;p data-end=&quot;1477&quot; data-start=&quot;1449&quot;&gt;Run this and tell me output:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible! px-0!&quot; data-end=&quot;1500&quot; data-start=&quot;1478&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-cmd&quot;&gt;where mysql&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;</description><link>https://value2read.blogspot.com/2026/01/mysql-is-installed-but-it-is-not-added.html</link><author>noreply@blogger.com (Online Shopping)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-5691082838464979252</guid><pubDate>Sun, 28 Dec 2025 13:25:00 +0000</pubDate><atom:updated>2025-12-28T05:25:55.880-08:00</atom:updated><title>SMA</title><description>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif;&quot;&gt;In 1-minute binary trading, speed is everything. Because your trades expire so quickly (usually in 60 seconds), you need indicators that react to price changes immediately. Standard settings used for 15-minute or daily charts will be too slow and give you signals after the move has already finished.&lt;/span&gt;&lt;/p&gt;&lt;p data-path-to-node=&quot;1&quot; style=&quot;font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Here are the best moving average settings and strategies specifically for &lt;b data-index-in-node=&quot;74&quot; data-path-to-node=&quot;1&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;1-minute binary options&lt;/b&gt;:&lt;/p&gt;&lt;h3 data-path-to-node=&quot;2&quot; style=&quot;font-family: &amp;quot;Google Sans&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;1. The &quot;Momentum&quot; Setup (Fastest Signals)&lt;/h3&gt;&lt;p data-path-to-node=&quot;3&quot; style=&quot;font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;This is for traders looking for quick &quot;Call&quot; or &quot;Put&quot; entries based on immediate momentum.&lt;/p&gt;&lt;ul data-path-to-node=&quot;4&quot; style=&quot;font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;4,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;4,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;7 EMA (White/Yellow):&lt;/b&gt; Your &quot;Signal&quot; line.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;4,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;4,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;14 EMA (Red):&lt;/b&gt; Your &quot;Baseline.&quot;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;4,2,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;4,2,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Strategy:&lt;/b&gt; * &lt;b data-index-in-node=&quot;12&quot; data-path-to-node=&quot;4,2,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Call (Buy):&lt;/b&gt; When the &lt;b data-index-in-node=&quot;33&quot; data-path-to-node=&quot;4,2,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;7 EMA crosses above the 14 EMA&lt;/b&gt; and the current candle is green.&lt;/p&gt;&lt;ul data-path-to-node=&quot;4,2,1&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;4,2,1,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;4,2,1,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Put (Sell):&lt;/b&gt; When the &lt;b data-index-in-node=&quot;21&quot; data-path-to-node=&quot;4,2,1,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;7 EMA crosses below the 14 EMA&lt;/b&gt; and the current candle is red.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;4,2,1,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;4,2,1,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Expiry:&lt;/b&gt; 1 minute (next candle).&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 data-path-to-node=&quot;5&quot; style=&quot;font-family: &amp;quot;Google Sans&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;2. The &quot;5-8-13&quot; Scalping Setup&lt;/h3&gt;&lt;p data-path-to-node=&quot;6&quot; style=&quot;font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Based on Fibonacci numbers, this setup is great for identifying a strong &quot;trend run&quot; where you can take multiple successful trades in a row.&lt;/p&gt;&lt;ul data-path-to-node=&quot;7&quot; style=&quot;font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;7,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;7,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;5 SMA&lt;/b&gt; (Fast)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;7,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;7,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;8 SMA&lt;/b&gt; (Medium)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;7,2,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;7,2,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;13 SMA&lt;/b&gt; (Slow)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;7,3,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;7,3,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Strategy:&lt;/b&gt; Wait for all three lines to &quot;fan out&quot; (separate clearly).&lt;/p&gt;&lt;ul data-path-to-node=&quot;7,3,1&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;7,3,1,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;If they are stacked &lt;b data-index-in-node=&quot;20&quot; data-path-to-node=&quot;7,3,1,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;5 &amp;gt; 8 &amp;gt; 13&lt;/b&gt; and sloping up, only take &lt;b data-index-in-node=&quot;57&quot; data-path-to-node=&quot;7,3,1,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Call&lt;/b&gt; options on every small dip to the 5 SMA.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;7,3,1,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;If they are stacked &lt;b data-index-in-node=&quot;20&quot; data-path-to-node=&quot;7,3,1,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;13 &amp;gt; 8 &amp;gt; 5&lt;/b&gt; and sloping down, only take &lt;b data-index-in-node=&quot;59&quot; data-path-to-node=&quot;7,3,1,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Put&lt;/b&gt; options.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 data-path-to-node=&quot;8&quot; style=&quot;font-family: &amp;quot;Google Sans&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;3. The Institutional Filter (To avoid &quot;Bad&quot; trades)&lt;/h3&gt;&lt;p data-path-to-node=&quot;9&quot; style=&quot;font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Many binary traders lose because they trade against the big trend. Add this one line to filter your trades:&lt;/p&gt;&lt;ul data-path-to-node=&quot;10&quot; style=&quot;font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;10,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;10,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;50 EMA (Blue/Aqua):&lt;/b&gt; * If price is &lt;b data-index-in-node=&quot;34&quot; data-path-to-node=&quot;10,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;above&lt;/b&gt; the 50 EMA, only look for &lt;b data-index-in-node=&quot;66&quot; data-path-to-node=&quot;10,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Call&lt;/b&gt; signals from your other indicators.&lt;/p&gt;&lt;ul data-path-to-node=&quot;10,0,1&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;10,0,1,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;If price is &lt;b data-index-in-node=&quot;12&quot; data-path-to-node=&quot;10,0,1,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;below&lt;/b&gt; the 50 EMA, only look for &lt;b data-index-in-node=&quot;44&quot; data-path-to-node=&quot;10,0,1,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Put&lt;/b&gt; signals.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;10,0,1,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;i data-index-in-node=&quot;0&quot; data-path-to-node=&quot;10,0,1,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;If the 50 EMA is flat/horizontal, do not trade. The market is ranging.&lt;/i&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr data-path-to-node=&quot;11&quot; style=&quot;font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot; /&gt;&lt;h3 data-path-to-node=&quot;12&quot; style=&quot;font-family: &amp;quot;Google Sans&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Pro Tips for 1-Minute Binary Options&lt;/h3&gt;&lt;table data-path-to-node=&quot;13&quot; style=&quot;font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-bottom: 32px; margin-top: 0px !important;&quot;&gt;&lt;thead style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;tr style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;line-height: 1.15 !important; margin-bottom: 0px !important; margin-top: 0px !important;&quot;&gt;Feature&lt;/strong&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;line-height: 1.15 !important; margin-bottom: 0px !important; margin-top: 0px !important;&quot;&gt;Recommendation&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;tr style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span data-path-to-node=&quot;13,1,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;13,1,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Type&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span data-path-to-node=&quot;13,1,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Use &lt;b data-index-in-node=&quot;4&quot; data-path-to-node=&quot;13,1,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;EMA&lt;/b&gt; (Exponential) instead of SMA for the 1-min chart; it weights recent price action more heavily.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span data-path-to-node=&quot;13,2,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;13,2,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Confirmation&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span data-path-to-node=&quot;13,2,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Combine your EMAs with a &lt;b data-index-in-node=&quot;25&quot; data-path-to-node=&quot;13,2,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Relative Strength Index (RSI)&lt;/b&gt; set to &lt;b data-index-in-node=&quot;62&quot; data-path-to-node=&quot;13,2,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;7 periods&lt;/b&gt;. Only take a &quot;Call&quot; if RSI is above 50.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span data-path-to-node=&quot;13,3,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;13,3,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Avoid Noise&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span data-path-to-node=&quot;13,3,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Do not trade 1-minute candles during low-volume sessions (like the late Asian session) as moving averages will &quot;zigzag&quot; and give false signals.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;blockquote data-path-to-node=&quot;14&quot; style=&quot;font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;14,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;14,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Warning:&lt;/b&gt; 1-minute trading has a high &quot;noise&quot; level. Even with the best settings, one &quot;spike&quot; candle can ruin a trade. Always test these settings on a demo account first to get the &quot;feel&quot; of the crossover speed.&lt;/p&gt;&lt;/blockquote&gt;</description><link>https://value2read.blogspot.com/2025/12/sma.html</link><author>noreply@blogger.com (Online Shopping)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-9057495008849354520</guid><pubDate>Tue, 09 Dec 2025 17:50:00 +0000</pubDate><atom:updated>2025-12-19T01:39:48.118-08:00</atom:updated><title>Ad</title><description>&lt;script id=&quot;aclib&quot; src=&quot;//acscdn.com/script/aclib.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;br /&gt;&lt;br /&gt;&lt;div&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
        aclib.runBanner({
            zoneId: &#39;10691042&#39;,
        });
    &lt;/script&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC5LLi2Hk21qAeq8SNHtDswA5zj12jFONWVpm7UMB91R-j87SNNH50Yu1fECS7kiXYdxdIA-YWLEvViEICCJxtqLkzOrNIrzy9cz90OtEmDVGbIv2zuJ5RMBdkfA-CYcCdzvWIsjb64oxst8yT8UHSQCLO7V8atmpIPcoU1R4rrb7IRJuGVKzu9dKi-Lc/s1024/logo.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1024&quot; data-original-width=&quot;1024&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC5LLi2Hk21qAeq8SNHtDswA5zj12jFONWVpm7UMB91R-j87SNNH50Yu1fECS7kiXYdxdIA-YWLEvViEICCJxtqLkzOrNIrzy9cz90OtEmDVGbIv2zuJ5RMBdkfA-CYcCdzvWIsjb64oxst8yT8UHSQCLO7V8atmpIPcoU1R4rrb7IRJuGVKzu9dKi-Lc/s320/logo.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;</description><link>https://value2read.blogspot.com/2025/12/ad.html</link><author>noreply@blogger.com (Online Shopping)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC5LLi2Hk21qAeq8SNHtDswA5zj12jFONWVpm7UMB91R-j87SNNH50Yu1fECS7kiXYdxdIA-YWLEvViEICCJxtqLkzOrNIrzy9cz90OtEmDVGbIv2zuJ5RMBdkfA-CYcCdzvWIsjb64oxst8yT8UHSQCLO7V8atmpIPcoU1R4rrb7IRJuGVKzu9dKi-Lc/s72-c/logo.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-276525840604267753</guid><pubDate>Thu, 04 Dec 2025 05:37:00 +0000</pubDate><atom:updated>2025-12-03T21:37:53.227-08:00</atom:updated><title>How do I earn money online?</title><description>&lt;h2 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;&lt;span style=&quot;font-family: &amp;quot;Google Sans&amp;quot;, sans-serif;&quot;&gt;1. Freelancing (Active Income)&lt;/span&gt;&lt;/h2&gt;&lt;p data-path-to-node=&quot;5&quot; style=&quot;font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;This is one of the quickest ways to start earning money if you have a marketable skill.&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; You offer your services to clients on a project-by-project basis.&lt;/span&gt;&lt;/p&gt;&lt;table data-path-to-node=&quot;6&quot; style=&quot;font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-bottom: 32px; margin-top: 0px !important;&quot;&gt;&lt;thead style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;tr style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;line-height: 1.15 !important; margin-bottom: 0px !important; margin-top: 0px !important;&quot;&gt;Skill/Service&lt;/strong&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;line-height: 1.15 !important; margin-bottom: 0px !important; margin-top: 0px !important;&quot;&gt;Description&lt;/strong&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;line-height: 1.15 !important; margin-bottom: 0px !important; margin-top: 0px !important;&quot;&gt;Platforms to Explore&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;tr style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span data-path-to-node=&quot;6,1,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Writing &amp;amp; Editing&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span data-path-to-node=&quot;6,1,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Content writing (blogs, websites), copywriting (ads), editing, proofreading, translation.&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span data-path-to-node=&quot;6,1,2,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Upwork, Fiverr, Freelancer.com, LinkedIn&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span data-path-to-node=&quot;6,2,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Graphic Design&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span data-path-to-node=&quot;6,2,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Logo design, social media visuals, website elements, branding.&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span data-path-to-node=&quot;6,2,2,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Fiverr, Upwork, 99designs, Dribbble&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span data-path-to-node=&quot;6,3,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Web &amp;amp; App Development&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span data-path-to-node=&quot;6,3,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Building or maintaining websites (e.g., WordPress) or mobile applications.&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span data-path-to-node=&quot;6,3,2,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Upwork, Toptal, Freelancer.com&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span data-path-to-node=&quot;6,4,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Virtual Assistant (VA)&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span data-path-to-node=&quot;6,4,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Administrative tasks, email management, social media scheduling, data entry.&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span data-path-to-node=&quot;6,4,2,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Upwork, Fiverr, Dedicated VA Agencies&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span data-path-to-node=&quot;6,5,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Digital Marketing&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span data-path-to-node=&quot;6,5,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;SEO, running social media campaigns, managing ads (Google/Facebook).&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span data-path-to-node=&quot;6,5,2,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Upwork, Specialized Agencies&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h2 class=&quot;&quot; data-path-to-node=&quot;7&quot; style=&quot;font-family: &amp;quot;Google Sans&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;2. Selling Products Online (Active/Passive Income)&lt;/h2&gt;&lt;p data-path-to-node=&quot;8&quot; style=&quot;font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;The internet makes it easier than ever to sell both physical and digital goods.&lt;/span&gt;&lt;/p&gt;&lt;ul data-path-to-node=&quot;9&quot; style=&quot;font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;9,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Dropshipping:&lt;/b&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; You set up an online store (e.&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;g.,&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; on Shopify),&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; but you never hold the inventory.&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; When a customer buys a product,&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; your supplier ships it directly to them.&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; This is largely &lt;/span&gt;&lt;b class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;passive&lt;/b&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; once the store is set up.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;9,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Print-on-Demand (POD):&lt;/b&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Similar to dropshipping,&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; but you create unique designs that are printed on products (T-shirts,&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; mugs,&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; posters) only &lt;/span&gt;&lt;i class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;after&lt;/i&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; an order is placed.&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Great for artists and designers.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;9,2,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Selling Digital Products:&lt;/b&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Create and sell items once,&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; and earn money repeatedly.&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Examples include:&lt;/span&gt;&lt;/p&gt;&lt;ul data-path-to-node=&quot;9,2,1&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;9,2,1,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;E-books or guides&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;9,2,1,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Design templates (Canva,&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; social media)&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;9,2,1,2,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Online courses (Udemy,&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Teachable)&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;9,2,1,3,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Stock photos and videos&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;9,3,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;E-commerce/Marketplaces:&lt;/b&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Sell physical goods (new,&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; used,&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; or handmade crafts) on platforms like &lt;/span&gt;&lt;b class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Amazon, eBay, Etsy,&lt;/b&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; or &lt;/span&gt;&lt;b class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Facebook Marketplace&lt;/b&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 class=&quot;&quot; data-path-to-node=&quot;10&quot; style=&quot;font-family: &amp;quot;Google Sans&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;3. Content Creation &amp;amp; Monetization (Passive Income Potential)&lt;/h2&gt;&lt;p data-path-to-node=&quot;11&quot; style=&quot;font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;If you enjoy creating content,&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; you can build an audience and monetize your influence.&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; This takes time to grow but can eventually generate &lt;/span&gt;&lt;b class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;passive&lt;/b&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; income through various streams.&lt;/span&gt;&lt;/p&gt;&lt;ul data-path-to-node=&quot;12&quot; style=&quot;font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;12,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Blogging:&lt;/b&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Start a blog focused on a niche topic.&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Monetize through:&lt;/span&gt;&lt;/p&gt;&lt;ul data-path-to-node=&quot;12,0,1&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;12,0,1,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Display Advertising&lt;/b&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; (e.&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;g.,&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Google AdSense,&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; media networks)&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;12,0,1,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Affiliate Marketing&lt;/b&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; (promoting other companies&#39; products with a unique link and earning a commission on sales).&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;12,0,1,2,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Sponsored Posts&lt;/b&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;12,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;YouTube/TikTok/Influencing:&lt;/b&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Create engaging videos or short-form content.&lt;/span&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Monetize through:&lt;/span&gt;&lt;/p&gt;&lt;ul data-path-to-node=&quot;12,1,1&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;12,1,1,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Ad Revenue&lt;/b&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; (requires meeting subscriber and watch-time thresholds)&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;12,1,1,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Brand Partnerships/Sponsorships&lt;/b&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;12,1,1,2,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Selling Merchandise&lt;/b&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;12,2,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Podcasting:&lt;/b&gt;&lt;span class=&quot;&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Build a show around a topic and earn money through sponsorships or selling premium content.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 data-path-to-node=&quot;13&quot; style=&quot;font-family: &amp;quot;Google Sans&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;4. Quick-Earn Gigs &amp;amp; Microtasks (Low Active Income)&lt;/h2&gt;&lt;p data-path-to-node=&quot;14&quot; style=&quot;font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;These options are low commitment and require minimal skill,&lt;/span&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; making them great for beginners or for earning a little extra cash in your spare time.&lt;/span&gt;&lt;/p&gt;&lt;ul data-path-to-node=&quot;15&quot; style=&quot;font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;15,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Online Surveys and Microtasks:&lt;/b&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Websites pay small amounts for completing surveys,&lt;/span&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; simple data entry,&lt;/span&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; or performing quick,&lt;/span&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; repetitive tasks.&lt;/span&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; (Examples:&lt;/span&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Swagbucks,&lt;/span&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Amazon Mechanical Turk).&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;15,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Website and App Testing:&lt;/b&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; You get paid to use a website or app and provide feedback on usability,&lt;/span&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; often recorded via video.&lt;/span&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; (Example:&lt;/span&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; UserTesting.&lt;/span&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;com).&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;15,2,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Online Tutoring and Teaching:&lt;/b&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Teach a subject you know well to students online via video conference.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 data-path-to-node=&quot;17&quot; style=&quot;font-family: &amp;quot;Google Sans&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;💡 Key Advice for Earning Online&lt;/h3&gt;&lt;ul data-path-to-node=&quot;18&quot; style=&quot;font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;18,0,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Be Patient:&lt;/b&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Most high-earning opportunities (like blogging or dropshipping) take months or even years to build into a substantial income.&lt;/span&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Freelancing can start paying faster.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;18,1,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Focus on Skills:&lt;/b&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Invest time in learning a valuable skill (coding,&lt;/span&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; SEO,&lt;/span&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; copywriting) that is in high demand.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;18,2,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Avoid Scams:&lt;/b&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; If an opportunity promises massive,&lt;/span&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; guaranteed income with zero effort or upfront investment,&lt;/span&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; it is likely a scam.&lt;/span&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Legitimate online work requires effort,&lt;/span&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; just like any other job.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-path-to-node=&quot;18,3,0&quot; style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;b style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Track Your Income:&lt;/b&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Remember that online income is generally taxable.&lt;/span&gt;&lt;span style=&quot;line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Keep track of your earnings and expenses for tax purposes.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;</description><link>https://value2read.blogspot.com/2025/12/how-do-i-earn-money-online.html</link><author>noreply@blogger.com (Online Shopping)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-5887666854684080217</guid><pubDate>Tue, 02 Dec 2025 13:31:00 +0000</pubDate><atom:updated>2025-12-02T05:31:25.909-08:00</atom:updated><title>How to Make Money Online?</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;h1 data-end=&quot;270&quot; data-start=&quot;213&quot;&gt;✅ &lt;strong data-end=&quot;270&quot; data-start=&quot;217&quot;&gt;1. Freelancing (Fastest Way to Earn Money Online)&lt;/strong&gt;&lt;/h1&gt;
&lt;p data-end=&quot;385&quot; data-start=&quot;271&quot;&gt;If you have &lt;em data-end=&quot;288&quot; data-start=&quot;283&quot;&gt;any&lt;/em&gt; skill — writing, design, coding, data entry, video editing, social media — you can earn quickly.&lt;/p&gt;
&lt;h3 data-end=&quot;405&quot; data-start=&quot;387&quot;&gt;Best Platforms&lt;/h3&gt;
&lt;ul data-end=&quot;468&quot; data-start=&quot;406&quot;&gt;
&lt;li data-end=&quot;418&quot; data-start=&quot;406&quot;&gt;
&lt;p data-end=&quot;418&quot; data-start=&quot;408&quot;&gt;&lt;strong data-end=&quot;418&quot; data-start=&quot;408&quot;&gt;Fiverr&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;431&quot; data-start=&quot;419&quot;&gt;
&lt;p data-end=&quot;431&quot; data-start=&quot;421&quot;&gt;&lt;strong data-end=&quot;431&quot; data-start=&quot;421&quot;&gt;Upwork&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;448&quot; data-start=&quot;432&quot;&gt;
&lt;p data-end=&quot;448&quot; data-start=&quot;434&quot;&gt;&lt;strong data-end=&quot;448&quot; data-start=&quot;434&quot;&gt;Freelancer&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;468&quot; data-start=&quot;449&quot;&gt;
&lt;p data-end=&quot;468&quot; data-start=&quot;451&quot;&gt;&lt;strong data-end=&quot;468&quot; data-start=&quot;451&quot;&gt;PeoplePerHour&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;496&quot; data-start=&quot;470&quot;&gt;How much can you earn?&lt;/h3&gt;
&lt;ul data-end=&quot;581&quot; data-start=&quot;497&quot;&gt;
&lt;li data-end=&quot;536&quot; data-start=&quot;497&quot;&gt;
&lt;p data-end=&quot;536&quot; data-start=&quot;499&quot;&gt;Beginners: &lt;strong data-end=&quot;536&quot; data-start=&quot;510&quot;&gt;₹500 – ₹2,000 per task&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;581&quot; data-start=&quot;537&quot;&gt;
&lt;p data-end=&quot;581&quot; data-start=&quot;539&quot;&gt;Skilled: &lt;strong data-end=&quot;581&quot; data-start=&quot;548&quot;&gt;₹5,000 – ₹50,000+ per project&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;599&quot; data-start=&quot;583&quot;&gt;Why it works&lt;/h3&gt;
&lt;p data-end=&quot;648&quot; data-start=&quot;600&quot;&gt;Clients need work daily. Zero investment needed.&lt;/p&gt;
&lt;hr data-end=&quot;653&quot; data-start=&quot;650&quot; /&gt;
&lt;h1 data-end=&quot;721&quot; data-start=&quot;655&quot;&gt;✅ &lt;strong data-end=&quot;721&quot; data-start=&quot;659&quot;&gt;2. Content Creation (YouTube | Blogging | Instagram | KYN)&lt;/strong&gt;&lt;/h1&gt;
&lt;p data-end=&quot;743&quot; data-start=&quot;722&quot;&gt;You can earn through:&lt;/p&gt;
&lt;ul data-end=&quot;816&quot; data-start=&quot;744&quot;&gt;
&lt;li data-end=&quot;753&quot; data-start=&quot;744&quot;&gt;
&lt;p data-end=&quot;753&quot; data-start=&quot;746&quot;&gt;&lt;strong data-end=&quot;753&quot; data-start=&quot;746&quot;&gt;Ads&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;775&quot; data-start=&quot;754&quot;&gt;
&lt;p data-end=&quot;775&quot; data-start=&quot;756&quot;&gt;&lt;strong data-end=&quot;775&quot; data-start=&quot;756&quot;&gt;Affiliate links&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;793&quot; data-start=&quot;776&quot;&gt;
&lt;p data-end=&quot;793&quot; data-start=&quot;778&quot;&gt;&lt;strong data-end=&quot;793&quot; data-start=&quot;778&quot;&gt;Brand deals&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;816&quot; data-start=&quot;794&quot;&gt;
&lt;p data-end=&quot;816&quot; data-start=&quot;796&quot;&gt;&lt;strong data-end=&quot;816&quot; data-start=&quot;796&quot;&gt;Digital products&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;930&quot; data-start=&quot;818&quot;&gt;Since you (Qayyum) already have YouTube + blog experience, this is a &lt;strong data-end=&quot;921&quot; data-start=&quot;887&quot;&gt;strong long-term income stream&lt;/strong&gt; for you.&lt;/p&gt;
&lt;h3 data-end=&quot;954&quot; data-start=&quot;932&quot;&gt;Potential earnings&lt;/h3&gt;
&lt;ul data-end=&quot;1076&quot; data-start=&quot;955&quot;&gt;
&lt;li data-end=&quot;1010&quot; data-start=&quot;955&quot;&gt;
&lt;p data-end=&quot;1010&quot; data-start=&quot;957&quot;&gt;Blogging: ₹10,000 – ₹5,00,000/month (Ads + Affiliate)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1076&quot; data-start=&quot;1011&quot;&gt;
&lt;p data-end=&quot;1076&quot; data-start=&quot;1013&quot;&gt;YouTube (after monetization): ₹8,000 – ₹1,00,000/month to start&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;1081&quot; data-start=&quot;1078&quot; /&gt;
&lt;h1 data-end=&quot;1113&quot; data-start=&quot;1083&quot;&gt;✅ &lt;strong data-end=&quot;1113&quot; data-start=&quot;1087&quot;&gt;3. Affiliate Marketing&lt;/strong&gt;&lt;/h1&gt;
&lt;p data-end=&quot;1188&quot; data-start=&quot;1114&quot;&gt;You promote products → someone buys via your link → you earn a commission.&lt;/p&gt;
&lt;h3 data-end=&quot;1217&quot; data-start=&quot;1190&quot;&gt;Best beginner platforms&lt;/h3&gt;
&lt;ul data-end=&quot;1289&quot; data-start=&quot;1218&quot;&gt;
&lt;li data-end=&quot;1237&quot; data-start=&quot;1218&quot;&gt;
&lt;p data-end=&quot;1237&quot; data-start=&quot;1220&quot;&gt;Amazon Associates&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1246&quot; data-start=&quot;1238&quot;&gt;
&lt;p data-end=&quot;1246&quot; data-start=&quot;1240&quot;&gt;Impact&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1261&quot; data-start=&quot;1247&quot;&gt;
&lt;p data-end=&quot;1261&quot; data-start=&quot;1249&quot;&gt;CJ Affiliate&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1268&quot; data-start=&quot;1262&quot;&gt;
&lt;p data-end=&quot;1268&quot; data-start=&quot;1264&quot;&gt;Awin&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1289&quot; data-start=&quot;1269&quot;&gt;
&lt;p data-end=&quot;1289&quot; data-start=&quot;1271&quot;&gt;Flipkart Affiliate&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;1303&quot; data-start=&quot;1291&quot;&gt;Earnings&lt;/h3&gt;
&lt;ul data-end=&quot;1352&quot; data-start=&quot;1304&quot;&gt;
&lt;li data-end=&quot;1352&quot; data-start=&quot;1304&quot;&gt;
&lt;p data-end=&quot;1352&quot; data-start=&quot;1306&quot;&gt;₹5,000 – ₹3,00,000/month depending on traffic.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1470&quot; data-start=&quot;1354&quot;&gt;This works extremely well with:&lt;br /&gt;
✔ YouTube videos&lt;br data-end=&quot;1405&quot; data-start=&quot;1402&quot; /&gt;
✔ Review blogs&lt;br data-end=&quot;1422&quot; data-start=&quot;1419&quot; /&gt;
✔ Instagram posts&lt;br data-end=&quot;1442&quot; data-start=&quot;1439&quot; /&gt;
✔ WhatsApp/Telegram groups&lt;/p&gt;
&lt;hr data-end=&quot;1475&quot; data-start=&quot;1472&quot; /&gt;
&lt;h1 data-end=&quot;1511&quot; data-start=&quot;1477&quot;&gt;✅ &lt;strong data-end=&quot;1511&quot; data-start=&quot;1481&quot;&gt;4. Online Courses &amp;amp; Ebooks&lt;/strong&gt;&lt;/h1&gt;
&lt;p data-end=&quot;1596&quot; data-start=&quot;1512&quot;&gt;If you know anything well (Java, React, Spring Boot, SEO, blogging), you can create:&lt;/p&gt;
&lt;ul data-end=&quot;1654&quot; data-start=&quot;1598&quot;&gt;
&lt;li data-end=&quot;1613&quot; data-start=&quot;1598&quot;&gt;
&lt;p data-end=&quot;1613&quot; data-start=&quot;1600&quot;&gt;A PDF guide&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1631&quot; data-start=&quot;1614&quot;&gt;
&lt;p data-end=&quot;1631&quot; data-start=&quot;1616&quot;&gt;A mini course&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1654&quot; data-start=&quot;1632&quot;&gt;
&lt;p data-end=&quot;1654&quot; data-start=&quot;1634&quot;&gt;A full masterclass&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1666&quot; data-start=&quot;1656&quot;&gt;Platforms:&lt;/p&gt;
&lt;ul data-end=&quot;1697&quot; data-start=&quot;1667&quot;&gt;
&lt;li data-end=&quot;1676&quot; data-start=&quot;1667&quot;&gt;
&lt;p data-end=&quot;1676&quot; data-start=&quot;1669&quot;&gt;Gumroad&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1684&quot; data-start=&quot;1677&quot;&gt;
&lt;p data-end=&quot;1684&quot; data-start=&quot;1679&quot;&gt;Udemy&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1697&quot; data-start=&quot;1685&quot;&gt;
&lt;p data-end=&quot;1697&quot; data-start=&quot;1687&quot;&gt;Skillshare&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1732&quot; data-start=&quot;1699&quot;&gt;High profit because it&#39;s digital.&lt;/p&gt;
&lt;hr data-end=&quot;1737&quot; data-start=&quot;1734&quot; /&gt;
&lt;h1 data-end=&quot;1776&quot; data-start=&quot;1739&quot;&gt;✅ &lt;strong data-end=&quot;1776&quot; data-start=&quot;1743&quot;&gt;5. Selling Skills as Services&lt;/strong&gt;&lt;/h1&gt;
&lt;p data-end=&quot;1826&quot; data-start=&quot;1777&quot;&gt;This is personal work, not freelancing platforms.&lt;/p&gt;
&lt;p data-end=&quot;1858&quot; data-start=&quot;1828&quot;&gt;Example services you can sell:&lt;/p&gt;
&lt;ul data-end=&quot;2008&quot; data-start=&quot;1859&quot;&gt;
&lt;li data-end=&quot;1899&quot; data-start=&quot;1859&quot;&gt;
&lt;p data-end=&quot;1899&quot; data-start=&quot;1861&quot;&gt;Building websites for local businesses&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1919&quot; data-start=&quot;1900&quot;&gt;
&lt;p data-end=&quot;1919&quot; data-start=&quot;1902&quot;&gt;Coding small apps&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1934&quot; data-start=&quot;1920&quot;&gt;
&lt;p data-end=&quot;1934&quot; data-start=&quot;1922&quot;&gt;SEO services&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1960&quot; data-start=&quot;1935&quot;&gt;
&lt;p data-end=&quot;1960&quot; data-start=&quot;1937&quot;&gt;Social media management&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1989&quot; data-start=&quot;1961&quot;&gt;
&lt;p data-end=&quot;1989&quot; data-start=&quot;1963&quot;&gt;Video editing for creators&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2008&quot; data-start=&quot;1990&quot;&gt;
&lt;p data-end=&quot;2008&quot; data-start=&quot;1992&quot;&gt;Thumbnail design&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2069&quot; data-start=&quot;2010&quot;&gt;Even 5 clients paying ₹4,000 per month = &lt;strong data-end=&quot;2068&quot; data-start=&quot;2051&quot;&gt;₹20,000/month&lt;/strong&gt;.&lt;/p&gt;
&lt;hr data-end=&quot;2074&quot; data-start=&quot;2071&quot; /&gt;
&lt;h1 data-end=&quot;2130&quot; data-start=&quot;2076&quot;&gt;✅ &lt;strong data-end=&quot;2130&quot; data-start=&quot;2080&quot;&gt;6. Micro-task Websites (Small income but easy)&lt;/strong&gt;&lt;/h1&gt;
&lt;p data-end=&quot;2165&quot; data-start=&quot;2131&quot;&gt;If you want &lt;em data-end=&quot;2149&quot; data-start=&quot;2143&quot;&gt;very&lt;/em&gt; quick earnings:&lt;/p&gt;
&lt;p data-end=&quot;2257&quot; data-start=&quot;2167&quot;&gt;✔ &lt;strong data-end=&quot;2183&quot; data-start=&quot;2169&quot;&gt;Sproutgigs&lt;/strong&gt;&lt;br data-end=&quot;2186&quot; data-start=&quot;2183&quot; /&gt;
✔ &lt;strong data-end=&quot;2203&quot; data-start=&quot;2188&quot;&gt;Picoworkers&lt;/strong&gt;&lt;br data-end=&quot;2206&quot; data-start=&quot;2203&quot; /&gt;
✔ &lt;strong data-end=&quot;2221&quot; data-start=&quot;2208&quot;&gt;Remotasks&lt;/strong&gt;&lt;br data-end=&quot;2224&quot; data-start=&quot;2221&quot; /&gt;
✔ &lt;strong data-end=&quot;2241&quot; data-start=&quot;2226&quot;&gt;UserTesting&lt;/strong&gt;&lt;br data-end=&quot;2244&quot; data-start=&quot;2241&quot; /&gt;
✔ &lt;strong data-end=&quot;2257&quot; data-start=&quot;2246&quot;&gt;TryMyUI&lt;/strong&gt;&lt;/p&gt;
&lt;p data-end=&quot;2268&quot; data-start=&quot;2259&quot;&gt;Good for:&lt;/p&gt;
&lt;ul data-end=&quot;2300&quot; data-start=&quot;2269&quot;&gt;
&lt;li data-end=&quot;2279&quot; data-start=&quot;2269&quot;&gt;
&lt;p data-end=&quot;2279&quot; data-start=&quot;2271&quot;&gt;Students&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2300&quot; data-start=&quot;2280&quot;&gt;
&lt;p data-end=&quot;2300&quot; data-start=&quot;2282&quot;&gt;Absolute beginners&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2340&quot; data-start=&quot;2302&quot;&gt;But income is small (₹300–₹3,000/day).&lt;/p&gt;
&lt;hr data-end=&quot;2345&quot; data-start=&quot;2342&quot; /&gt;
&lt;h1 data-end=&quot;2390&quot; data-start=&quot;2347&quot;&gt;✅ &lt;strong data-end=&quot;2390&quot; data-start=&quot;2351&quot;&gt;7. Remote Jobs (High stable income)&lt;/strong&gt;&lt;/h1&gt;
&lt;p data-end=&quot;2427&quot; data-start=&quot;2391&quot;&gt;Many companies hire fully remote in:&lt;/p&gt;
&lt;ul data-end=&quot;2525&quot; data-start=&quot;2428&quot;&gt;
&lt;li data-end=&quot;2440&quot; data-start=&quot;2428&quot;&gt;
&lt;p data-end=&quot;2440&quot; data-start=&quot;2430&quot;&gt;Data entry&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2459&quot; data-start=&quot;2441&quot;&gt;
&lt;p data-end=&quot;2459&quot; data-start=&quot;2443&quot;&gt;Customer support&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2480&quot; data-start=&quot;2460&quot;&gt;
&lt;p data-end=&quot;2480&quot; data-start=&quot;2462&quot;&gt;Virtual assistance&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2494&quot; data-start=&quot;2481&quot;&gt;
&lt;p data-end=&quot;2494&quot; data-start=&quot;2483&quot;&gt;Copywriting&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2508&quot; data-start=&quot;2495&quot;&gt;
&lt;p data-end=&quot;2508&quot; data-start=&quot;2497&quot;&gt;Programming&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2525&quot; data-start=&quot;2509&quot;&gt;
&lt;p data-end=&quot;2525&quot; data-start=&quot;2511&quot;&gt;Data analytics&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2536&quot; data-start=&quot;2527&quot;&gt;Websites:&lt;/p&gt;
&lt;ul data-end=&quot;2589&quot; data-start=&quot;2537&quot;&gt;
&lt;li data-end=&quot;2547&quot; data-start=&quot;2537&quot;&gt;
&lt;p data-end=&quot;2547&quot; data-start=&quot;2539&quot;&gt;RemoteOK&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2564&quot; data-start=&quot;2548&quot;&gt;
&lt;p data-end=&quot;2564&quot; data-start=&quot;2550&quot;&gt;WeWorkRemotely&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2580&quot; data-start=&quot;2565&quot;&gt;
&lt;p data-end=&quot;2580&quot; data-start=&quot;2567&quot;&gt;LinkedIn Jobs&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2589&quot; data-start=&quot;2581&quot;&gt;
&lt;p data-end=&quot;2589&quot; data-start=&quot;2583&quot;&gt;Indeed&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2628&quot; data-start=&quot;2591&quot;&gt;Income: &lt;strong data-end=&quot;2628&quot; data-start=&quot;2599&quot;&gt;₹20,000 – ₹1,50,000/month&lt;/strong&gt;&lt;/p&gt;
&lt;hr data-end=&quot;2633&quot; data-start=&quot;2630&quot; /&gt;
&lt;h1 data-end=&quot;2688&quot; data-start=&quot;2635&quot;&gt;✅ &lt;strong data-end=&quot;2688&quot; data-start=&quot;2639&quot;&gt;8. Print-on-Demand (Zero investment business)&lt;/strong&gt;&lt;/h1&gt;
&lt;p data-end=&quot;2751&quot; data-start=&quot;2689&quot;&gt;Design T-shirts → upload → platform prints &amp;amp; sells → you earn.&lt;/p&gt;
&lt;p data-end=&quot;2763&quot; data-start=&quot;2753&quot;&gt;Platforms:&lt;/p&gt;
&lt;ul data-end=&quot;2830&quot; data-start=&quot;2764&quot;&gt;
&lt;li data-end=&quot;2775&quot; data-start=&quot;2764&quot;&gt;
&lt;p data-end=&quot;2775&quot; data-start=&quot;2766&quot;&gt;Redbubble&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2787&quot; data-start=&quot;2776&quot;&gt;
&lt;p data-end=&quot;2787&quot; data-start=&quot;2778&quot;&gt;Teespring&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2812&quot; data-start=&quot;2788&quot;&gt;
&lt;p data-end=&quot;2812&quot; data-start=&quot;2790&quot;&gt;Etsy (for digital art)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2830&quot; data-start=&quot;2813&quot;&gt;
&lt;p data-end=&quot;2830&quot; data-start=&quot;2815&quot;&gt;Merch by Amazon&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2857&quot; data-start=&quot;2832&quot;&gt;Good for creative people.&lt;/p&gt;
&lt;hr data-end=&quot;2862&quot; data-start=&quot;2859&quot; /&gt;
&lt;h1 data-end=&quot;2887&quot; data-start=&quot;2864&quot;&gt;✅ &lt;strong data-end=&quot;2887&quot; data-start=&quot;2868&quot;&gt;9. Dropshipping&lt;/strong&gt;&lt;/h1&gt;
&lt;p data-end=&quot;2965&quot; data-start=&quot;2888&quot;&gt;Sell products without keeping stock. You run the store and suppliers deliver.&lt;/p&gt;
&lt;p data-end=&quot;3016&quot; data-start=&quot;2967&quot;&gt;Earnings vary widely — you need marketing skills.&lt;/p&gt;</description><link>https://value2read.blogspot.com/2025/12/how-to-make-money-online.html</link><author>noreply@blogger.com (Online Shopping)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-4932554166012555426</guid><pubDate>Mon, 01 Dec 2025 04:40:05 +0000</pubDate><atom:updated>2025-11-30T20:40:23.719-08:00</atom:updated><title>How to Connect MySQL to Spring Boot?</title><description>&lt;p&gt;&amp;nbsp;A detailed, practical, and simplified guide for developers who want a clear understanding of MySQL–Spring Boot integration.&lt;/p&gt;&lt;figure class=&quot;graf graf--figure&quot; name=&quot;213e&quot;&gt;&lt;img class=&quot;graf-image&quot; data-height=&quot;1024&quot; data-image-id=&quot;1*jgg-fh99G9d64oM3iTJxYw.png&quot; data-width=&quot;1536&quot; height=&quot;267&quot; src=&quot;https://cdn-images-1.medium.com/max/1000/1*jgg-fh99G9d64oM3iTJxYw.png&quot; width=&quot;400&quot; /&gt;&lt;/figure&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;2dc6&quot;&gt;The design adheres to the fundamental principle of &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Separation of Concerns (SoC)&lt;/strong&gt; by dividing the application into distinct layers, each with a specific responsibility.&lt;/p&gt;&lt;ul class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;36cc&quot;&gt;&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Request Flow &lt;/strong&gt;→&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt; Spring Boot Application:&lt;/strong&gt; The request enters the application container.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;4219&quot;&gt;&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Controller&lt;/strong&gt;→ &lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Service:&lt;/strong&gt; The &lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Controller&lt;/strong&gt; handles the web aspect (HTTP, routing, request/response formats) and immediately delegates the core task to the &lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Service&lt;/strong&gt; layer. This keeps the Controller “light.”&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;5949&quot;&gt;&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Service &lt;/strong&gt;→&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt; Repository:&lt;/strong&gt; The &lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Service&lt;/strong&gt; layer contains the actual &lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;business logic&lt;/strong&gt;. It determines &lt;em class=&quot;markup--em markup--li-em&quot;&gt;what&lt;/em&gt; needs to be done and then tells the &lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Repository&lt;/strong&gt; layer &lt;em class=&quot;markup--em markup--li-em&quot;&gt;how&lt;/em&gt; to save or retrieve the data.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;3412&quot;&gt;&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Repository &lt;/strong&gt;→&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt; JPA &lt;/strong&gt;→&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt; MySQL Database:&lt;/strong&gt; The &lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Repository&lt;/strong&gt; layer, often implemented using &lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;JPA (Java Persistence API)&lt;/strong&gt; via Spring Data, acts as the data access bridge. It manages the persistence details (like SQL commands) and maps application objects to the &lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Database&lt;/strong&gt; tables.&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;8f29&quot;&gt;Connecting MySQL to a Spring Boot application is one of the most essential skills for any backend or full-stack developer. Whether you’re building a simple CRUD application, a large enterprise project, or a microservice, your app will need a robust and reliable relational database — MySQL fits perfectly for that role.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;5596&quot;&gt;Many beginners get confused with configuration errors, driver issues, JDBC URL formatting, or entity mapping problems. This guide aims to eliminate those confusions.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;f671&quot;&gt;Below is a &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;clear, structured, deeply explained&lt;/strong&gt; guide that walks you from installation → configuration → coding → testing → troubleshooting.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;09a6&quot;&gt;1. Understanding Why Spring Boot and MySQL Are Commonly Used&amp;nbsp;Together&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;0d29&quot;&gt;Before jumping into setup, it’s important to understand &lt;em class=&quot;markup--em markup--p-em&quot;&gt;why&lt;/em&gt; these two technologies complement each other so well:&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;ca8d&quot;&gt;Spring Boot advantages:&lt;/h3&gt;&lt;ul class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;1f85&quot;&gt;Auto-configuration reduces boilerplate code.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;b5c6&quot;&gt;Built-in support for Spring Data JPA.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;8927&quot;&gt;Simplifies dependency handling.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;6f05&quot;&gt;Production-ready features (metrics, health checks).&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;f385&quot;&gt;Highly scalable for enterprise applications.&lt;/li&gt;&lt;/ul&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;bd1d&quot;&gt;MySQL advantages:&lt;/h3&gt;&lt;ul class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;8337&quot;&gt;Lightweight, fast, and free.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;50cd&quot;&gt;Stores structured relational data.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;d0a2&quot;&gt;Supports indexing, ACID compliance, and transactions.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;8f65&quot;&gt;Works seamlessly with Hibernate ORM.&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;f20e&quot;&gt;Together, Spring Boot + MySQL provide a &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;clean architecture, high productivity, and strong performance&lt;/strong&gt;, making them one of the most popular backend stacks worldwide.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;7978&quot;&gt;2. Prerequisites You Must Have Before&amp;nbsp;Starting&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;9a8a&quot;&gt;Make sure you have:&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;f900&quot;&gt;✔ &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Java 17+&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;✔ &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Maven&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;✔ &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Spring Boot (recommended: 3.x)&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;✔ &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;MySQL Server installed&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;✔ A database tool like MySQL Workbench / DBeaver&lt;br /&gt;&amp;nbsp;✔ An IDE like IntelliJ IDEA / Eclipse / VS Code&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;a8fb&quot;&gt;If you are missing any, install them before continuing.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;5895&quot;&gt;3. Creating the Spring Boot Project (Step-by-Step)&lt;/h3&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;4add&quot;&gt;Option 1: Using Spring Initializr&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;53af&quot;&gt;Go to &lt;a class=&quot;markup--anchor markup--p-anchor&quot; data-href=&quot;https://start.spring.io&quot; href=&quot;https://start.spring.io&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;https://start.spring.io&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;f1f3&quot;&gt;Choose:&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;7bbe&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Project:&lt;/strong&gt; Maven&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;df00&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Language:&lt;/strong&gt; Java&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;19a4&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Spring Boot Version:&lt;/strong&gt; 3.x&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;8359&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Dependencies:&lt;/strong&gt;&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;7a7a&quot;&gt;Spring Web&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;cade&quot;&gt;Spring Data JPA&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;27a3&quot;&gt;MySQL Driver&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;012c&quot;&gt;Click &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Generate&lt;/strong&gt;, then extract and import into IntelliJ/Eclipse.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;1cdd&quot;&gt;Option 2: Using IDE (IntelliJ Ultimate)&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;34c9&quot;&gt;File → New → Project → Spring Initializr.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;5f4b&quot;&gt;4. Adding Dependencies (pom.xml Explained Clearly)&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;20c3&quot;&gt;Even if you used Initializr, it’s important to understand what each dependency does.&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;xml&quot; data-code-block-mode=&quot;1&quot; name=&quot;009b&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;dependency&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;groupId&lt;/span&gt;&amp;gt;&lt;/span&gt;org.springframework.boot&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;groupId&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;artifactId&lt;/span&gt;&amp;gt;&lt;/span&gt;spring-boot-starter-web&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;artifactId&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;dependency&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;dependency&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;groupId&lt;/span&gt;&amp;gt;&lt;/span&gt;org.springframework.boot&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;groupId&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;artifactId&lt;/span&gt;&amp;gt;&lt;/span&gt;spring-boot-starter-data-jpa&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;artifactId&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;dependency&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;dependency&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;groupId&lt;/span&gt;&amp;gt;&lt;/span&gt;com.mysql&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;groupId&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;artifactId&lt;/span&gt;&amp;gt;&lt;/span&gt;mysql-connector-j&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;artifactId&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;scope&lt;/span&gt;&amp;gt;&lt;/span&gt;runtime&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;scope&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;dependency&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;b206&quot;&gt;What they&amp;nbsp;do:&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;5712&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Spring Web&lt;/strong&gt; → Allows you to create REST APIs&lt;br /&gt;&amp;nbsp;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Spring Data JPA&lt;/strong&gt; → Handles database operations without writing SQL&lt;br /&gt;&amp;nbsp;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;MySQL Connector-J&lt;/strong&gt; → Lets Java communicate with MySQL through JDBC&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;3012&quot;&gt;5. Creating the Database in&amp;nbsp;MySQL&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;46c8&quot;&gt;Open MySQL Workbench or CLI:&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;sql&quot; data-code-block-mode=&quot;1&quot; name=&quot;c0c5&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; DATABASE springbootdb;&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;a3cd&quot;&gt;Use any name you like.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;bdc1&quot;&gt;6. Configuring Spring Boot to Connect With&amp;nbsp;MySQL&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;c254&quot;&gt;This is the &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;heart&lt;/strong&gt; of database connectivity.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;1a57&quot;&gt;Go to:&lt;br /&gt;&amp;nbsp;&lt;code class=&quot;markup--code markup--p-code&quot;&gt;src/main/resources/application.properties&lt;/code&gt;&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;0bae&quot;&gt;Add:&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;ini&quot; data-code-block-mode=&quot;1&quot; name=&quot;4c17&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-attr&quot;&gt;spring.datasource.url&lt;/span&gt;=jdbc:mysql://localhost:&lt;span class=&quot;hljs-number&quot;&gt;3306&lt;/span&gt;/springbootdb&lt;br /&gt;&lt;span class=&quot;hljs-attr&quot;&gt;spring.datasource.username&lt;/span&gt;=root&lt;br /&gt;&lt;span class=&quot;hljs-attr&quot;&gt;spring.datasource.password&lt;/span&gt;=yourpassword&lt;br /&gt;&lt;span class=&quot;hljs-attr&quot;&gt;spring.datasource.driver-class-name&lt;/span&gt;=com.mysql.cj.jdbc.Driver&lt;br /&gt;&lt;span class=&quot;hljs-attr&quot;&gt;spring.jpa.hibernate.ddl-auto&lt;/span&gt;=update&lt;br /&gt;&lt;span class=&quot;hljs-attr&quot;&gt;spring.jpa.show-sql&lt;/span&gt;=&lt;span class=&quot;hljs-literal&quot;&gt;true&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;hljs-attr&quot;&gt;spring.jpa.properties.hibernate.dialect&lt;/span&gt;=org.hibernate.dialect.MySQL8Dialect&lt;/span&gt;&lt;/pre&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;342c&quot;&gt;Breaking it&amp;nbsp;down:&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;3b3d&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;spring.datasource.url&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;Defines the MySQL server address + port + DB name.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;c7b8&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;spring.jpa.hibernate.ddl-auto=update&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;Automatically creates/updates tables.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;0f51&quot;&gt;ValueMeaningcreateDrops &amp;amp; recreates tables every timeupdateSafely updates schema without deletingvalidateEnsures schema matches but doesn’t modifynoneNo action&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;94f7&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;spring.jpa.show-sql=true&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;Prints SQL queries in console.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;6d33&quot;&gt;7. Creating an Entity (Model&amp;nbsp;Class)&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;8116&quot;&gt;We create a table through an entity.&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;java&quot; data-code-block-mode=&quot;2&quot; name=&quot;cbfc&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; jakarta.persistence.*;&lt;br /&gt;&lt;span class=&quot;hljs-meta&quot;&gt;@Entity&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;User&lt;/span&gt; {&lt;br /&gt;    &lt;span class=&quot;hljs-meta&quot;&gt;@Id&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-meta&quot;&gt;@GeneratedValue(strategy = GenerationType.IDENTITY)&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; Long id;&lt;br /&gt;    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; String name;&lt;br /&gt;    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; String email;&lt;br /&gt;    &lt;span class=&quot;hljs-comment&quot;&gt;// getters and setters&lt;/span&gt;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;b547&quot;&gt;What happens when you run the&amp;nbsp;project?&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;853c&quot;&gt;Spring Boot + Hibernate → Creates a table named &lt;code class=&quot;markup--code markup--p-code&quot;&gt;user&lt;/code&gt; automatically.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;5f8d&quot;&gt;8. Creating a Repository (Database Interface)&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;e21d&quot;&gt;With Spring Data JPA, you never write SQL.&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;java&quot; data-code-block-mode=&quot;2&quot; name=&quot;d3e9&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.jpa.repository.JpaRepository;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;UserRepository&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;JpaRepository&lt;/span&gt;&amp;lt;User, Long&amp;gt; {&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;1280&quot;&gt;This interface gives you ready-made methods:&lt;/p&gt;&lt;ul class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;cc30&quot;&gt;save()&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;89a4&quot;&gt;findAll()&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;bb28&quot;&gt;findById()&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;6196&quot;&gt;deleteById()&lt;/li&gt;&lt;/ul&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;6a37&quot;&gt;9. Creating a Controller to Test the MySQL Connection&lt;/h3&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;java&quot; data-code-block-mode=&quot;2&quot; name=&quot;6cb2&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.web.bind.annotation.*;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; java.util.List;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-meta&quot;&gt;@RestController&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;hljs-meta&quot;&gt;@RequestMapping(&quot;/users&quot;)&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;UserController&lt;/span&gt; {&lt;br /&gt;    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;final&lt;/span&gt; UserRepository repository;&lt;br /&gt;    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-title function_&quot;&gt;UserController&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(UserRepository repository)&lt;/span&gt; {&lt;br /&gt;        &lt;span class=&quot;hljs-built_in&quot;&gt;this&lt;/span&gt;.repository = repository;&lt;br /&gt;    }&lt;br /&gt;    &lt;span class=&quot;hljs-meta&quot;&gt;@PostMapping&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; User &lt;span class=&quot;hljs-title function_&quot;&gt;createUser&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(&lt;span class=&quot;hljs-meta&quot;&gt;@RequestBody&lt;/span&gt; User user)&lt;/span&gt;{&lt;br /&gt;        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; repository.save(user);&lt;br /&gt;    }&lt;br /&gt;    &lt;span class=&quot;hljs-meta&quot;&gt;@GetMapping&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; List&amp;lt;User&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;getAllUsers&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;()&lt;/span&gt;{&lt;br /&gt;        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; repository.findAll();&lt;br /&gt;    }&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;ec3f&quot;&gt;10. Running and Testing the Application&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;3893&quot;&gt;Run the application:&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;typescript&quot; data-code-block-mode=&quot;1&quot; name=&quot;4858&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;mvn spring-&lt;span class=&quot;hljs-attr&quot;&gt;boot&lt;/span&gt;:run&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;af22&quot;&gt;OR click the &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Run&lt;/strong&gt; button in your IDE.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;4b5b&quot;&gt;Test using&amp;nbsp;Postman:&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;751e&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;POST&lt;/strong&gt; → &lt;a class=&quot;markup--anchor markup--p-anchor&quot; data-href=&quot;http://localhost:8080/users&quot; href=&quot;http://localhost:8080/users&quot; target=&quot;_blank&quot;&gt;http://localhost:8080/users&lt;/a&gt;&lt;br /&gt;&amp;nbsp;Body:&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;json&quot; data-code-block-mode=&quot;2&quot; name=&quot;5dd9&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;John&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;email&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;john@gmail.com&quot;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;a10c&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;GET&lt;/strong&gt; → &lt;a class=&quot;markup--anchor markup--p-anchor&quot; data-href=&quot;http://localhost:8080/users&quot; href=&quot;http://localhost:8080/users&quot; target=&quot;_blank&quot;&gt;http://localhost:8080/users&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;bc93&quot;&gt;If you see results → MySQL is connected successfully.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;2df8&quot;&gt;11. Common Errors and Their Exact&amp;nbsp;Fixes&lt;/h3&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;fa78&quot;&gt;❌ 1. Communications link&amp;nbsp;failure&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;7c76&quot;&gt;✔ MySQL server is not running.&lt;br /&gt;&amp;nbsp;Start MySQL service:&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;bash&quot; data-code-block-mode=&quot;2&quot; name=&quot;af69&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;sudo service mysql start&lt;/span&gt;&lt;/pre&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;d32f&quot;&gt;❌ 2. Access denied for user&amp;nbsp;‘root’&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;3f85&quot;&gt;Password wrong or permissions missing.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;c085&quot;&gt;Fix:&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;sql&quot; data-code-block-mode=&quot;1&quot; name=&quot;c9ea&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;USER&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;root&#39;&lt;/span&gt;@&lt;span class=&quot;hljs-string&quot;&gt;&#39;localhost&#39;&lt;/span&gt; IDENTIFIED &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;newpassword&#39;&lt;/span&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;fe91&quot;&gt;❌ 3. Public Key Retrieval Not&amp;nbsp;Allowed&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;dce3&quot;&gt;Add:&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;ruby&quot; data-code-block-mode=&quot;1&quot; name=&quot;1211&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-string&quot;&gt;?a&lt;/span&gt;llowPublicKeyRetrieval=&lt;span class=&quot;hljs-literal&quot;&gt;true&lt;/span&gt;&amp;amp;useSSL=&lt;span class=&quot;hljs-literal&quot;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;ca69&quot;&gt;Final URL:&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;bash&quot; data-code-block-mode=&quot;1&quot; name=&quot;80a4&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;jdbc:mysql://localhost:3306/springbootdb?allowPublicKeyRetrieval=&lt;span class=&quot;hljs-literal&quot;&gt;true&lt;/span&gt;&amp;amp;useSSL=&lt;span class=&quot;hljs-literal&quot;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;8a7a&quot;&gt;❌ 4. Unknown database&amp;nbsp;error&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;61b7&quot;&gt;Meaning: Database not created.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;545f&quot;&gt;Run:&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;sql&quot; data-code-block-mode=&quot;1&quot; name=&quot;6ecf&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; DATABASE springbootdb;&lt;/span&gt;&lt;/pre&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;0cce&quot;&gt;12. Best Practices for Production&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;9199&quot;&gt;✔ Use &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;environment variables&lt;/strong&gt; for DB passwords&lt;br /&gt;&amp;nbsp;✔ Set &lt;code class=&quot;markup--code markup--p-code&quot;&gt;ddl-auto=none&lt;/code&gt; in production&lt;br /&gt;&amp;nbsp;✔ Use connection pool (HikariCP - default)&lt;br /&gt;&amp;nbsp;✔ Use migration tools like &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Flyway&lt;/strong&gt; or &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Liquibase&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;✔ Never expose database port publicly&lt;br /&gt;&amp;nbsp;✔ Always use &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;MySQL8Dialect&lt;/strong&gt; for efficient SQL generation&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;2394&quot;&gt;13. Final&amp;nbsp;Summary&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;4d30&quot;&gt;To connect Spring Boot to MySQL:&lt;/p&gt;&lt;ol class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;732e&quot;&gt;Install MySQL&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;f036&quot;&gt;Create DB&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;14dd&quot;&gt;Add dependencies&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;5617&quot;&gt;Configure application.properties&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;2b33&quot;&gt;Create entity + repository&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;bcc6&quot;&gt;Run API&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;f2a8&quot;&gt;Test with Postman&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;7a85&quot;&gt;Fix common issues if needed&lt;/li&gt;&lt;/ol&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;3974&quot;&gt;Spring Boot + MySQL = Clean, powerful, scalable backend stack.&lt;/p&gt;</description><link>https://value2read.blogspot.com/2025/11/how-to-connect-mysql-to-spring-boot.html</link><author>noreply@blogger.com (Online Shopping)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-1158761449629894864</guid><pubDate>Sun, 30 Nov 2025 13:52:00 +0000</pubDate><atom:updated>2025-12-05T21:47:31.427-08:00</atom:updated><title>⭐ What Are the Requirements to Get AdSense Approved for a Website or Blog? (Complete Guide)</title><description>&lt;p data-end=&quot;619&quot; data-start=&quot;298&quot;&gt;Google AdSense is one of the most popular ways to monetize a website or blog through display ads. But before Google approves your site, it checks several important quality, content, and policy standards. If you understand these requirements clearly, you can get AdSense approval faster — often in your very first attempt.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://drive.google.com/file/d/15hVW_fPuZH6Pczf2Ju6PdXnObkolozUl/view?usp=sharing&quot;&gt;https://drive.google.com/file/d/15hVW_fPuZH6Pczf2Ju6PdXnObkolozUl/view?usp=sharing&lt;/a&gt;&lt;/p&gt;
&lt;p data-end=&quot;734&quot; data-start=&quot;621&quot;&gt;This guide explains &lt;strong data-end=&quot;661&quot; data-start=&quot;641&quot;&gt;ALL requirements&lt;/strong&gt; Google expects from your site before approving your AdSense application.&lt;/p&gt;
&lt;h1 data-end=&quot;801&quot; data-start=&quot;741&quot;&gt;✅ &lt;strong data-end=&quot;801&quot; data-start=&quot;745&quot;&gt;1. You Must Own the Website and Have Control Over It&lt;/strong&gt;&lt;/h1&gt;
&lt;p data-end=&quot;837&quot; data-start=&quot;802&quot;&gt;Google only approves websites that:&lt;/p&gt;
&lt;ul data-end=&quot;929&quot; data-start=&quot;839&quot;&gt;
&lt;li data-end=&quot;859&quot; data-start=&quot;839&quot;&gt;
&lt;p data-end=&quot;859&quot; data-start=&quot;841&quot;&gt;You personally own&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;886&quot; data-start=&quot;860&quot;&gt;
&lt;p data-end=&quot;886&quot; data-start=&quot;862&quot;&gt;You have admin access to&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;929&quot; data-start=&quot;887&quot;&gt;
&lt;p data-end=&quot;929&quot; data-start=&quot;889&quot;&gt;You can add AdSense verification code to&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1014&quot; data-start=&quot;931&quot;&gt;If you can’t edit the site’s HTML, DNS, or header scripts, Google won’t approve it.&lt;/p&gt;
&lt;h1 data-end=&quot;1090&quot; data-start=&quot;1021&quot;&gt;✅ &lt;strong data-end=&quot;1090&quot; data-start=&quot;1025&quot;&gt;2. Your Website Should Have Enough Original, Valuable Content&lt;/strong&gt;&lt;/h1&gt;
&lt;p data-end=&quot;1170&quot; data-start=&quot;1091&quot;&gt;Google wants &lt;strong data-end=&quot;1128&quot; data-start=&quot;1104&quot;&gt;high-quality, unique&lt;/strong&gt; content — not copied or AI-spun articles.&lt;/p&gt;
&lt;p data-end=&quot;1193&quot; data-start=&quot;1172&quot;&gt;Your content must be:&lt;/p&gt;
&lt;ul data-end=&quot;1330&quot; data-start=&quot;1195&quot;&gt;
&lt;li data-end=&quot;1221&quot; data-start=&quot;1195&quot;&gt;
&lt;p data-end=&quot;1221&quot; data-start=&quot;1197&quot;&gt;Original (no plagiarism)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1253&quot; data-start=&quot;1222&quot;&gt;
&lt;p data-end=&quot;1253&quot; data-start=&quot;1224&quot;&gt;Helpful and valuable to users&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1295&quot; data-start=&quot;1254&quot;&gt;
&lt;p data-end=&quot;1295&quot; data-start=&quot;1256&quot;&gt;Minimum &lt;strong data-end=&quot;1295&quot; data-start=&quot;1264&quot;&gt;20–30 well-written articles&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1330&quot; data-start=&quot;1296&quot;&gt;
&lt;p data-end=&quot;1330&quot; data-start=&quot;1298&quot;&gt;At least &lt;strong data-end=&quot;1325&quot; data-start=&quot;1307&quot;&gt;800–1500 words&lt;/strong&gt; each&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1357&quot; data-start=&quot;1332&quot;&gt;Thin content = rejection.&lt;/p&gt;
&lt;h1 data-end=&quot;1429&quot; data-start=&quot;1364&quot;&gt;✅ &lt;strong data-end=&quot;1429&quot; data-start=&quot;1368&quot;&gt;3. Your Website Must Follow All Google Publisher Policies&lt;/strong&gt;&lt;/h1&gt;
&lt;p data-end=&quot;1464&quot; data-start=&quot;1430&quot;&gt;Google checks for compliance with:&lt;/p&gt;
&lt;ul data-end=&quot;1552&quot; data-start=&quot;1466&quot;&gt;
&lt;li data-end=&quot;1495&quot; data-start=&quot;1466&quot;&gt;
&lt;p data-end=&quot;1495&quot; data-start=&quot;1468&quot;&gt;Google Publisher Policies&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1523&quot; data-start=&quot;1496&quot;&gt;
&lt;p data-end=&quot;1523&quot; data-start=&quot;1498&quot;&gt;Google Content Policies&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1552&quot; data-start=&quot;1524&quot;&gt;
&lt;p data-end=&quot;1552&quot; data-start=&quot;1526&quot;&gt;AdSense Program Policies&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1582&quot; data-start=&quot;1554&quot;&gt;Your site &lt;strong data-end=&quot;1576&quot; data-start=&quot;1564&quot;&gt;must NOT&lt;/strong&gt; have:&lt;/p&gt;
&lt;p data-end=&quot;1779&quot; data-start=&quot;1584&quot;&gt;❌ Plagiarism&lt;br data-end=&quot;1599&quot; data-start=&quot;1596&quot; /&gt;
❌ Copyrighted materials&lt;br data-end=&quot;1625&quot; data-start=&quot;1622&quot; /&gt;
❌ Adult/NSFW content&lt;br data-end=&quot;1648&quot; data-start=&quot;1645&quot; /&gt;
❌ Hate speech / violent / shocking content&lt;br data-end=&quot;1693&quot; data-start=&quot;1690&quot; /&gt;
❌ Illegal downloads&lt;br data-end=&quot;1715&quot; data-start=&quot;1712&quot; /&gt;
❌ Piracy / hacking guides&lt;br data-end=&quot;1743&quot; data-start=&quot;1740&quot; /&gt;
❌ Misleading content&lt;br data-end=&quot;1766&quot; data-start=&quot;1763&quot; /&gt;
❌ Fake news&lt;/p&gt;
&lt;p data-end=&quot;1841&quot; data-start=&quot;1781&quot;&gt;A safe, clean, family-friendly website gets approval faster.&lt;/p&gt;
&lt;h1 data-end=&quot;1884&quot; data-start=&quot;1848&quot;&gt;✅ &lt;strong data-end=&quot;1884&quot; data-start=&quot;1852&quot;&gt;4. Mandatory Important Pages&lt;/strong&gt;&lt;/h1&gt;
&lt;p data-end=&quot;1929&quot; data-start=&quot;1885&quot;&gt;These pages &lt;strong data-end=&quot;1911&quot; data-start=&quot;1897&quot;&gt;must exist&lt;/strong&gt; before you apply:&lt;/p&gt;
&lt;h3 data-end=&quot;1953&quot; data-start=&quot;1931&quot;&gt;✔ Privacy Policy&lt;/h3&gt;
&lt;h3 data-end=&quot;1970&quot; data-start=&quot;1954&quot;&gt;✔ About Us&lt;/h3&gt;
&lt;h3 data-end=&quot;1989&quot; data-start=&quot;1971&quot;&gt;✔ Contact Us&lt;/h3&gt;
&lt;h3 data-end=&quot;2028&quot; data-start=&quot;1990&quot;&gt;✔ Terms &amp;amp; Conditions (recommended)&lt;/h3&gt;
&lt;p data-end=&quot;2063&quot; data-start=&quot;2030&quot;&gt;Google uses these to verify that:&lt;/p&gt;
&lt;ul data-end=&quot;2148&quot; data-start=&quot;2065&quot;&gt;
&lt;li data-end=&quot;2092&quot; data-start=&quot;2065&quot;&gt;
&lt;p data-end=&quot;2092&quot; data-start=&quot;2067&quot;&gt;Your site is legitimate&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2121&quot; data-start=&quot;2093&quot;&gt;
&lt;p data-end=&quot;2121&quot; data-start=&quot;2095&quot;&gt;You are a real publisher&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2148&quot; data-start=&quot;2122&quot;&gt;
&lt;p data-end=&quot;2148&quot; data-start=&quot;2124&quot;&gt;Visitors can reach you&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2207&quot; data-start=&quot;2150&quot;&gt;A site without these pages is considered “untrustworthy.\&lt;/p&gt;
&lt;h1 data-end=&quot;2270&quot; data-start=&quot;2214&quot;&gt;✅ &lt;strong data-end=&quot;2270&quot; data-start=&quot;2218&quot;&gt;5. Your Website Must Have a User-Friendly Design&lt;/strong&gt;&lt;/h1&gt;
&lt;p data-end=&quot;2304&quot; data-start=&quot;2271&quot;&gt;Google prefers websites that are:&lt;/p&gt;
&lt;ul data-end=&quot;2392&quot; data-start=&quot;2306&quot;&gt;
&lt;li data-end=&quot;2327&quot; data-start=&quot;2306&quot;&gt;
&lt;p data-end=&quot;2327&quot; data-start=&quot;2308&quot;&gt;Mobile-responsive&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2348&quot; data-start=&quot;2328&quot;&gt;
&lt;p data-end=&quot;2348&quot; data-start=&quot;2330&quot;&gt;Easy to navigate&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2365&quot; data-start=&quot;2349&quot;&gt;
&lt;p data-end=&quot;2365&quot; data-start=&quot;2351&quot;&gt;Fast loading&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2392&quot; data-start=&quot;2366&quot;&gt;
&lt;p data-end=&quot;2392&quot; data-start=&quot;2368&quot;&gt;Clean and safe looking&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2400&quot; data-start=&quot;2394&quot;&gt;Avoid:&lt;/p&gt;
&lt;p data-end=&quot;2526&quot; data-start=&quot;2402&quot;&gt;❌ Pop-ups everywhere&lt;br data-end=&quot;2425&quot; data-start=&quot;2422&quot; /&gt;
❌ Too many ads before approval (especially third-party ads)&lt;br data-end=&quot;2487&quot; data-start=&quot;2484&quot; /&gt;
❌ Broken menus&lt;br data-end=&quot;2504&quot; data-start=&quot;2501&quot; /&gt;
❌ Slow-loading pages&lt;/p&gt;
&lt;p data-end=&quot;2568&quot; data-start=&quot;2528&quot;&gt;A simple, professional theme works best.&lt;/p&gt;
&lt;h1 data-end=&quot;2646&quot; data-start=&quot;2575&quot;&gt;✅ &lt;strong data-end=&quot;2646&quot; data-start=&quot;2579&quot;&gt;6. Your Website Must Receive Some Organic Traffic (Recommended)&lt;/strong&gt;&lt;/h1&gt;
&lt;p data-end=&quot;2710&quot; data-start=&quot;2647&quot;&gt;Google &lt;strong data-end=&quot;2693&quot; data-start=&quot;2654&quot;&gt;does not officially require traffic&lt;/strong&gt;, but in reality:&lt;/p&gt;
&lt;ul data-end=&quot;2821&quot; data-start=&quot;2712&quot;&gt;
&lt;li data-end=&quot;2759&quot; data-start=&quot;2712&quot;&gt;
&lt;p data-end=&quot;2759&quot; data-start=&quot;2714&quot;&gt;Sites with &lt;strong data-end=&quot;2738&quot; data-start=&quot;2725&quot;&gt;0 traffic&lt;/strong&gt; often get rejected&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2821&quot; data-start=&quot;2760&quot;&gt;
&lt;p data-end=&quot;2821&quot; data-start=&quot;2762&quot;&gt;Sites with &lt;strong data-end=&quot;2799&quot; data-start=&quot;2773&quot;&gt;stable organic traffic&lt;/strong&gt; get approved faster&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2913&quot; data-start=&quot;2823&quot;&gt;You don’t need huge traffic — even 20–50 daily organic visitors is a good sign of quality.&lt;/p&gt;
&lt;h1 data-end=&quot;2969&quot; data-start=&quot;2920&quot;&gt;✅ &lt;strong data-end=&quot;2969&quot; data-start=&quot;2924&quot;&gt;7. Your Website Must Be Indexed on Google&lt;/strong&gt;&lt;/h1&gt;
&lt;p data-end=&quot;3009&quot; data-start=&quot;2970&quot;&gt;Google must be able to crawl your site.&lt;/p&gt;
&lt;p data-end=&quot;3022&quot; data-start=&quot;3011&quot;&gt;Check this:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;3051&quot; data-start=&quot;3024&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre!&quot;&gt;&lt;span class=&quot;hljs-section&quot;&gt;site:yourdomain.com&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;3127&quot; data-start=&quot;3053&quot;&gt;If no pages appear, your site is &lt;strong data-end=&quot;3101&quot; data-start=&quot;3086&quot;&gt;not indexed&lt;/strong&gt; → low chance of approval.&lt;/p&gt;
&lt;p data-end=&quot;3143&quot; data-start=&quot;3129&quot;&gt;Make sure you:&lt;/p&gt;
&lt;ul data-end=&quot;3212&quot; data-start=&quot;3145&quot;&gt;
&lt;li data-end=&quot;3188&quot; data-start=&quot;3145&quot;&gt;
&lt;p data-end=&quot;3188&quot; data-start=&quot;3147&quot;&gt;Submit sitemap to Google Search Console&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3212&quot; data-start=&quot;3189&quot;&gt;
&lt;p data-end=&quot;3212&quot; data-start=&quot;3191&quot;&gt;Fix indexing issues&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 data-end=&quot;3262&quot; data-start=&quot;3219&quot;&gt;✅ &lt;strong data-end=&quot;3262&quot; data-start=&quot;3223&quot;&gt;8. Your Domain Should Be Old Enough&lt;/strong&gt;&lt;/h1&gt;
&lt;p data-end=&quot;3294&quot; data-start=&quot;3263&quot;&gt;While Google has no fixed rule:&lt;/p&gt;
&lt;ul data-end=&quot;3404&quot; data-start=&quot;3296&quot;&gt;
&lt;li data-end=&quot;3344&quot; data-start=&quot;3296&quot;&gt;
&lt;p data-end=&quot;3344&quot; data-start=&quot;3298&quot;&gt;New domains (&amp;lt; 1 month old) may get rejected&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3404&quot; data-start=&quot;3345&quot;&gt;
&lt;p data-end=&quot;3404&quot; data-start=&quot;3347&quot;&gt;2–3 months old domains with content get approved faster&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3535&quot; data-start=&quot;3406&quot;&gt;Some countries (India, Pakistan, Bangladesh, Sri Lanka, China) sometimes require &lt;strong data-end=&quot;3511&quot; data-start=&quot;3487&quot;&gt;6 months of site age&lt;/strong&gt; — depending on quality.&lt;/p&gt;
&lt;h1 data-end=&quot;3590&quot; data-start=&quot;3542&quot;&gt;✅ &lt;strong data-end=&quot;3590&quot; data-start=&quot;3546&quot;&gt;9. Avoid Using Copyrighted Images/Videos&lt;/strong&gt;&lt;/h1&gt;
&lt;p data-end=&quot;3620&quot; data-start=&quot;3591&quot;&gt;Google checks your media too.&lt;/p&gt;
&lt;p data-end=&quot;3635&quot; data-start=&quot;3622&quot;&gt;Safe options:&lt;/p&gt;
&lt;p data-end=&quot;3741&quot; data-start=&quot;3637&quot;&gt;✔ Your own photos&lt;br data-end=&quot;3657&quot; data-start=&quot;3654&quot; /&gt;
✔ Royalty-free stock (Unsplash, Pexels, Pixabay)&lt;br data-end=&quot;3708&quot; data-start=&quot;3705&quot; /&gt;
✔ AI images created by yourself&lt;/p&gt;
&lt;p data-end=&quot;3749&quot; data-start=&quot;3743&quot;&gt;Avoid:&lt;/p&gt;
&lt;p data-end=&quot;3809&quot; data-start=&quot;3751&quot;&gt;❌ Google Images&lt;br data-end=&quot;3769&quot; data-start=&quot;3766&quot; /&gt;
❌ Downloaded images without permission&lt;/p&gt;
&lt;h1 data-end=&quot;3872&quot; data-start=&quot;3816&quot;&gt;✅ &lt;strong data-end=&quot;3872&quot; data-start=&quot;3820&quot;&gt;10. Your Website Must Have a Clean URL Structure&lt;/strong&gt;&lt;/h1&gt;
&lt;p data-end=&quot;3895&quot; data-start=&quot;3873&quot;&gt;URLs should be simple:&lt;/p&gt;
&lt;p data-end=&quot;3978&quot; data-start=&quot;3897&quot;&gt;✔ &lt;code data-end=&quot;3936&quot; data-start=&quot;3899&quot;&gt;yourwebsite.com/how-to-start-a-blog&lt;/code&gt;&lt;br data-end=&quot;3939&quot; data-start=&quot;3936&quot; /&gt;
❌ &lt;code data-end=&quot;3976&quot; data-start=&quot;3941&quot;&gt;yourwebsite.com/p=123?id=4556&amp;amp;xyz&lt;/code&gt;&lt;/p&gt;
&lt;p data-end=&quot;4032&quot; data-start=&quot;3980&quot;&gt;Clean URLs help Google understand your site quality.&lt;/p&gt;
&lt;h1 data-end=&quot;4096&quot; data-start=&quot;4039&quot;&gt;⭐ &lt;strong data-end=&quot;4096&quot; data-start=&quot;4043&quot;&gt;BONUS: Best Practices to Increase Approval Chance&lt;/strong&gt;&lt;/h1&gt;
&lt;p data-end=&quot;4124&quot; data-start=&quot;4098&quot;&gt;To maximize your approval:&lt;/p&gt;
&lt;h3 data-end=&quot;4161&quot; data-start=&quot;4126&quot;&gt;✔ Write long, valuable guides&lt;/h3&gt;
&lt;h3 data-end=&quot;4204&quot; data-start=&quot;4162&quot;&gt;✔ Add clear headings and subheadings&lt;/h3&gt;
&lt;h3 data-end=&quot;4235&quot; data-start=&quot;4205&quot;&gt;✔ Avoid keyword stuffing&lt;/h3&gt;
&lt;h3 data-end=&quot;4276&quot; data-start=&quot;4236&quot;&gt;✔ Don’t use any ads before AdSense&lt;/h3&gt;
&lt;h3 data-end=&quot;4312&quot; data-start=&quot;4277&quot;&gt;✔ Make your site HTTPS secure&lt;/h3&gt;
&lt;h3 data-end=&quot;4348&quot; data-start=&quot;4313&quot;&gt;✔ Use a fast hosting provider&lt;/h3&gt;
&lt;h3 data-end=&quot;4379&quot; data-start=&quot;4349&quot;&gt;✔ Use a responsive theme&lt;/h3&gt;
&lt;h1 data-end=&quot;4408&quot; data-start=&quot;4386&quot;&gt;🏆 &lt;strong data-end=&quot;4408&quot; data-start=&quot;4391&quot;&gt;Final Verdict&lt;/strong&gt;&lt;/h1&gt;
&lt;p data-end=&quot;4502&quot; data-start=&quot;4409&quot;&gt;Google AdSense approval is NOT about traffic — it’s about &lt;strong data-end=&quot;4501&quot; data-start=&quot;4467&quot;&gt;quality, trust, and compliance&lt;/strong&gt;.&lt;/p&gt;
&lt;p data-end=&quot;4521&quot; data-start=&quot;4504&quot;&gt;If your site has:&lt;/p&gt;
&lt;p data-end=&quot;4718&quot; data-start=&quot;4523&quot;&gt;✔ Original content&lt;br data-end=&quot;4544&quot; data-start=&quot;4541&quot; /&gt;
✔ 20–30 helpful articles&lt;br data-end=&quot;4571&quot; data-start=&quot;4568&quot; /&gt;
✔ Required pages (Privacy, About, Contact)&lt;br data-end=&quot;4616&quot; data-start=&quot;4613&quot; /&gt;
✔ Good design and fast loading&lt;br data-end=&quot;4649&quot; data-start=&quot;4646&quot; /&gt;
✔ No policy-violating content&lt;br data-end=&quot;4681&quot; data-start=&quot;4678&quot; /&gt;
✔ Clean navigation&lt;br data-end=&quot;4702&quot; data-start=&quot;4699&quot; /&gt;
✔ Indexed URLs&lt;/p&gt;
&lt;p data-end=&quot;4772&quot; data-start=&quot;4720&quot;&gt;Then you can confidently apply for AdSense approval.&lt;/p&gt;
&lt;p data-end=&quot;4832&quot; data-start=&quot;4774&quot;&gt;Your site &lt;strong data-end=&quot;4805&quot; data-start=&quot;4784&quot;&gt;will get approved&lt;/strong&gt; — often within a few days.&lt;/p&gt;</description><link>https://value2read.blogspot.com/2025/11/what-are-requirements-to-get-adsense.html</link><author>noreply@blogger.com (Online Shopping)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-6973540317653914369</guid><pubDate>Sun, 30 Nov 2025 13:49:00 +0000</pubDate><atom:updated>2025-11-30T05:50:22.858-08:00</atom:updated><title>How long does it typically take for Google Adsense to approve an application for a website with high traffic and quality content?</title><description>&lt;p&gt;When your website already has strong traffic, quality content, and a clean user experience, AdSense approval can be relatively quick—but it still isn’t instant. &lt;strong data-end=&quot;448&quot; data-start=&quot;347&quot;&gt;On average, Google AdSense takes between 24 hours and 7 days to review and approve an application&lt;/strong&gt;, even for high-performing websites. However, in some cases, the process may extend up to &lt;strong data-end=&quot;551&quot; data-start=&quot;538&quot;&gt;2–4 weeks&lt;/strong&gt;, depending on several factors.&lt;/p&gt;&lt;div class=&quot;relative basis-auto flex-col -mb-(--composer-overlap-px) [--composer-overlap-px:28px] grow flex overflow-hidden&quot;&gt;&lt;div class=&quot;relative h-full&quot;&gt;&lt;div class=&quot;flex h-full flex-col overflow-y-auto thread-xl:pt-(--header-height) [scrollbar-gutter:stable_both-edges]&quot;&gt;&lt;div class=&quot;flex flex-col text-sm thread-xl:pt-header-height pb-25&quot;&gt;&lt;article class=&quot;text-token-text-primary w-full focus:outline-none [--shadow-height:45px] has-data-writing-block:pointer-events-none has-data-writing-block:-mt-(--shadow-height) has-data-writing-block:pt-(--shadow-height) [&amp;amp;:has([data-writing-block])&amp;gt;*]:pointer-events-auto [content-visibility:auto] supports-[content-visibility:auto]:[contain-intrinsic-size:auto_100lvh] scroll-mt-[calc(var(--header-height)+min(200px,max(70px,20svh)))]&quot; data-scroll-anchor=&quot;true&quot; data-testid=&quot;conversation-turn-2&quot; data-turn-id=&quot;78a4c309-2c5a-43be-a132-e86744e1ac29&quot; data-turn=&quot;assistant&quot; dir=&quot;auto&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;text-base my-auto mx-auto pb-10 [--thread-content-margin:--spacing(4)] thread-sm:[--thread-content-margin:--spacing(6)] thread-lg:[--thread-content-margin:--spacing(16)] px-(--thread-content-margin)&quot;&gt;&lt;div class=&quot;[--thread-content-max-width:40rem] thread-lg:[--thread-content-max-width:48rem] mx-auto max-w-(--thread-content-max-width) flex-1 group/turn-messages focus-visible:outline-hidden relative flex w-full min-w-0 flex-col agent-turn&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;flex max-w-full flex-col grow&quot;&gt;&lt;div class=&quot;min-h-8 text-message relative flex w-full flex-col items-end gap-2 text-start break-words whitespace-normal [.text-message+&amp;amp;]:mt-1&quot; data-message-author-role=&quot;assistant&quot; data-message-id=&quot;85747898-e893-49ce-9109-013692d6342a&quot; data-message-model-slug=&quot;gpt-5-1&quot; dir=&quot;auto&quot;&gt;&lt;div class=&quot;flex w-full flex-col gap-1 empty:hidden first:pt-[1px]&quot;&gt;&lt;div class=&quot;markdown prose dark:prose-invert w-full break-words dark markdown-new-styling&quot;&gt;
&lt;h3 data-end=&quot;649&quot; data-start=&quot;584&quot;&gt;&lt;strong data-end=&quot;649&quot; data-start=&quot;588&quot;&gt;Why Approval Isn’t Instant Even for High-Traffic Websites&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;785&quot; data-start=&quot;650&quot;&gt;Google doesn’t approve sites based only on traffic volume. Instead, they manually or algorithmically evaluate multiple quality signals:&lt;/p&gt;
&lt;h3 data-end=&quot;827&quot; data-start=&quot;787&quot;&gt;&lt;strong data-end=&quot;827&quot; data-start=&quot;791&quot;&gt;1. Content Quality &amp;amp; Originality&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;862&quot; data-start=&quot;828&quot;&gt;Even high-traffic sites must show:&lt;/p&gt;
&lt;ul data-end=&quot;987&quot; data-start=&quot;863&quot;&gt;
&lt;li data-end=&quot;881&quot; data-start=&quot;863&quot;&gt;
&lt;p data-end=&quot;881&quot; data-start=&quot;865&quot;&gt;Unique content&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;901&quot; data-start=&quot;882&quot;&gt;
&lt;p data-end=&quot;901&quot; data-start=&quot;884&quot;&gt;Regular updates&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;943&quot; data-start=&quot;902&quot;&gt;
&lt;p data-end=&quot;943&quot; data-start=&quot;904&quot;&gt;Content that follows AdSense policies&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;987&quot; data-start=&quot;944&quot;&gt;
&lt;p data-end=&quot;987&quot; data-start=&quot;946&quot;&gt;A clear niche and user-focused articles&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1081&quot; data-start=&quot;989&quot;&gt;If your content is original and consistently valuable, you may get approved in &lt;strong data-end=&quot;1080&quot; data-start=&quot;1068&quot;&gt;1–3 days&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 data-end=&quot;1121&quot; data-start=&quot;1083&quot;&gt;&lt;strong data-end=&quot;1121&quot; data-start=&quot;1087&quot;&gt;2. Website Age &amp;amp; Trust Signals&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;1144&quot; data-start=&quot;1122&quot;&gt;Google checks whether:&lt;/p&gt;
&lt;ul data-end=&quot;1292&quot; data-start=&quot;1145&quot;&gt;
&lt;li data-end=&quot;1185&quot; data-start=&quot;1145&quot;&gt;
&lt;p data-end=&quot;1185&quot; data-start=&quot;1147&quot;&gt;The domain has existed for some time&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1216&quot; data-start=&quot;1186&quot;&gt;
&lt;p data-end=&quot;1216&quot; data-start=&quot;1188&quot;&gt;Pages are indexed properly&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1263&quot; data-start=&quot;1217&quot;&gt;
&lt;p data-end=&quot;1263&quot; data-start=&quot;1219&quot;&gt;There are no policy violations in the past&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1292&quot; data-start=&quot;1264&quot;&gt;
&lt;p data-end=&quot;1292&quot; data-start=&quot;1266&quot;&gt;Users engage organically&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1359&quot; data-start=&quot;1294&quot;&gt;Newer sites—even with high traffic—might take &lt;strong data-end=&quot;1358&quot; data-start=&quot;1340&quot;&gt;a week or more&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 data-end=&quot;1393&quot; data-start=&quot;1361&quot;&gt;&lt;strong data-end=&quot;1393&quot; data-start=&quot;1365&quot;&gt;3. Proper Site Structure&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;1414&quot; data-start=&quot;1394&quot;&gt;Google wants to see:&lt;/p&gt;
&lt;ul data-end=&quot;1533&quot; data-start=&quot;1415&quot;&gt;
&lt;li data-end=&quot;1429&quot; data-start=&quot;1415&quot;&gt;
&lt;p data-end=&quot;1429&quot; data-start=&quot;1417&quot;&gt;About page&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1446&quot; data-start=&quot;1430&quot;&gt;
&lt;p data-end=&quot;1446&quot; data-start=&quot;1432&quot;&gt;Contact page&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1465&quot; data-start=&quot;1447&quot;&gt;
&lt;p data-end=&quot;1465&quot; data-start=&quot;1449&quot;&gt;Privacy Policy&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1486&quot; data-start=&quot;1466&quot;&gt;
&lt;p data-end=&quot;1486&quot; data-start=&quot;1468&quot;&gt;Terms of Service&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1510&quot; data-start=&quot;1487&quot;&gt;
&lt;p data-end=&quot;1510&quot; data-start=&quot;1489&quot;&gt;Professional design&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1533&quot; data-start=&quot;1511&quot;&gt;
&lt;p data-end=&quot;1533&quot; data-start=&quot;1513&quot;&gt;Fast-loading pages&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1580&quot; data-start=&quot;1535&quot;&gt;If these are set, approval is usually faster.&lt;/p&gt;
&lt;h3 data-end=&quot;1609&quot; data-start=&quot;1582&quot;&gt;&lt;strong data-end=&quot;1609&quot; data-start=&quot;1586&quot;&gt;4. Location &amp;amp; Niche&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;1645&quot; data-start=&quot;1610&quot;&gt;Sometimes approval varies based on:&lt;/p&gt;
&lt;ul data-end=&quot;1762&quot; data-start=&quot;1646&quot;&gt;
&lt;li data-end=&quot;1682&quot; data-start=&quot;1646&quot;&gt;
&lt;p data-end=&quot;1682&quot; data-start=&quot;1648&quot;&gt;The region your site operates in&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1762&quot; data-start=&quot;1683&quot;&gt;
&lt;p data-end=&quot;1762&quot; data-start=&quot;1685&quot;&gt;The topic you cover (health, finance, gambling, and YMYL topics are stricter)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1828&quot; data-start=&quot;1764&quot;&gt;High-risk niches can slow the approval process to &lt;strong data-end=&quot;1827&quot; data-start=&quot;1814&quot;&gt;2–4 weeks&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 data-end=&quot;1862&quot; data-start=&quot;1830&quot;&gt;&lt;strong data-end=&quot;1862&quot; data-start=&quot;1834&quot;&gt;5. Google’s Review Queue&lt;/strong&gt;&lt;/h3&gt;
&lt;p data-end=&quot;1912&quot; data-start=&quot;1863&quot;&gt;Occasionally, Google slows down approvals due to:&lt;/p&gt;
&lt;ul data-end=&quot;1994&quot; data-start=&quot;1913&quot;&gt;
&lt;li data-end=&quot;1944&quot; data-start=&quot;1913&quot;&gt;
&lt;p data-end=&quot;1944&quot; data-start=&quot;1915&quot;&gt;High volume of applications&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1963&quot; data-start=&quot;1945&quot;&gt;
&lt;p data-end=&quot;1963&quot; data-start=&quot;1947&quot;&gt;Policy changes&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1994&quot; data-start=&quot;1964&quot;&gt;
&lt;p data-end=&quot;1994&quot; data-start=&quot;1966&quot;&gt;Manual review requirements&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2032&quot; data-start=&quot;1996&quot;&gt;This can extend waits beyond 7 days.&lt;/p&gt;
&lt;h2 data-end=&quot;2096&quot; data-start=&quot;2039&quot;&gt;&lt;strong data-end=&quot;2096&quot; data-start=&quot;2042&quot;&gt;Typical Approval Timeline Based on Website Quality&lt;/strong&gt;&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;2465&quot; data-start=&quot;2098&quot;&gt;&lt;thead data-end=&quot;2139&quot; data-start=&quot;2098&quot;&gt;&lt;tr data-end=&quot;2139&quot; data-start=&quot;2098&quot;&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;2113&quot; data-start=&quot;2098&quot;&gt;Website Type&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;2139&quot; data-start=&quot;2113&quot;&gt;Expected Approval Time&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;2465&quot; data-start=&quot;2182&quot;&gt;&lt;tr data-end=&quot;2263&quot; data-start=&quot;2182&quot;&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;2244&quot; data-start=&quot;2182&quot;&gt;High-quality, high-traffic site with all policies satisfied&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2263&quot; data-start=&quot;2244&quot;&gt;&lt;strong data-end=&quot;2261&quot; data-start=&quot;2246&quot;&gt;24–72 hours&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;2351&quot; data-start=&quot;2264&quot;&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;2335&quot; data-start=&quot;2264&quot;&gt;Good content but missing small elements (like pages or design flaws)&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2351&quot; data-start=&quot;2335&quot;&gt;&lt;strong data-end=&quot;2349&quot; data-start=&quot;2337&quot;&gt;3–7 days&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;2402&quot; data-start=&quot;2352&quot;&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;2385&quot; data-start=&quot;2352&quot;&gt;New website or sensitive niche&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2402&quot; data-start=&quot;2385&quot;&gt;&lt;strong data-end=&quot;2400&quot; data-start=&quot;2387&quot;&gt;1–4 weeks&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;2465&quot; data-start=&quot;2403&quot;&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;2436&quot; data-start=&quot;2403&quot;&gt;Website sent for manual review&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2465&quot; data-start=&quot;2436&quot;&gt;&lt;strong data-end=&quot;2463&quot; data-start=&quot;2438&quot;&gt;Up to 4 weeks or more&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h2 data-end=&quot;2514&quot; data-start=&quot;2472&quot;&gt;&lt;strong data-end=&quot;2514&quot; data-start=&quot;2475&quot;&gt;Tips to Get Faster AdSense Approval&lt;/strong&gt;&lt;/h2&gt;
&lt;p data-end=&quot;2572&quot; data-start=&quot;2515&quot;&gt;If you want the quickest response, be sure your site has:&lt;/p&gt;
&lt;h3 data-end=&quot;2611&quot; data-start=&quot;2574&quot;&gt;✔ High-quality original content&lt;/h3&gt;
&lt;h3 data-end=&quot;2652&quot; data-start=&quot;2612&quot;&gt;✔ Minimum 20–30 well-written posts&lt;/h3&gt;
&lt;h3 data-end=&quot;2677&quot; data-start=&quot;2653&quot;&gt;✔ Clear navigation&lt;/h3&gt;
&lt;h3 data-end=&quot;2734&quot; data-start=&quot;2678&quot;&gt;✔ Mandatory pages (About, Contact, Privacy Policy)&lt;/h3&gt;
&lt;h3 data-end=&quot;2762&quot; data-start=&quot;2735&quot;&gt;✔ No copyright issues&lt;/h3&gt;
&lt;h3 data-end=&quot;2795&quot; data-start=&quot;2763&quot;&gt;✔ Responsive, clean design&lt;/h3&gt;
&lt;h3 data-end=&quot;2822&quot; data-start=&quot;2796&quot;&gt;✔ Fast loading speed&lt;/h3&gt;
&lt;h3 data-end=&quot;2878&quot; data-start=&quot;2823&quot;&gt;✔ Proper domain indexing in Google Search Console&lt;/h3&gt;
&lt;p data-end=&quot;2944&quot; data-start=&quot;2880&quot;&gt;Following these makes approval easy even within &lt;strong data-end=&quot;2943&quot; data-start=&quot;2928&quot;&gt;24–48 hours&lt;/strong&gt;.&lt;/p&gt;
&lt;h2 data-end=&quot;2968&quot; data-start=&quot;2951&quot;&gt;&lt;strong data-end=&quot;2968&quot; data-start=&quot;2954&quot;&gt;Conclusion&lt;/strong&gt;&lt;/h2&gt;
&lt;p data-end=&quot;3291&quot; data-start=&quot;2969&quot;&gt;Even if your website has high traffic and premium content, AdSense approval still depends on several policy and quality checks. Most good websites get approved within &lt;strong data-end=&quot;3148&quot; data-start=&quot;3136&quot;&gt;1–7 days&lt;/strong&gt;, while others may require up to &lt;strong data-end=&quot;3196&quot; data-start=&quot;3181&quot;&gt;a few weeks&lt;/strong&gt;. Ensuring a clean, policy-compliant site increases your chances of a fast and smooth approval.&lt;/p&gt;
&lt;p data-end=&quot;3432&quot; data-is-last-node=&quot;&quot; data-is-only-node=&quot;&quot; data-start=&quot;3298&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/article&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;group/thread-bottom-container relative isolate z-10 w-full basis-auto has-data-has-thread-error:pt-2 has-data-has-thread-error:[box-shadow:var(--sharp-edge-bottom-shadow)] md:border-transparent md:pt-0 dark:border-white/20 md:dark:border-transparent print:hidden content-fade single-line flex flex-col&quot; id=&quot;thread-bottom-container&quot;&gt;&lt;div id=&quot;thread-bottom&quot;&gt;&lt;div class=&quot;text-base mx-auto [--thread-content-margin:--spacing(4)] thread-sm:[--thread-content-margin:--spacing(6)] thread-lg:[--thread-content-margin:--spacing(16)] px-(--thread-content-margin)&quot;&gt;&lt;div class=&quot;[--thread-content-max-width:40rem] thread-lg:[--thread-content-max-width:48rem] mx-auto max-w-(--thread-content-max-width) flex-1&quot;&gt;&lt;div class=&quot;pointer-events-auto relative z-1 flex h-[var(--composer-container-height,100%)] max-w-full flex-[var(--composer-container-flex,1)] flex-col&quot;&gt;&lt;form class=&quot;group/composer w-full&quot; data-type=&quot;unified-composer&quot;&gt;&lt;div class=&quot;&quot;&gt;&lt;div class=&quot;bg-token-bg-primary cursor-text overflow-clip bg-clip-padding p-2.5 contain-inline-size dark:bg-[#303030] grid grid-cols-[auto_1fr_auto] [grid-template-areas:&#39;header_header_header&#39;_&#39;leading_primary_trailing&#39;_&#39;._footer_.&#39;] group-data-expanded/composer:[grid-template-areas:&#39;header_header_header&#39;_&#39;primary_primary_primary&#39;_&#39;leading_footer_trailing&#39;] shadow-short&quot;&gt;&lt;div class=&quot;[grid-area:leading]&quot;&gt;&lt;span class=&quot;flex&quot; data-state=&quot;closed&quot;&gt;&lt;button aria-expanded=&quot;false&quot; aria-haspopup=&quot;menu&quot; aria-label=&quot;Add files and more&quot; class=&quot;composer-btn&quot; data-state=&quot;closed&quot; data-testid=&quot;composer-plus-btn&quot; id=&quot;composer-plus-btn&quot; type=&quot;button&quot;&gt;&lt;svg class=&quot;icon&quot; fill=&quot;currentColor&quot; height=&quot;20&quot; viewbox=&quot;0 0 20 20&quot; width=&quot;20&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M9.33496 16.5V10.665H3.5C3.13273 10.665 2.83496 10.3673 2.83496 10C2.83496 9.63273 3.13273 9.33496 3.5 9.33496H9.33496V3.5C9.33496 3.13273 9.63273 2.83496 10 2.83496C10.3673 2.83496 10.665 3.13273 10.665 3.5V9.33496H16.5L16.6338 9.34863C16.9369 9.41057 17.165 9.67857 17.165 10C17.165 10.3214 16.9369 10.5894 16.6338 10.6514L16.5 10.665H10.665V16.5C10.665 16.8673 10.3673 17.165 10 17.165C9.63273 17.165 9.33496 16.8673 9.33496 16.5Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/button&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;flex items-center gap-2 [grid-area:trailing]&quot;&gt;&lt;div class=&quot;ms-auto flex items-center gap-1.5&quot;&gt;&lt;span class=&quot;&quot; data-state=&quot;closed&quot;&gt;&lt;button aria-label=&quot;Dictate button&quot; class=&quot;composer-btn&quot; type=&quot;button&quot;&gt;&lt;svg aria-label=&quot;&quot; class=&quot;icon&quot; fill=&quot;currentColor&quot; font-size=&quot;inherit&quot; height=&quot;20&quot; viewbox=&quot;0 0 20 20&quot; width=&quot;20&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M15.7806 10.1963C16.1326 10.3011 16.3336 10.6714 16.2288 11.0234L16.1487 11.2725C15.3429 13.6262 13.2236 15.3697 10.6644 15.6299L10.6653 16.835H12.0833L12.2171 16.8486C12.5202 16.9106 12.7484 17.1786 12.7484 17.5C12.7484 17.8214 12.5202 18.0894 12.2171 18.1514L12.0833 18.165H7.91632C7.5492 18.1649 7.25128 17.8672 7.25128 17.5C7.25128 17.1328 7.5492 16.8351 7.91632 16.835H9.33527L9.33429 15.6299C6.775 15.3697 4.6558 13.6262 3.84992 11.2725L3.76984 11.0234L3.74445 10.8906C3.71751 10.5825 3.91011 10.2879 4.21808 10.1963C4.52615 10.1047 4.84769 10.2466 4.99347 10.5195L5.04523 10.6436L5.10871 10.8418C5.8047 12.8745 7.73211 14.335 9.99933 14.335C12.3396 14.3349 14.3179 12.7789 14.9534 10.6436L15.0052 10.5195C15.151 10.2466 15.4725 10.1046 15.7806 10.1963ZM12.2513 5.41699C12.2513 4.17354 11.2437 3.16521 10.0003 3.16504C8.75675 3.16504 7.74835 4.17343 7.74835 5.41699V9.16699C7.74853 10.4104 8.75685 11.418 10.0003 11.418C11.2436 11.4178 12.2511 10.4103 12.2513 9.16699V5.41699ZM13.5814 9.16699C13.5812 11.1448 11.9781 12.7479 10.0003 12.748C8.02232 12.748 6.41845 11.1449 6.41828 9.16699V5.41699C6.41828 3.43889 8.02221 1.83496 10.0003 1.83496C11.9783 1.83514 13.5814 3.439 13.5814 5.41699V9.16699Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/button&gt;&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;&quot; data-state=&quot;closed&quot;&gt;&lt;div class=&quot;relative&quot;&gt;&lt;button aria-label=&quot;Start voice mode&quot; class=&quot;flex h-9 w-9 items-center justify-center rounded-full bg-black text-white transition-colors hover:opacity-70 focus-visible:outline-black focus-visible:outline-none disabled:text-[#f4f4f4] disabled:opacity-30 dark:bg-white dark:text-black dark:focus-visible:outline-white&quot; type=&quot;button&quot;&gt;&lt;svg class=&quot;h-5 w-5&quot; fill=&quot;currentColor&quot; height=&quot;20&quot; viewbox=&quot;0 0 20 20&quot; width=&quot;20&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path clip-rule=&quot;evenodd&quot; d=&quot;M7.91667 3.33331C8.60702 3.33331 9.16667 3.89296 9.16667 4.58331V15.4166C9.16667 16.107 8.60702 16.6666 7.91667 16.6666C7.22631 16.6666 6.66667 16.107 6.66667 15.4166V4.58331C6.66667 3.89296 7.22631 3.33331 7.91667 3.33331ZM12.0833 5.83331C12.7737 5.83331 13.3333 6.39296 13.3333 7.08331V12.9166C13.3333 13.607 12.7737 14.1666 12.0833 14.1666C11.393 14.1666 10.8333 13.607 10.8333 12.9166V7.08331C10.8333 6.39296 11.393 5.83331 12.0833 5.83331ZM3.75 7.49998C4.44036 7.49998 5 8.05962 5 8.74998V11.25C5 11.9403 4.44036 12.5 3.75 12.5C3.05964 12.5 2.5 11.9403 2.5 11.25V8.74998C2.5 8.05962 3.05964 7.49998 3.75 7.49998ZM16.25 7.49998C16.9404 7.49998 17.5 8.05962 17.5 8.74998V11.25C17.5 11.9403 16.9404 12.5 16.25 12.5C15.5596 12.5 15 11.9403 15 11.25V8.74998C15 8.05962 15.5596 7.49998 16.25 7.49998Z&quot; fill-rule=&quot;evenodd&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/button&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/form&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description><link>https://value2read.blogspot.com/2025/11/how-long-does-it-typically-take-for.html</link><author>noreply@blogger.com (Online Shopping)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-8843625239280784868</guid><pubDate>Sat, 29 Nov 2025 18:16:29 +0000</pubDate><atom:updated>2025-11-29T10:16:51.602-08:00</atom:updated><title>Affect vs Effect: What’s the Difference and When to Use Them?</title><description>&lt;p&gt;Confused between “affect” and “effect”? This simple, practical guide breaks down the difference with clear explanations, examples, and memory tricks so you never mix them up again.&lt;/p&gt;&lt;figure class=&quot;graf graf--figure&quot; name=&quot;473a&quot;&gt;&lt;img class=&quot;graf-image&quot; data-height=&quot;1024&quot; data-image-id=&quot;1*gxgIw1muyKBV-qkCjjPw7Q.png&quot; data-width=&quot;1536&quot; height=&quot;267&quot; src=&quot;https://cdn-images-1.medium.com/max/1000/1*gxgIw1muyKBV-qkCjjPw7Q.png&quot; width=&quot;400&quot; /&gt;&lt;figcaption class=&quot;imageCaption&quot;&gt;Affect vs&amp;nbsp;Effect&lt;/figcaption&gt;&lt;/figure&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;03f4&quot;&gt;English is full of tricky word pairs, and &lt;em class=&quot;markup--em markup--p-em&quot;&gt;affect vs effect&lt;/em&gt; is one of the most commonly misunderstood combinations. These two words look almost identical, they sound incredibly similar, and they deal with the idea of change — which makes the confusion even stronger.&lt;br /&gt;&amp;nbsp;But the good news? Once you understand the core difference, the rest becomes surprisingly simple.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;dd21&quot;&gt;In this article, we will explore both words in detail, look at real-world examples, break down common mistakes, and use easy memory techniques to help you choose the correct word every single time.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;9c27&quot;&gt;The Core Difference You Must&amp;nbsp;Know&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;a09b&quot;&gt;If you take away just one rule from this article, let it be this:&lt;/p&gt;&lt;ul class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;5675&quot;&gt;&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Affect&lt;/strong&gt; is &lt;em class=&quot;markup--em markup--li-em&quot;&gt;usually a verb&lt;/em&gt; → it means &lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;to influence&lt;/strong&gt; something.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;8028&quot;&gt;&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Effect&lt;/strong&gt; is &lt;em class=&quot;markup--em markup--li-em&quot;&gt;usually a noun&lt;/em&gt; → it refers to &lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;the result&lt;/strong&gt; of something.&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;8c7d&quot;&gt;Think of it like this:&lt;br /&gt;&amp;nbsp;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Affect&lt;/strong&gt; is the &lt;em class=&quot;markup--em markup--p-em&quot;&gt;cause&lt;/em&gt;, and &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Effect&lt;/strong&gt; is the &lt;em class=&quot;markup--em markup--p-em&quot;&gt;result&lt;/em&gt;.&lt;br /&gt;&amp;nbsp;Or even simpler:&lt;br /&gt;&amp;nbsp;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Affect is the action. Effect is the outcome.&lt;/strong&gt;&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;9907&quot;&gt;This distinction alone will solve 95% of your confusion.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;b0bb&quot;&gt;Understanding “Affect” in&amp;nbsp;Detail&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;372e&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Affect&lt;/strong&gt; is all about &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;action&lt;/strong&gt; — something is impacting, influencing, changing, or altering something else. It’s active, dynamic, and verbal.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;fbb1&quot;&gt;✦ Clear examples of “Affect”:&lt;/h3&gt;&lt;ul class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;a5b5&quot;&gt;&lt;em class=&quot;markup--em markup--li-em&quot;&gt;The weather can affect your travel plans.&lt;/em&gt;&lt;br /&gt;&amp;nbsp;→ Weather influences what you do.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;a00a&quot;&gt;&lt;em class=&quot;markup--em markup--li-em&quot;&gt;Lack of sleep affects your thinking ability.&lt;/em&gt;&lt;br /&gt;&amp;nbsp;→ Sleep (or lack of it) changes how your brain performs.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;a675&quot;&gt;&lt;em class=&quot;markup--em markup--li-em&quot;&gt;Stress affects your productivity at work.&lt;/em&gt;&lt;br /&gt;&amp;nbsp;→ Stress impacts how well you perform tasks.&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;a6e2&quot;&gt;In all these examples, &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;affect&lt;/strong&gt; shows an action that changes something else.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;48d8&quot;&gt;✦ When SHOULD you use “Affect”?&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;d125&quot;&gt;Use &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;affect&lt;/strong&gt; when:&lt;/p&gt;&lt;ul class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;bb47&quot;&gt;something is being &lt;em class=&quot;markup--em markup--li-em&quot;&gt;influenced or changed&lt;/em&gt;&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;531a&quot;&gt;you can rewrite the sentence using &lt;em class=&quot;markup--em markup--li-em&quot;&gt;impact&lt;/em&gt;, &lt;em class=&quot;markup--em markup--li-em&quot;&gt;alter&lt;/em&gt;, or &lt;em class=&quot;markup--em markup--li-em&quot;&gt;influence&lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;cf70&quot;&gt;Example rewrite test:&lt;/p&gt;&lt;ul class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;e9b0&quot;&gt;&lt;em class=&quot;markup--em markup--li-em&quot;&gt;The news affected him deeply.&lt;/em&gt;&lt;br /&gt;&amp;nbsp;➝ &lt;em class=&quot;markup--em markup--li-em&quot;&gt;The news influenced him deeply.&lt;/em&gt; (✓ Perfect substitution)&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;93ae&quot;&gt;If you can replace it with &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;influence&lt;/strong&gt;, then &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;affect&lt;/strong&gt; is the right choice.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;065b&quot;&gt;Understanding “Effect” in&amp;nbsp;Detail&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;5da6&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Effect&lt;/strong&gt; shifts the focus to &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;results&lt;/strong&gt;. It’s not about the action itself, but what happens because of that action.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;0c75&quot;&gt;✦ Clear examples of “Effect”:&lt;/h3&gt;&lt;ul class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;5481&quot;&gt;&lt;em class=&quot;markup--em markup--li-em&quot;&gt;The effect of pollution is visible in major cities.&lt;/em&gt;&lt;br /&gt;&amp;nbsp;→ Pollution leads to visible consequences.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;ba7c&quot;&gt;&lt;em class=&quot;markup--em markup--li-em&quot;&gt;The medicine had no side effects.&lt;/em&gt;&lt;br /&gt;&amp;nbsp;→ No results or reactions occurred.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;bfac&quot;&gt;&lt;em class=&quot;markup--em markup--li-em&quot;&gt;The new schedule had a positive effect on productivity.&lt;/em&gt;&lt;br /&gt;&amp;nbsp;→ The outcome of the new schedule was good.&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;5079&quot;&gt;In every one of these examples, &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;effect&lt;/strong&gt; talks about an end state — the result of something that happened earlier.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;dadd&quot;&gt;✦ When SHOULD you use “Effect”?&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;30f1&quot;&gt;Use &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;effect&lt;/strong&gt; when:&lt;/p&gt;&lt;ul class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;2f1c&quot;&gt;you want to talk about an &lt;em class=&quot;markup--em markup--li-em&quot;&gt;outcome&lt;/em&gt;&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;e1d2&quot;&gt;the sentence describes what happened &lt;em class=&quot;markup--em markup--li-em&quot;&gt;after&lt;/em&gt; an action&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;6482&quot;&gt;you could replace the word with &lt;em class=&quot;markup--em markup--li-em&quot;&gt;result&lt;/em&gt;, &lt;em class=&quot;markup--em markup--li-em&quot;&gt;outcome&lt;/em&gt;, or &lt;em class=&quot;markup--em markup--li-em&quot;&gt;consequence&lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;805a&quot;&gt;Example rewrite:&lt;/p&gt;&lt;ul class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;adc5&quot;&gt;&lt;em class=&quot;markup--em markup--li-em&quot;&gt;The new law had an effect on traffic.&lt;/em&gt;&lt;br /&gt;&amp;nbsp;➝ &lt;em class=&quot;markup--em markup--li-em&quot;&gt;The new law had a result on traffic.&lt;/em&gt; (✓ Works perfectly)&lt;/li&gt;&lt;/ul&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;8336&quot;&gt;A Beautifully Simple Memory&amp;nbsp;Trick&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;d2d5&quot;&gt;Remember this:&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;86a4&quot;&gt;A before E → Action before End&amp;nbsp;Result&lt;/h3&gt;&lt;ul class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;4627&quot;&gt;&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Affect&lt;/strong&gt; starts with A → Action&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;e73d&quot;&gt;&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Effect&lt;/strong&gt; starts with E → End result&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;0ac2&quot;&gt;The order of letters in the alphabet actually mirrors the sequence of events in real life:&lt;br /&gt;&amp;nbsp;First something happens (&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;affect&lt;/strong&gt;), then the result appears (&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;effect&lt;/strong&gt;).&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;3895&quot;&gt;Common Mistakes (and How to Fix Them&amp;nbsp;Easily)&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;daec&quot;&gt;Because these words look and sound similar, people often swap them. Here are the typical mistakes you should avoid:&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;4a0c&quot;&gt;❌ The weather effects my&amp;nbsp;plans.&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;fa1e&quot;&gt;✔️ Correct: &lt;em class=&quot;markup--em markup--p-em&quot;&gt;The weather affects my plans.&lt;/em&gt;&lt;br /&gt;&amp;nbsp;Why? Because weather &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;influences&lt;/strong&gt; (action), not results.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;e99b&quot;&gt;❌ The training had a great affect on my performance.&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;5bc3&quot;&gt;✔️ Correct: &lt;em class=&quot;markup--em markup--p-em&quot;&gt;The training had a great effect on my performance.&lt;/em&gt;&lt;br /&gt;&amp;nbsp;Why? You’re talking about the &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;result&lt;/strong&gt; of the training, not the action.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;cec7&quot;&gt;❌ Will this decision effect our&amp;nbsp;work?&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;511b&quot;&gt;✔️ Correct: &lt;em class=&quot;markup--em markup--p-em&quot;&gt;Will this decision affect our work?&lt;/em&gt;&lt;br /&gt;&amp;nbsp;Why? The decision will &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;influence&lt;/strong&gt; the work.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;f418&quot;&gt;Rare but Important: “Effect” as a&amp;nbsp;Verb&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;748b&quot;&gt;Even native speakers rarely use &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;effect&lt;/strong&gt; as a verb, but it does exist.&lt;br /&gt;&amp;nbsp;When used this way, it means &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;to bring something into existence&lt;/strong&gt; or &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;to cause something new to happen&lt;/strong&gt;.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;fee1&quot;&gt;Examples:&lt;/p&gt;&lt;ul class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;5677&quot;&gt;&lt;em class=&quot;markup--em markup--li-em&quot;&gt;The new manager hopes to effect major changes.&lt;/em&gt;&lt;br /&gt;&amp;nbsp;→ Meaning: to create or bring about changes.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;455a&quot;&gt;&lt;em class=&quot;markup--em markup--li-em&quot;&gt;The government aims to effect reform.&lt;/em&gt;&lt;br /&gt;&amp;nbsp;→ Meaning: to make reform happen.&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;48ae&quot;&gt;This usage is more formal and is mostly found in academic, legal, or corporate writing.&lt;br /&gt;For everyday writing, you almost never need this version — but it’s good to know it exists.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;f7bb&quot;&gt;Practice Questions to Test&amp;nbsp;Yourself&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;dc07&quot;&gt;Try to answer these before checking the solutions:&lt;/p&gt;&lt;ol class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;a034&quot;&gt;Social media can ___ your mood.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;940f&quot;&gt;The main ___ of global warming is rising temperatures.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;b61b&quot;&gt;Her speech really ___ the audience.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;9a97&quot;&gt;The new system had a noticeable ___ on efficiency.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;7a6b&quot;&gt;Stress can ___ your sleep cycle.&lt;/li&gt;&lt;/ol&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;275e&quot;&gt;✔️ Answers:&lt;/h3&gt;&lt;ol class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;4b9d&quot;&gt;affect&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;836f&quot;&gt;effect&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;75d4&quot;&gt;affected&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;5521&quot;&gt;effect&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;00c5&quot;&gt;affect&lt;/li&gt;&lt;/ol&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;f263&quot;&gt;If you got them all right, you’ve mastered the concept!&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;9cf1&quot;&gt;Bringing It All&amp;nbsp;Together&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;7323&quot;&gt;The &lt;em class=&quot;markup--em markup--p-em&quot;&gt;affect vs effect&lt;/em&gt; confusion is common, but the solution is incredibly simple once you remember the two key roles:&lt;/p&gt;&lt;ul class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;abe7&quot;&gt;&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Affect&lt;/strong&gt; = verb (an action)&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;3d6a&quot;&gt;&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Effect&lt;/strong&gt; = noun (a result)&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;633e&quot;&gt;And the memory trick:&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;4bf6&quot;&gt;▶️ &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;A comes before E — Actions come before End results.&lt;/strong&gt;&lt;/p&gt;</description><link>https://value2read.blogspot.com/2025/11/affect-vs-effect-whats-difference-and.html</link><author>noreply@blogger.com (Online Shopping)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-4749381284944635139</guid><pubDate>Sat, 29 Nov 2025 17:10:00 +0000</pubDate><atom:updated>2025-11-29T09:10:25.622-08:00</atom:updated><title>   How to Build Your First AI-Powered Java Application? — Spring AI Full Beginner Guide</title><description>&lt;p&gt;Spring AI makes it insanely easy to connect Java with OpenAI, Hugging Face, and more — no messy APIs, just clean Spring magic. In this guide, you’ll build your first AI-driven Java application in minutes. Let’s code the future!&lt;/p&gt;&lt;figure class=&quot;graf graf--figure&quot; name=&quot;f4fa&quot;&gt;&lt;img class=&quot;graf-image&quot; data-height=&quot;1024&quot; data-image-id=&quot;1*D303ON1uAfCnQkbY5_3-BA.png&quot; data-width=&quot;1536&quot; height=&quot;267&quot; src=&quot;https://cdn-images-1.medium.com/max/1000/1*D303ON1uAfCnQkbY5_3-BA.png&quot; width=&quot;400&quot; /&gt;&lt;figcaption class=&quot;imageCaption&quot;&gt;AI-Powered Java Application — Spring AI Full Beginner&amp;nbsp;Guide&lt;/figcaption&gt;&lt;/figure&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;065f&quot;&gt;Welcome to the world of &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Spring AI&lt;/strong&gt;! In 2025, generative AI (LLMs like GPT-4/5) is everywhere — writing code, answering questions, and more. Java developers naturally ask: &lt;em class=&quot;markup--em markup--p-em&quot;&gt;“How do I bring this power into my Spring Boot apps?”&lt;/em&gt; The answer is &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Spring AI&lt;/strong&gt;, a new Spring-native framework that makes integrating AI models as easy as plugging in Spring Data or Spring Security.&lt;/p&gt;&lt;figure class=&quot;graf graf--figure&quot; name=&quot;d0c1&quot;&gt;&lt;img class=&quot;graf-image&quot; data-height=&quot;1024&quot; data-image-id=&quot;1*YaZmrDQTOGrZisGIxXwjfA.png&quot; data-width=&quot;1024&quot; height=&quot;400&quot; src=&quot;https://cdn-images-1.medium.com/max/1000/1*YaZmrDQTOGrZisGIxXwjfA.png&quot; width=&quot;400&quot; /&gt;&lt;/figure&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;b239&quot;&gt;Instead of hand-coding HTTP calls and JSON parsing, Spring AI provides a &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;common abstraction layer&lt;/strong&gt; for chat, embeddings, and other AI tasks, letting you swap providers (OpenAI, Hugging Face, Azure, etc.) with just a config change. In this guide, we’ll build a simple Spring Boot service powered by OpenAI (chat model), covering setup, configuration, controllers, prompt templates, response handling, logging, testing, and even switching to Hugging Face as a bonus.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;7050&quot;&gt;Spring AI applies Spring patterns to AI. Think of it like Spring Data JPA — you write to a standard interface and Spring talks to the right backend. You’ll inject a &lt;code class=&quot;markup--code markup--p-code&quot;&gt;ChatClient&lt;/code&gt; and call it, and Spring AI handles the rest. This means &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;no more hardcoding API URLs or reinventing wheels&lt;/strong&gt; for each provider. By the end, you’ll have a Spring Boot “AI app” that can chat with GPT or other models with minimal code.&lt;/p&gt;&lt;blockquote class=&quot;graf graf--blockquote&quot; name=&quot;f3ae&quot;&gt;&lt;strong class=&quot;markup--strong markup--blockquote-strong&quot;&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt;Tip:&lt;/em&gt;&lt;/strong&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt; Use modern Java (e.g. Java 21+) and Spring Boot 3.2+ to be compatible with Spring AI. Set up your project with Spring Initializr: include &lt;/em&gt;&lt;strong class=&quot;markup--strong markup--blockquote-strong&quot;&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt;Web&lt;/em&gt;&lt;/strong&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt; and &lt;/em&gt;&lt;strong class=&quot;markup--strong markup--blockquote-strong&quot;&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt;AI model&lt;/em&gt;&lt;/strong&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt; starters (e.g. OpenAI). You can also add Spring Boot Actuator later for observability.&lt;/em&gt;&lt;/blockquote&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;531a&quot;&gt;What is Spring AI and Why It Matters in&amp;nbsp;2025&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;abb6&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Spring AI&lt;/strong&gt; is a &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Spring team project&lt;/strong&gt; for &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;AI integration&lt;/strong&gt;. It was inspired by Python libraries like &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;LangChain&lt;/strong&gt;, but built from the ground up for &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Java/Spring&lt;/strong&gt;. Its goal is to make adding &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;AI features&lt;/strong&gt; to your Spring apps streamlined and familiar, without unnecessary complexity. Instead of writing raw HTTP calls to &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;OpenAI&lt;/strong&gt; or &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Hugging Face&lt;/strong&gt; endpoints, you use &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Spring beans&lt;/strong&gt; (like a &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;ChatClient&lt;/strong&gt;). Spring AI then handles &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;authentication&lt;/strong&gt;, &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;requests&lt;/strong&gt;, &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;retries&lt;/strong&gt;, etc., under the hood.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;c69c&quot;&gt;Why does this matter now? By &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;2025&lt;/strong&gt;, &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;AI is part of every tech stack&lt;/strong&gt;. Enterprises want to add &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;chatbots&lt;/strong&gt;, &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;summaries&lt;/strong&gt;, &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;code generation&lt;/strong&gt;, etc., to their &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Java backend&lt;/strong&gt;. &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Spring AI&lt;/strong&gt; lets you do that &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;“the Spring way”&lt;/strong&gt;. You can switch from &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;OpenAI&lt;/strong&gt; to a &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;local model&lt;/strong&gt; or another &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;cloud service&lt;/strong&gt; just by changing dependencies and config — &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;no code rewrite&lt;/strong&gt;. In short, Spring AI brings the power of &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;LLMs&lt;/strong&gt; into the familiar &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Spring ecosystem&lt;/strong&gt;, so &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Java developers aren’t left behind in the AI revolution&lt;/strong&gt;.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;c1c3&quot;&gt;Setting Up the Spring Boot&amp;nbsp;Project&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;68ca&quot;&gt;First, create a new Spring Boot project (e.g. via Spring Initializr). Choose &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Java 21+&lt;/strong&gt; and &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Spring Boot 3.2+&lt;/strong&gt;, and add the &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Web&lt;/strong&gt; dependency. Then add the Spring AI starters for your AI model. For OpenAI, add the &lt;em class=&quot;markup--em markup--p-em&quot;&gt;Spring AI Boot&lt;/em&gt; and &lt;em class=&quot;markup--em markup--p-em&quot;&gt;OpenAI model&lt;/em&gt; starters. In Maven &lt;code class=&quot;markup--code markup--p-code&quot;&gt;pom.xml&lt;/code&gt; it looks like this&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;xml&quot; data-code-block-mode=&quot;1&quot; name=&quot;521d&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;dependencies&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt; &amp;lt;! - Spring AI core starter →&lt;br /&gt; &lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;dependency&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt; &lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;groupId&lt;/span&gt;&amp;gt;&lt;/span&gt;org.springframework.ai&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;groupId&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt; &lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;artifactId&lt;/span&gt;&amp;gt;&lt;/span&gt;spring-ai-boot-starter&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;artifactId&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt; &lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;dependency&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt; &amp;lt;! - Spring AI OpenAI model starter →&lt;br /&gt; &lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;dependency&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt; &lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;groupId&lt;/span&gt;&amp;gt;&lt;/span&gt;org.springframework.ai&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;groupId&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt; &lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;artifactId&lt;/span&gt;&amp;gt;&lt;/span&gt;spring-ai-openai-starter&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;artifactId&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt; &lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;dependency&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;dependencies&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;d56b&quot;&gt;(Newer &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Spring AI versions&lt;/strong&gt; may use artifact names like &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;spring-ai-openai-spring-boot-starter&lt;/strong&gt; — check &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Spring AI docs&lt;/strong&gt; for the latest.) If you use &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Gradle&lt;/strong&gt;, similarly include &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;spring-ai-boot-starter&lt;/strong&gt; and &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;spring-ai-openai-starter&lt;/strong&gt;. These starters bring in everything needed to call &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;OpenAI’s Chat API&lt;/strong&gt; without additional SDKs.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;aa8a&quot;&gt;Tip: Consider importing the Spring AI Bill of Materials (BOM) for version consistency. For example, use &amp;lt;artifactId&amp;gt;spring-ai-bom&amp;lt;/artifactId&amp;gt; with &amp;lt;type&amp;gt;pom&amp;lt;/type&amp;gt; to pin matching versions. This ensures all Spring AI modules stay in sync.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;a2f3&quot;&gt;Next, add any other dependencies your app needs (e.g. Spring Web MVC). Your project is now ready for AI integration.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;b7ad&quot;&gt;Configuring the OpenAI API&amp;nbsp;Key&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;49f2&quot;&gt;Spring AI reads model credentials and settings from Spring properties. Create an &lt;code class=&quot;markup--code markup--p-code&quot;&gt;application.properties&lt;/code&gt; (or&amp;nbsp;&lt;code class=&quot;markup--code markup--p-code&quot;&gt;.yml&lt;/code&gt;) in &lt;code class=&quot;markup--code markup--p-code&quot;&gt;src/main/resources&lt;/code&gt;. At minimum, set your OpenAI API key. &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Do not hardcode the key&lt;/strong&gt; – use an environment variable or secure config. For example, in &lt;code class=&quot;markup--code markup--p-code&quot;&gt;application.properties&lt;/code&gt;&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;ini&quot; data-code-block-mode=&quot;1&quot; name=&quot;67e0&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-comment&quot;&gt;# OpenAI API credentials and model configuration&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;hljs-attr&quot;&gt;spring.ai.openai.api-key&lt;/span&gt;=&lt;span class=&quot;hljs-variable&quot;&gt;${OPENAI_API_KEY}&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;hljs-attr&quot;&gt;spring.ai.openai.chat.model&lt;/span&gt;=gpt-&lt;span class=&quot;hljs-number&quot;&gt;4&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;hljs-attr&quot;&gt;spring.ai.openai.chat.temperature&lt;/span&gt;=&lt;span class=&quot;hljs-number&quot;&gt;0.7&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;990c&quot;&gt;Here we use &lt;code class=&quot;markup--code markup--p-code&quot;&gt;${OPENAI_API_KEY}&lt;/code&gt; to load the key from an environment variable (set &lt;code class=&quot;markup--code markup--p-code&quot;&gt;export OPENAI_API_KEY=your_key&lt;/code&gt; in your OS). Spring AI will use the specified model (e.g. &lt;code class=&quot;markup--code markup--p-code&quot;&gt;gpt-4&lt;/code&gt;) and temperature. You can omit the model if you want the default.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;67af&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Tip:&lt;/strong&gt; Store secrets securely. E.g. in Linux/Mac: &lt;code class=&quot;markup--code markup--p-code&quot;&gt;export OPENAI_API_KEY=…&lt;/code&gt;. Spring’s placeholder &lt;code class=&quot;markup--code markup--p-code&quot;&gt;${…}&lt;/code&gt; reads it from the environment. This way your source code stays free of private keys.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;61a6&quot;&gt;If you prefer YAML, it looks like this:&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;yaml&quot; data-code-block-mode=&quot;1&quot; name=&quot;8348&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-attr&quot;&gt;spring:&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;hljs-attr&quot;&gt;ai:&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-attr&quot;&gt;openai:&lt;/span&gt;&lt;br /&gt;      &lt;span class=&quot;hljs-attr&quot;&gt;api-key:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;${OPENAI_API_KEY}&lt;/span&gt;&lt;br /&gt;      &lt;span class=&quot;hljs-attr&quot;&gt;chat:&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;hljs-attr&quot;&gt;options:&lt;/span&gt;&lt;br /&gt;          &lt;span class=&quot;hljs-attr&quot;&gt;model:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;gpt-4&lt;/span&gt;&lt;br /&gt;          &lt;span class=&quot;hljs-attr&quot;&gt;temperature:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;0.7&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;7e82&quot;&gt;Beyond &lt;code class=&quot;markup--code markup--p-code&quot;&gt;api-key&lt;/code&gt;, you can set other options like &lt;code class=&quot;markup--code markup--p-code&quot;&gt;temperature&lt;/code&gt;, max tokens, etc., under &lt;code class=&quot;markup--code markup--p-code&quot;&gt;spring.ai.openai.chat.options&lt;/code&gt;. For basic use, just the API key is enough.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;931b&quot;&gt;Now the application knows how to reach OpenAI. Spring Boot auto-configuration will create a &lt;code class=&quot;markup--code markup--p-code&quot;&gt;ChatClient&lt;/code&gt; bean (and other model beans) behind the scenes based on these properties.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;163b&quot;&gt;Building a Simple AI-Driven Controller&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;3f51&quot;&gt;With configuration in place, let’s write a controller that uses Spring AI’s &lt;code class=&quot;markup--code markup--p-code&quot;&gt;ChatClient&lt;/code&gt;. Spring auto-configures a &lt;code class=&quot;markup--code markup--p-code&quot;&gt;ChatClient.Builder&lt;/code&gt; (or directly a &lt;code class=&quot;markup--code markup--p-code&quot;&gt;ChatClient&lt;/code&gt; bean) using the above properties. You can inject a &lt;code class=&quot;markup--code markup--p-code&quot;&gt;ChatClient.Builder&lt;/code&gt; into your class and build the client.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;91b4&quot;&gt;For example, here’s a REST controller that returns a quick joke about any topic:&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;java&quot; data-code-block-mode=&quot;2&quot; name=&quot;5453&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.ai.chat.client.ChatClient;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.web.bind.annotation.GetMapping;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.web.bind.annotation.RequestParam;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.web.bind.annotation.RestController;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-meta&quot;&gt;@RestController&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;ChatController&lt;/span&gt; {&lt;br /&gt;    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;final&lt;/span&gt; ChatClient chatClient;&lt;br /&gt;    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-title function_&quot;&gt;ChatController&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(ChatClient.Builder chatClientBuilder)&lt;/span&gt; {&lt;br /&gt;        &lt;span class=&quot;hljs-built_in&quot;&gt;this&lt;/span&gt;.chatClient = chatClientBuilder.build();&lt;br /&gt;    }&lt;br /&gt;    &lt;span class=&quot;hljs-meta&quot;&gt;@GetMapping(&quot;/ai/simple-joke&quot;)&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; String &lt;span class=&quot;hljs-title function_&quot;&gt;getJoke&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(&lt;span class=&quot;hljs-meta&quot;&gt;@RequestParam(defaultValue = &quot;programmers&quot;)&lt;/span&gt; String topic)&lt;/span&gt; {&lt;br /&gt;        &lt;span class=&quot;hljs-comment&quot;&gt;// Send a prompt to the AI model and return the response&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; chatClient&lt;br /&gt;                .prompt()&lt;br /&gt;                .user(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Tell me a simple joke about &quot;&lt;/span&gt; + topic)&lt;br /&gt;                .call()&lt;br /&gt;                .content();&lt;br /&gt;    }&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;178b&quot;&gt;In this code:&lt;/p&gt;&lt;ul class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;2565&quot;&gt;We inject &lt;code class=&quot;markup--code markup--li-code&quot;&gt;ChatClient.Builder&lt;/code&gt; and call &lt;code class=&quot;markup--code markup--li-code&quot;&gt;build()&lt;/code&gt; to get a &lt;code class=&quot;markup--code markup--li-code&quot;&gt;ChatClient&lt;/code&gt; instance.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;27bb&quot;&gt;In &lt;code class=&quot;markup--code markup--li-code&quot;&gt;getJoke()&lt;/code&gt;, we create a chat prompt with &lt;code class=&quot;markup--code markup--li-code&quot;&gt;user(&quot;...&quot;)&lt;/code&gt;, then&amp;nbsp;&lt;code class=&quot;markup--code markup--li-code&quot;&gt;.call()&lt;/code&gt; the AI.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;5f16&quot;&gt;&lt;code class=&quot;markup--code markup--li-code&quot;&gt;.content()&lt;/code&gt; extracts the generated text as a &lt;code class=&quot;markup--code markup--li-code&quot;&gt;String&lt;/code&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;e676&quot;&gt;No OpenAI-specific code appears here — Spring AI does it. This aligns with the principle of provider-agnostic code.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;e7c4&quot;&gt;You can return the raw string, or wrap it in JSON as needed (for example, returning a &lt;code class=&quot;markup--code markup--p-code&quot;&gt;Map.of(&quot;joke&quot;, response)&lt;/code&gt;).&lt;/p&gt;&lt;blockquote class=&quot;graf graf--blockquote&quot; name=&quot;1f7a&quot;&gt;&lt;strong class=&quot;markup--strong markup--blockquote-strong&quot;&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt;Tip:&lt;/em&gt;&lt;/strong&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt; Use &lt;/em&gt;&lt;code class=&quot;markup--code markup--blockquote-code&quot;&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt;ChatClient&lt;/em&gt;&lt;/code&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt; methods fluently. The call above is equivalent to invoking OpenAI’s Chat Completions API, but you don’t deal with HTTP or JSON. If you need to customize headers or timeouts, Spring AI also provides configuration properties and hooks (see the docs).&lt;/em&gt;&lt;/blockquote&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;e933&quot;&gt;Using Prompt Templates to Improve&amp;nbsp;Prompts&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;3f3b&quot;&gt;Hardcoding prompt strings can get messy. Spring AI offers &lt;code class=&quot;markup--code markup--p-code&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;PromptTemplate&lt;/strong&gt;&lt;/code&gt; for cleaner, parameterized prompts. This lets you define a template with placeholders and fill in variables at runtime. For example:&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;java&quot; data-code-block-mode=&quot;2&quot; name=&quot;c771&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-meta&quot;&gt;@GetMapping(&quot;/ai/template-joke&quot;)&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; String &lt;span class=&quot;hljs-title function_&quot;&gt;getTemplateJoke&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(&lt;span class=&quot;hljs-meta&quot;&gt;@RequestParam&lt;/span&gt; String adjective, &lt;br /&gt;                              &lt;span class=&quot;hljs-meta&quot;&gt;@RequestParam&lt;/span&gt; String topic)&lt;/span&gt; {&lt;br /&gt;    &lt;span class=&quot;hljs-comment&quot;&gt;// Define a template with placeholders {adjective} and {topic}&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-type&quot;&gt;PromptTemplate&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;template&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;PromptTemplate&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Tell me a {adjective} joke about {topic}.&quot;&lt;/span&gt;);&lt;br /&gt;    &lt;span class=&quot;hljs-comment&quot;&gt;// Fill in the placeholders&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-type&quot;&gt;Prompt&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;prompt&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; template.create(Map.of(&lt;span class=&quot;hljs-string&quot;&gt;&quot;adjective&quot;&lt;/span&gt;, adjective, &lt;span class=&quot;hljs-string&quot;&gt;&quot;topic&quot;&lt;/span&gt;, topic));&lt;br /&gt;    &lt;span class=&quot;hljs-comment&quot;&gt;// Call the AI model with the templated prompt&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; chatClient&lt;br /&gt;              .call(prompt)&lt;br /&gt;              .getResult()&lt;br /&gt;              .getOutput()&lt;br /&gt;              .getContent();&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;1769&quot;&gt;This &lt;code class=&quot;markup--code markup--p-code&quot;&gt;PromptTemplate&lt;/code&gt; example comes from the Spring AI docs. It produces prompts like “Tell me a &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;funny&lt;/strong&gt; joke about &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;cats&lt;/strong&gt;.” You just change the template and variables – no string concatenation needed.&lt;/p&gt;&lt;blockquote class=&quot;graf graf--blockquote&quot; name=&quot;efd8&quot;&gt;&lt;strong class=&quot;markup--strong markup--blockquote-strong&quot;&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt;Tip:&lt;/em&gt;&lt;/strong&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt; &lt;/em&gt;&lt;strong class=&quot;markup--strong markup--blockquote-strong&quot;&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt;Prompt templates are great for maintenance.&lt;/em&gt;&lt;/strong&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt; You can store templates in files or constants and reuse them. It also avoids injection issues with raw user input. Spring AI automatically adds any special instructions needed for output formatting (if you ask for structured data) when using &lt;/em&gt;&lt;code class=&quot;markup--code markup--blockquote-code&quot;&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt;entity()&lt;/em&gt;&lt;/code&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt; or converters.&lt;/em&gt;&lt;/blockquote&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;6281&quot;&gt;Handling the AI&amp;nbsp;Response&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;0a7e&quot;&gt;Spring AI lets you extract just the text or get the full response metadata. In the above examples we used&amp;nbsp;&lt;code class=&quot;markup--code markup--p-code&quot;&gt;.content()&lt;/code&gt; to get the plain string. Under the hood, Spring AI’s&amp;nbsp;&lt;code class=&quot;markup--code markup--p-code&quot;&gt;.call()&lt;/code&gt; returned a &lt;code class=&quot;markup--code markup--p-code&quot;&gt;ChatResponse&lt;/code&gt; object with details. If you need more control (e.g. token usage, model name, etc.), you can get the full response. For example:&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;java&quot; data-code-block-mode=&quot;2&quot; name=&quot;e649&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-type&quot;&gt;ChatResponse&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;response&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; chatClient&lt;br /&gt;                            .prompt()&lt;br /&gt;                            .user(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Tell me a simple joke&quot;&lt;/span&gt;)&lt;br /&gt;                            .call()&lt;br /&gt;                            .response(); &lt;span class=&quot;hljs-comment&quot;&gt;// get full ChatResponse&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;hljs-type&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;joke&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; response.getResult().getOutput().getContent();&lt;br /&gt;System.out.println(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Model used: &quot;&lt;/span&gt; + response.getMetadata().getModel());&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;14cc&quot;&gt;Here, &lt;code class=&quot;markup--code markup--p-code&quot;&gt;response.getResult().getOutput().getContent()&lt;/code&gt; is the joke text, and &lt;code class=&quot;markup--code markup--p-code&quot;&gt;response.getMetadata()&lt;/code&gt; has info like the model name and token counts.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;4f7d&quot;&gt;Error Handling&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;40bd&quot;&gt;AI calls can fail (network issues, rate limits, invalid input, etc.). Wrap your calls in a &lt;code class=&quot;markup--code markup--p-code&quot;&gt;try-catch&lt;/code&gt; to handle errors gracefully. Spring AI provides a common exception for API errors: &lt;code class=&quot;markup--code markup--p-code&quot;&gt;OpenAiApiClientErrorException&lt;/code&gt; (and equivalents for other providers). For example:&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;java&quot; data-code-block-mode=&quot;2&quot; name=&quot;8413&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;try&lt;/span&gt; {&lt;br /&gt;    &lt;span class=&quot;hljs-type&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;answer&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; chatClient.prompt()&lt;br /&gt;                             .user(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Hello world&quot;&lt;/span&gt;)&lt;br /&gt;                             .call()&lt;br /&gt;                             .content();&lt;br /&gt;    &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; answer;&lt;br /&gt;}&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;catch&lt;/span&gt; (OpenAiApiClientErrorException ex) {&lt;br /&gt;    &lt;span class=&quot;hljs-comment&quot;&gt;// Handle API error (e.g., log and return a default message)&lt;/span&gt;&lt;br /&gt;    System.err.println(&lt;span class=&quot;hljs-string&quot;&gt;&quot;AI call failed: &quot;&lt;/span&gt; + ex.getMessage());&lt;br /&gt;    &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;Sorry, I couldn&#39;t get a response right now.&quot;&lt;/span&gt;;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;aee8&quot;&gt;This catches all OpenAI-related errors in one place&lt;a class=&quot;markup--anchor markup--p-anchor&quot; data-href=&quot;https://www.baeldung.com/spring-ai#:~:text=Additionally%2C%20as%20with%20communication%20with,abstraction%20over%20all%20OpenAI%20errors&quot; href=&quot;https://www.baeldung.com/spring-ai#:~:text=Additionally%2C%20as%20with%20communication%20with,abstraction%20over%20all%20OpenAI%20errors&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;baeldung.com&lt;/a&gt;. You could also catch the generic &lt;code class=&quot;markup--code markup--p-code&quot;&gt;ChatClientException&lt;/code&gt; or use Spring’s &lt;code class=&quot;markup--code markup--p-code&quot;&gt;@ControllerAdvice&lt;/code&gt; to map exceptions to HTTP error responses.&lt;/p&gt;&lt;blockquote class=&quot;graf graf--blockquote&quot; name=&quot;6542&quot;&gt;&lt;strong class=&quot;markup--strong markup--blockquote-strong&quot;&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt;Tip:&lt;/em&gt;&lt;/strong&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt; &lt;/em&gt;&lt;strong class=&quot;markup--strong markup--blockquote-strong&quot;&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt;Always validate user input.&lt;/em&gt;&lt;/strong&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt; Do basic checks (e.g., not empty) before sending to the model, to avoid unexpected failures.&lt;/em&gt;&lt;/blockquote&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;46f5&quot;&gt;Adding Logging for Debugging&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;52b1&quot;&gt;Logging is crucial for debugging AI prompts and responses. For simple cases, you can print or log in your code. For example, using SLF4J:&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;java&quot; data-code-block-mode=&quot;1&quot; name=&quot;a417&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.slf4j.Logger;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.slf4j.LoggerFactory;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;hljs-meta&quot;&gt;@RestController&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;ChatController&lt;/span&gt; {&lt;br /&gt;    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;hljs-type&quot;&gt;Logger&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;log&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; LoggerFactory.getLogger(ChatController.class);&lt;br /&gt;    &lt;span class=&quot;hljs-comment&quot;&gt;// ...&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; String &lt;span class=&quot;hljs-title function_&quot;&gt;getJoke&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(...)&lt;/span&gt; {&lt;br /&gt;        &lt;span class=&quot;hljs-type&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;prompt&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;Tell me a joke about &quot;&lt;/span&gt; + topic;&lt;br /&gt;        log.info(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Sending prompt to AI: {}&quot;&lt;/span&gt;, prompt);&lt;br /&gt;        &lt;span class=&quot;hljs-type&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;answer&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; chatClient.prompt().user(prompt).call().content();&lt;br /&gt;        log.info(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Received response: {}&quot;&lt;/span&gt;, answer);&lt;br /&gt;        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; answer;&lt;br /&gt;    }&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;f5b3&quot;&gt;Spring AI also has built-in observability. You can enable logging of prompts and completions via properties&amp;nbsp;:&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;ini&quot; data-code-block-mode=&quot;1&quot; name=&quot;4d41&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-attr&quot;&gt;spring.ai.chat.client.observations.log-prompt&lt;/span&gt;=&lt;span class=&quot;hljs-literal&quot;&gt;true&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;hljs-attr&quot;&gt;spring.ai.chat.client.observations.log-completion&lt;/span&gt;=&lt;span class=&quot;hljs-literal&quot;&gt;true&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;bf6d&quot;&gt;By default these are false (to avoid accidentally logging sensitive info). Turn them on in development or debugging to see exactly what gets sent and received.&lt;/p&gt;&lt;blockquote class=&quot;graf graf--blockquote&quot; name=&quot;ef0a&quot;&gt;&lt;strong class=&quot;markup--strong markup--blockquote-strong&quot;&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt;Tip:&lt;/em&gt;&lt;/strong&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt; Consider using Spring Boot Actuator and Micrometer to collect metrics (Spring AI provides metrics for calls). But for beginners, simple logs (or the built-in observers) are a good start.&lt;/em&gt;&lt;/blockquote&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;c74d&quot;&gt;Testing the API with Postman or&amp;nbsp;curl&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;bf27&quot;&gt;With the app running, test your endpoints just like any REST API. For example, if you used the above controller:&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;ee60&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Using curl:&lt;/strong&gt;&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;32fb&quot;&gt;&lt;code class=&quot;markup--code markup--p-code&quot;&gt;curl &quot;http://localhost:8080/ai/simple-joke?topic=java&quot;&lt;/code&gt;&lt;/p&gt;&lt;ul class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;7f79&quot;&gt;This might return something like &lt;code class=&quot;markup--code markup--li-code&quot;&gt;&quot;A SQL query walks into a bar, walks up to two tables and asks: &#39;Can I join you?&#39;&quot;&lt;/code&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;c30b&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Using Postman:&lt;/strong&gt;&lt;/p&gt;&lt;ul class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;e84d&quot;&gt;Send a GET to &lt;code class=&quot;markup--code markup--li-code&quot;&gt;http://localhost:8080/ai/simple-joke&lt;/code&gt; with query param &lt;code class=&quot;markup--code markup--li-code&quot;&gt;topic=java&lt;/code&gt;.&lt;/li&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;5bb6&quot;&gt;You should get a JSON/string response with the joke.&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;065e&quot;&gt;If you built the ChatService example (from [18]):&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;bash&quot; data-code-block-mode=&quot;1&quot; name=&quot;2bed&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;curl &lt;span class=&quot;hljs-string&quot;&gt;&quot;http://localhost:8080/ai/chat?prompt=Hello&quot;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;d9c3&quot;&gt;It will return the AI’s answer in JSON. (The exact URL depends on your mappings.)&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;571b&quot;&gt;Check your console logs to see the prompt and response printed (if you added logging).&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;f23f&quot;&gt;Deploying Locally&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;76e5&quot;&gt;For local testing (no Docker needed), you can run the Spring Boot app directly:&lt;/p&gt;&lt;ol class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;0ab4&quot;&gt;&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Run via Maven:&lt;/strong&gt;&lt;/li&gt;&lt;/ol&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;bash&quot; data-code-block-mode=&quot;2&quot; name=&quot;a1ed&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;mvn spring-boot:run&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;5470&quot;&gt;This will compile and start the app on port 8080 by default.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;1bb5&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;2. Run the JAR:&lt;/strong&gt;&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;bash&quot; data-code-block-mode=&quot;1&quot; name=&quot;c19a&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;mvn clean package&lt;br /&gt;java -jar target/your-app-name-0.0.1-SNAPSHOT.jar&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;6e64&quot;&gt;(Replace the JAR name as built.) The embedded Tomcat will start and serve your APIs.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;819e&quot;&gt;Before running, ensure the &lt;code class=&quot;markup--code markup--p-code&quot;&gt;OPENAI_API_KEY&lt;/code&gt; environment variable is set in that shell/session (or set the property in &lt;code class=&quot;markup--code markup--p-code&quot;&gt;application.properties&lt;/code&gt; if you prefer, though env var is safer). Once running, open &lt;code class=&quot;markup--code markup--p-code&quot;&gt;http://localhost:8080/&lt;/code&gt; in a browser or use curl/Postman as above.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;3f0c&quot;&gt;No special deployment steps are needed beyond a normal Spring Boot app — it’s just another web application with an extra AI client.&lt;/p&gt;&lt;h3 class=&quot;graf graf--h3&quot; name=&quot;57c3&quot;&gt;Bonus: Switching from OpenAI to Hugging&amp;nbsp;Face&lt;/h3&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;7fd6&quot;&gt;One of Spring AI’s advantages is easy switching between providers. To use a Hugging Face Inference API instead of OpenAI:&lt;/p&gt;&lt;ol class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;830a&quot;&gt;&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Add the Hugging Face starter&lt;/strong&gt; to your &lt;code class=&quot;markup--code markup--li-code&quot;&gt;pom.xml&lt;/code&gt; (instead of or in addition to the OpenAI one)&lt;/li&gt;&lt;/ol&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;xml&quot; data-code-block-mode=&quot;1&quot; name=&quot;30ae&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;dependency&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;groupId&lt;/span&gt;&amp;gt;&lt;/span&gt;org.springframework.ai&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;groupId&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;artifactId&lt;/span&gt;&amp;gt;&lt;/span&gt;spring-ai-huggingface-spring-boot-starter&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;artifactId&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-comment&quot;&gt;&amp;lt;!-- or spring-ai-starter-model-huggingface in some versions --&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;dependency&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;6c1c&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;2. Configure the Hugging Face endpoint and key&lt;/strong&gt; in &lt;code class=&quot;markup--code markup--p-code&quot;&gt;application.properties&lt;/code&gt;:&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;ini&quot; data-code-block-mode=&quot;1&quot; name=&quot;166d&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-attr&quot;&gt;spring.ai.huggingface.chat.api-key&lt;/span&gt;=&lt;span class=&quot;hljs-variable&quot;&gt;${HUGGINGFACE_API_KEY}&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;hljs-attr&quot;&gt;spring.ai.huggingface.chat.url&lt;/span&gt;=https://api-inference.huggingface.co/models/your-model&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;9c0b&quot;&gt;You need a Hugging Face Inference API token (&lt;code class=&quot;markup--code markup--p-code&quot;&gt;HUGGINGFACE_API_KEY&lt;/code&gt;) and the inference URL for your model endpoint.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;dd78&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;3. Use the Hugging Face client in code:&lt;/strong&gt; The starter auto-configures a &lt;code class=&quot;markup--code markup--p-code&quot;&gt;HuggingfaceChatModel&lt;/code&gt; bean. You can inject it directly, as in this example from the docs&amp;nbsp;:&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;java&quot; data-code-block-mode=&quot;2&quot; name=&quot;afa0&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-meta&quot;&gt;@RestController&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;HuggingChatController&lt;/span&gt; {&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;final&lt;/span&gt; HuggingfaceChatModel chatModel;&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-title function_&quot;&gt;HuggingChatController&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(HuggingfaceChatModel chatModel)&lt;/span&gt; {&lt;br /&gt;        &lt;span class=&quot;hljs-built_in&quot;&gt;this&lt;/span&gt;.chatModel = chatModel;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-meta&quot;&gt;@GetMapping(&quot;/ai/generate&quot;)&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; Map&amp;lt;String, String&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;generate&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(&lt;span class=&quot;hljs-meta&quot;&gt;@RequestParam(defaultValue = &quot;Hello&quot;)&lt;/span&gt; String message)&lt;/span&gt; {&lt;br /&gt;        &lt;span class=&quot;hljs-type&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;output&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;this&lt;/span&gt;.chatModel.call(message);&lt;br /&gt;        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; Map.of(&lt;span class=&quot;hljs-string&quot;&gt;&quot;output&quot;&lt;/span&gt;, output);&lt;br /&gt;    }&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;2b56&quot;&gt;This works the same way, but under the covers it calls the Hugging Face endpoint. No need to change the rest of your app code.&lt;/p&gt;&lt;blockquote class=&quot;graf graf--blockquote&quot; name=&quot;d0e1&quot;&gt;&lt;strong class=&quot;markup--strong markup--blockquote-strong&quot;&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt;Tip:&lt;/em&gt;&lt;/strong&gt;&lt;em class=&quot;markup--em markup--blockquote-em&quot;&gt; To swap providers, you really only change the dependency and config. Your service logic stays identical. This “write once, switch easily” capability is one of Spring AI’s core benefits&lt;/em&gt;&lt;/blockquote&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;3f85&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Too Long; Didn’t Read&lt;/strong&gt;&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;3700&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Introduction:&lt;/strong&gt; &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Spring AI&lt;/strong&gt; is a &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Spring-friendly way&lt;/strong&gt; to call &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;LLMs (OpenAI, HuggingFace, etc.)&lt;/strong&gt; in your &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Java apps&lt;/strong&gt;. It saves you from manual &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;HTTP calls&lt;/strong&gt; and &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;JSON handling&lt;/strong&gt;.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;f544&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Setup:&lt;/strong&gt; Create a &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Spring Boot project (Java 21+, Spring Boot 3.2+)&lt;/strong&gt;. Add &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;spring-ai-boot-starter&lt;/strong&gt; and &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;spring-ai-openai-starter&lt;/strong&gt; (or the appropriate provider starter) to your &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;pom.xml&lt;/strong&gt;.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;fa96&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;API Key:&lt;/strong&gt; In &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;application.properties&lt;/strong&gt;, set &lt;code class=&quot;markup--code markup--p-code&quot;&gt;spring.ai.openai.api-key=${OPENAI_API_KEY}&lt;/code&gt; (and &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;model, temperature&lt;/strong&gt;) to point to your &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;OpenAI key&lt;/strong&gt;.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;4f51&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Controller:&lt;/strong&gt; Inject &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;ChatClient&lt;/strong&gt; (via &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;ChatClient.Builder&lt;/strong&gt;), then in your endpoint do:&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;java&quot; data-code-block-mode=&quot;2&quot; name=&quot;4aac&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;chatClient.prompt().user(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Your prompt here&quot;&lt;/span&gt;).call().content();&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;2d55&quot;&gt;This sends the prompt to the AI and gets a String reply.&lt;/p&gt;&lt;ul class=&quot;postList&quot;&gt;&lt;li class=&quot;graf graf--li&quot; name=&quot;bc97&quot;&gt;&lt;strong class=&quot;markup--strong markup--li-strong&quot;&gt;Prompt Templates:&lt;/strong&gt; Use &lt;code class=&quot;markup--code markup--li-code&quot;&gt;PromptTemplate&lt;/code&gt; for dynamic prompts. E.g.&lt;/li&gt;&lt;/ul&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;java&quot; data-code-block-mode=&quot;2&quot; name=&quot;9154&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;&lt;span class=&quot;hljs-type&quot;&gt;PromptTemplate&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;template&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;PromptTemplate&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Tell me a {adj} joke about {topic}.&quot;&lt;/span&gt;);&lt;br /&gt;&lt;span class=&quot;hljs-type&quot;&gt;Prompt&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;prompt&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; template.create(Map.of(&lt;span class=&quot;hljs-string&quot;&gt;&quot;adj&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;funny&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;topic&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;cats&quot;&lt;/span&gt;));&lt;br /&gt;&lt;span class=&quot;hljs-type&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;answer&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; chatClient.call(prompt).getResult().getOutput().getContent();&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;27f0&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Handling Responses:&lt;/strong&gt;&amp;nbsp;&lt;code class=&quot;markup--code markup--p-code&quot;&gt;.content()&lt;/code&gt; gives the &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;text&lt;/strong&gt;. Use&amp;nbsp;&lt;code class=&quot;markup--code markup--p-code&quot;&gt;.response()&lt;/code&gt; to get &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;ChatResponse&lt;/strong&gt; with &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;metadata&lt;/strong&gt;. Wrap calls in &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;try-catch&lt;/strong&gt; to handle errors (&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Spring AI&lt;/strong&gt; throws &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;OpenAiApiClientErrorException&lt;/strong&gt; on &lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;API failures&lt;/strong&gt;).&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;02d3&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Logging:&lt;/strong&gt; Use a logger (or enable Spring AI observability) to log prompts and responses for debugging.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;be88&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Testing:&lt;/strong&gt; Run the app and test with Postman or &lt;code class=&quot;markup--code markup--p-code&quot;&gt;curl&lt;/code&gt;. E.g.:&lt;/p&gt;&lt;pre class=&quot;graf graf--pre graf--preV2&quot; data-code-block-lang=&quot;bash&quot; data-code-block-mode=&quot;1&quot; name=&quot;23e7&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot;pre--content&quot;&gt;curl &lt;span class=&quot;hljs-string&quot;&gt;&quot;http://localhost:8080/ai/simple-joke?topic=java&quot;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;3dbc&quot;&gt;You should see the AI’s generated text in the response.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;5386&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Running Locally:&lt;/strong&gt; Just run with &lt;code class=&quot;markup--code markup--p-code&quot;&gt;mvn spring-boot:run&lt;/code&gt; or build a jar and &lt;code class=&quot;markup--code markup--p-code&quot;&gt;java -jar&lt;/code&gt;. Ensure the &lt;code class=&quot;markup--code markup--p-code&quot;&gt;OPENAI_API_KEY&lt;/code&gt; env var is set. The app will serve on port 8080 by default.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;6342&quot;&gt;&lt;strong class=&quot;markup--strong markup--p-strong&quot;&gt;Bonus — Switch to Hugging Face:&lt;/strong&gt; Replace the OpenAI starter with &lt;code class=&quot;markup--code markup--p-code&quot;&gt;spring-ai-huggingface-spring-boot-starter&lt;/code&gt;, and in &lt;code class=&quot;markup--code markup--p-code&quot;&gt;application.properties&lt;/code&gt; set &lt;code class=&quot;markup--code markup--p-code&quot;&gt;spring.ai.huggingface.chat.api-key&lt;/code&gt; and &lt;code class=&quot;markup--code markup--p-code&quot;&gt;spring.ai.huggingface.chat.url&lt;/code&gt; as documented. Inject &lt;code class=&quot;markup--code markup--p-code&quot;&gt;HuggingfaceChatModel&lt;/code&gt; in your code and call it just like &lt;code class=&quot;markup--code markup--p-code&quot;&gt;ChatClient&lt;/code&gt;.&lt;/p&gt;&lt;p class=&quot;graf graf--p&quot; name=&quot;cc4f&quot;&gt;Spring AI brings AI into Spring Boot in a familiar way, so you can focus on your application logic instead of plumbing. With these steps, you’ve built a basic AI-powered Spring app. From here, you can explore more Spring AI features — structured outputs, embeddings, RAG, and more — as your AI needs grow.&lt;/p&gt;</description><link>https://value2read.blogspot.com/2025/11/how-to-build-your-first-ai-powered-java.html</link><author>noreply@blogger.com (Online Shopping)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-4469695118576160644</guid><pubDate>Sat, 29 Nov 2025 08:11:00 +0000</pubDate><atom:updated>2025-11-29T00:11:35.530-08:00</atom:updated><title>20W Apple MFi Certified Lightning Charger (HB‑AL6A013) (iPhone 8 and newer, many iPhone 11/12/13/14 models, iPads with Lightning ports, etc.).</title><description>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
  &lt;meta charset=&quot;UTF-8&quot; /&gt;
  &lt;title&gt;Lightning 20W Apple MFi Certified Charger Review (HB-AL6A013)&lt;/title&gt;
  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot; /&gt;
  &lt;meta name=&quot;description&quot; content=&quot;In-depth review of the Lightning 20W Apple MFi Certified Charger (HB-AL6A013). See features, benefits, pros &amp; cons, and why it’s a great fast charger for iPhone and iPad users.&quot; /&gt;
  &lt;style&gt;
    body { font-family: Arial, sans-serif; line-height: 1.7; background:#f5f5f5; margin:0; padding:0; }
    .container { max-width: 960px; margin:0 auto; background:#fff; padding:20px 16px 40px; }
    h1,h2,h3,h4 { color:#111; }
    .product-hero { display:flex; flex-wrap:wrap; gap:20px; margin-bottom:30px; }
    .product-hero img { max-width:280px; width:100%; border-radius:8px; border:1px solid #ddd; }
    .badge { background:#ff9900; padding:4px 10px; border-radius:20px; font-size:12px; font-weight:bold; }
    .price { font-size:20px; font-weight:bold; color:#b12704; }
    .cta-btn { display:inline-block; background:#ff9900; padding:12px 22px; text-decoration:none; font-weight:bold; border-radius:6px; color:#111; }
    .cta-btn:hover { background:#f0a000; }
    .highlight-box { background:#f9f9f9; border-left:4px solid #ff9900; padding:16px; margin:20px 0; }
    ul { padding-left:20px; }
    table { width:100%; border-collapse:collapse; margin:20px 0; }
    table th,table td { border:1px solid #ddd; padding:10px; }
    table th { background:#fafafa; }
    .image-gallery { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:16px; margin:24px 0; }
    .image-gallery img { border-radius:8px; border:1px solid #ddd; width:100%; }
    .image-gallery figcaption { font-size:13px; color:#555; margin-top:6px; text-align:center; }
    .disclaimer { font-size:13px; background:#fff8e1; border:1px solid #ffe082; padding:12px; margin-top:30px; border-radius:4px; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;container&quot;&gt;

&lt;article&gt;
&lt;header&gt;
  &lt;span class=&quot;badge&quot;&gt;Fast Charging · MFi Certified&lt;/span&gt;
  &lt;h1&gt;Lightning 20W Apple MFi Certified Charger (HB-AL6A013) – Fast, Reliable Charging for Your iPhone &amp; iPad&lt;/h1&gt;
  &lt;p&gt;This review covers everything you need to know about the Lightning 20W Apple MFi Certified Charger (HB-AL6A013) — including build, speed, safety, pros &amp; cons, and why it’s a great fast charger for Apple users.&lt;/p&gt;
&lt;/header&gt;

&lt;!-- HERO --&gt;
&lt;section class=&quot;product-hero&quot;&gt;
  &lt;div&gt;
    &lt;img src=&quot;https://m.media-amazon.com/images/I/41qQTnIZovL._AC_UF1000,1000_QL80_.jpg&quot;/&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;h2&gt;Quick Product Snapshot&lt;/h2&gt;
    &lt;p&gt;&lt;strong&gt;Product:&lt;/strong&gt; Lightning 20W Apple MFi Certified Fast Charger&lt;/p&gt;
    &lt;p&gt;&lt;strong&gt;Model:&lt;/strong&gt; HB-AL6A013&lt;/p&gt;
    &lt;p&gt;&lt;strong&gt;Suitable for:&lt;/strong&gt; iPhone &amp; iPad with Lightning ports&lt;/p&gt;

    &lt;p class=&quot;price&quot;&gt;Approx. Price: ₹1,000 – ₹1,500&lt;/p&gt;

    &lt;!-- BUY BUTTON --&gt;
    &lt;a class=&quot;cta-btn&quot; href=&quot;https://www.amazon.in/Lightning-20W-Apple-MFi-Certified-Compatible-HB-AL6A013/dp/B0DZHXTPK1?&amp;linkCode=ll1&amp;tag=hrgwsrm-21&amp;linkId=ace80a7d1bc6cfbab21de1444a1785d1&amp;language=en_IN&amp;ref_=as_li_ss_tl&quot; 
       target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;🛒 Buy Now on Amazon&lt;/a&gt;

    &lt;div class=&quot;highlight-box&quot;&gt;
      &lt;strong&gt;Key Highlights:&lt;/strong&gt;
      &lt;ul&gt;
        &lt;li&gt;20W USB-C Power Delivery Fast Charging&lt;/li&gt;
        &lt;li&gt;Apple MFi Certified (Safe &amp; Reliable)&lt;/li&gt;
        &lt;li&gt;Compact, Travel-Friendly Size&lt;/li&gt;
        &lt;li&gt;Ideal as Main or Backup Charger&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/section&gt;

&lt;!-- IMAGE GALLERY --&gt;
&lt;h2&gt;Product Images&lt;/h2&gt;
&lt;div class=&quot;image-gallery&quot;&gt;
  &lt;figure&gt;
    &lt;img src=&quot;https://m.media-amazon.com/images/I/41owOc2VaHL.jpg&quot;/&gt;
    &lt;figcaption&gt;Compact and minimal Apple-friendly design&lt;/figcaption&gt;
  &lt;/figure&gt;
  &lt;figure&gt;
    &lt;img src=&quot;https://m.media-amazon.com/images/I/61x3xEevzML.jpg&quot;/&gt;
    &lt;figcaption&gt;Includes USB-C to Lightning cable&lt;/figcaption&gt;
  &lt;/figure&gt;
  &lt;figure&gt;
    &lt;img src=&quot;https://m.media-amazon.com/images/I/51vZ6F9sHhL._AC_UF894,1000_QL80_.jpg&quot;/&gt;
    &lt;figcaption&gt;Secure Lightning connector optimized for Apple devices&lt;/figcaption&gt;
  &lt;/figure&gt;
&lt;/div&gt;

&lt;!-- BUY BUTTON --&gt;
&lt;p&gt;
  &lt;a class=&quot;cta-btn&quot; href=&quot;https://www.amazon.in/Lightning-20W-Apple-MFi-Certified-Compatible-HB-AL6A013/dp/B0DZHXTPK1?&amp;linkCode=ll1&amp;tag=hrgwsrm-21&amp;linkId=ace80a7d1bc6cfbab21de1444a1785d1&amp;language=en_IN&amp;ref_=as_li_ss_tl&quot; 
     target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;🛒 Check Full Details on Amazon&lt;/a&gt;
&lt;/p&gt;

&lt;!-- FEATURES --&gt;
&lt;h2&gt;Why This Charger Is Worth Buying&lt;/h2&gt;

&lt;h3&gt;1. 20W Fast Charging&lt;/h3&gt;
&lt;p&gt;Charge your iPhone significantly faster than old 5W chargers. Great when you’re rushing to work, college, or travel.&lt;/p&gt;

&lt;h3&gt;2. MFi Certified for Safety&lt;/h3&gt;
&lt;p&gt;Since it&#39;s Apple MFi certified, it prevents compatibility issues and keeps your device safe from voltage spikes.&lt;/p&gt;

&lt;h3&gt;3. Wide Device Compatibility&lt;/h3&gt;
&lt;p&gt;Works with iPhone 8 to iPhone 14 series, iPads with Lightning port, and AirPods charging cases.&lt;/p&gt;

&lt;h3&gt;4. Portable &amp; Durable&lt;/h3&gt;
&lt;p&gt;Lightweight, compact, and perfect for everyday charging or travel use.&lt;/p&gt;

&lt;h3&gt;5. Great Backup or Primary Charger&lt;/h3&gt;
&lt;p&gt;Ideal as a replacement, secondary charger, or an affordable MFi-certified option.&lt;/p&gt;

&lt;!-- PROS VS CONS --&gt;
&lt;h2&gt;Pros &amp; Cons&lt;/h2&gt;
&lt;table&gt;
  &lt;tr&gt;
    &lt;th&gt;Pros&lt;/th&gt;
    &lt;th&gt;Cons&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;
      &lt;ul&gt;
        &lt;li&gt;Fast, efficient 20W charging&lt;/li&gt;
        &lt;li&gt;MFi certified (safe &amp; Apple-approved)&lt;/li&gt;
        &lt;li&gt;Compact design&lt;/li&gt;
        &lt;li&gt;Affordable alternative to Apple chargers&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/td&gt;
    &lt;td&gt;
      &lt;ul&gt;
        &lt;li&gt;Only for Lightning devices (not iPhone 15 series)&lt;/li&gt;
        &lt;li&gt;Cable length may vary&lt;/li&gt;
        &lt;li&gt;Build quality differs from official Apple chargers&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- BUY NOW AGAIN --&gt;
&lt;h2&gt;Buy the Lightning 20W MFi Certified Charger&lt;/h2&gt;
&lt;p&gt;
  For fast, safe, and reliable iPhone/iPad charging, this charger is a solid value purchase.
&lt;/p&gt;

&lt;a class=&quot;cta-btn&quot; 
   href=&quot;https://www.amazon.in/Lightning-20W-Apple-MFi-Certified-Compatible-HB-AL6A013/dp/B0DZHXTPK1?&amp;linkCode=ll1&amp;tag=hrgwsrm-21&amp;linkId=ace80a7d1bc6cfbab21de1444a1785d1&amp;language=en_IN&amp;ref_=as_li_ss_tl&quot;
   target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;🛒 Buy Now on Amazon&lt;/a&gt;

&lt;!-- DISCLOSURE --&gt;
&lt;div class=&quot;disclaimer&quot;&gt;
  &lt;strong&gt;Affiliate Disclosure:&lt;/strong&gt; This post contains affiliate links. As an Amazon Associate I earn from qualifying purchases at no extra cost to you.
&lt;/div&gt;

&lt;/article&gt;

&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</description><link>https://value2read.blogspot.com/2025/11/20w-apple-mfi-certified-lightning.html</link><author>noreply@blogger.com (Online Shopping)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-5944169978805970639</guid><pubDate>Sat, 22 Nov 2025 13:42:00 +0000</pubDate><atom:updated>2025-11-22T05:42:41.322-08:00</atom:updated><title>How to connect a Spring Boot application to MongoDB?</title><description>&lt;p&gt;&lt;span style=&quot;background-color: white; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.06px;&quot;&gt;Connecting Spring Boot to MongoDB is a very common task for modern Java apps.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: white; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.06px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: white; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.06px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhuczTrKkX0w2tbrREuFBiXziSYy7GRGbLgnPx0iM9RyBukpaQvI7MlHqVhGZK9fKiqjnCkCD02hN-yguLHxP5au8pqksBNSHumvqiAoQfYmSwb8eBmnG8QSL3Zv9I767f9Kvo2ciBidjfn0HUKy5TyoPi8Lxx9tZcC2XAtpcMG-t26jxTJBCD_ztdWOuw&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;683&quot; data-original-width=&quot;1024&quot; height=&quot;266&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhuczTrKkX0w2tbrREuFBiXziSYy7GRGbLgnPx0iM9RyBukpaQvI7MlHqVhGZK9fKiqjnCkCD02hN-yguLHxP5au8pqksBNSHumvqiAoQfYmSwb8eBmnG8QSL3Zv9I767f9Kvo2ciBidjfn0HUKy5TyoPi8Lxx9tZcC2XAtpcMG-t26jxTJBCD_ztdWOuw=w400-h266&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;51d5&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;This guide walks you through everything you need: project setup (Maven/Gradle), configuration, domain mapping, repositories (Spring Data MongoDB), advanced options (MongoTemplate, transactions), local development with Docker, testing, troubleshooting, and security tips. I’ll include runnable code snippets so you can copy-paste and get started quickly.&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;6c46&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;span class=&quot;xp kh&quot; style=&quot;box-sizing: inherit; font-weight: 700;&quot;&gt;What you’ll learn&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;8bc9&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;• Required dependencies (Maven &amp;amp; Gradle)&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;4ba3&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;• application.properties / application.yml examples (local, auth, replica set)&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;302e&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;• Domain classes and repositories using Spring Data MongoRepository&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;00d6&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;• Using MongoTemplate and custom queries&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;fdde&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;• Enabling and using transactions&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;5786&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;• Running MongoDB locally with Docker (including a single-node replica set)&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;7284&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;• Integration testing with embedded MongoDB (Flapdoodle)&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;89d5&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;• Common problems and fixes, plus security best practices&lt;/p&gt;&lt;h2 class=&quot;zh zi tj bg zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz aba abb abc abd abe bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;bded&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: sohne, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 24px; letter-spacing: -0.016em; line-height: 30px; margin: 1.95em 0px -0.28em;&quot;&gt;Prerequisites&lt;/h2&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq abf xs xt xu abg xw xx xy abh ya yb yc abi ye yf yg abj yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;4302&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 0.94em 0px -0.46em; word-break: break-word;&quot;&gt;• Java 11+ (or Java 8 if you must; modern Spring Boot prefers 11+)&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;e812&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;• Maven or Gradle&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;5693&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;• Spring Boot (2.5+ or 3.x — examples assume Spring Boot starters)&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;e2d8&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;• MongoDB server (local, Docker, or managed cloud like Atlas)&lt;/p&gt;&lt;h2 class=&quot;zh zi tj bg zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz aba abb abc abd abe bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;4009&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: sohne, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 24px; letter-spacing: -0.016em; line-height: 30px; margin: 1.95em 0px -0.28em;&quot;&gt;1 — Add dependencies&lt;/h2&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq abf xs xt xu abg xw xx xy abh ya yb yc abi ye yf yg abj yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;37a1&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 0.94em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;span class=&quot;xp kh&quot; style=&quot;box-sizing: inherit; font-weight: 700;&quot;&gt;Maven (pom.xml)&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;c45e&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;em class=&quot;zf&quot; style=&quot;box-sizing: inherit;&quot;&gt;&amp;lt;dependencies&amp;gt;&lt;/em&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;8046&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;em class=&quot;zf&quot; style=&quot;box-sizing: inherit;&quot;&gt;&amp;lt;! — Spring Boot starter for web (optional, if building REST API) →&lt;/em&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;2f6f&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;em class=&quot;zf&quot; style=&quot;box-sizing: inherit;&quot;&gt;&amp;lt;dependency&amp;gt;&lt;/em&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;1ffa&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;em class=&quot;zf&quot; style=&quot;box-sizing: inherit;&quot;&gt;&amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;&lt;/em&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;75d9&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;em class=&quot;zf&quot; style=&quot;box-sizing: inherit;&quot;&gt;&amp;lt;artifactId&amp;gt;spring-boot-starter-web&amp;lt;/artifactId&amp;gt;&lt;/em&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;d800&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;em class=&quot;zf&quot; style=&quot;box-sizing: inherit;&quot;&gt;&amp;lt;/dependency&amp;gt;&lt;/em&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;e74e&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&amp;lt;! — Spring Data MongoDB →&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;6186&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&amp;lt;dependency&amp;gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;3ea0&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;0328&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&amp;lt;artifactId&amp;gt;spring-boot-starter-data-mongodb&amp;lt;/artifactId&amp;gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;86b3&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&amp;lt;/dependency&amp;gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;3102&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&amp;lt;! — Optional: embed MongoDB for tests →&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;3bab&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&amp;lt;dependency&amp;gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;ef7b&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&amp;lt;groupId&amp;gt;de.flapdoodle.embed&amp;lt;/groupId&amp;gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;2d51&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&amp;lt;artifactId&amp;gt;de.flapdoodle.embed.mongo&amp;lt;/artifactId&amp;gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;1610&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;7640&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&amp;lt;/dependency&amp;gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;32e2&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&amp;lt;/dependencies&amp;gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;b7fe&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;span class=&quot;xp kh&quot; style=&quot;box-sizing: inherit; font-weight: 700;&quot;&gt;Gradle (build.gradle.kts)&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;f422&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;dependencies {&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;9f21&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;implementation(“org.springframework.boot:spring-boot-starter-web”)&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;5518&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;implementation(“org.springframework.boot:spring-boot-starter-data-mongodb”)&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;796d&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;testImplementation(“de.flapdoodle.embed:de.flapdoodle.embed.mongo”)&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;1a10&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;}&lt;/p&gt;&lt;h2 class=&quot;zh zi tj bg zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz aba abb abc abd abe bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;12b2&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: sohne, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 24px; letter-spacing: -0.016em; line-height: 30px; margin: 1.95em 0px -0.28em;&quot;&gt;2 — Configure connection (application.properties / application.yml)&lt;/h2&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq abf xs xt xu abg xw xx xy abh ya yb yc abi ye yf yg abj yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;f27c&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 0.94em 0px -0.46em; word-break: break-word;&quot;&gt;You can put your connection string in application.properties or application.yml. It’s recommended to use environment variables for credentials in production.&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;c684&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;span class=&quot;xp kh&quot; style=&quot;box-sizing: inherit; font-weight: 700;&quot;&gt;Simple local (no auth) — application.properties&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;cffe&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;spring.data.mongodb.database=mydb&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;2467&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;spring.data.mongodb.uri=mongodb://localhost:27017/mydb&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;10dd&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;span class=&quot;xp kh&quot; style=&quot;box-sizing: inherit; font-weight: 700;&quot;&gt;Using credentials and options&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;a351&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;spring.data.mongodb.uri=mongodb://user:password@localhost:27017/mydb?authSource=admin&amp;amp;retryWrites=true&amp;amp;w=majority&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;1906&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;span class=&quot;xp kh&quot; style=&quot;box-sizing: inherit; font-weight: 700;&quot;&gt;YAML version (application.yml)&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;73f0&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;spring:&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;e40b&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;data:&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;0d75&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;mongodb:&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;a95a&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;uri: mongodb://user:password@localhost:27017/mydb?authSource=admin&amp;amp;retryWrites=true&amp;amp;w=majority&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;9abb&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;span class=&quot;xp kh&quot; style=&quot;box-sizing: inherit; font-weight: 700;&quot;&gt;Replica set (required for transactions)&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;f077&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;spring.data.mongodb.uri=mongodb://user:password@mongo1:27017,mongo2:27017,mongo3:27017/mydb?replicaSet=rs0&amp;amp;retryWrites=true&amp;amp;w=majority&lt;/p&gt;&lt;h2 class=&quot;zh zi tj bg zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz aba abb abc abd abe bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;84e9&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: sohne, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 24px; letter-spacing: -0.016em; line-height: 30px; margin: 1.95em 0px -0.28em;&quot;&gt;3 — Domain model &amp;amp; repository (Spring Data)&lt;/h2&gt;&lt;h2 class=&quot;zh zi tj bg zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz aba abb abc abd abe bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;f108&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: sohne, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 24px; letter-spacing: -0.016em; line-height: 30px; margin: 1.95em 0px -0.28em;&quot;&gt;Example domain class&lt;/h2&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq abf xs xt xu abg xw xx xy abh ya yb yc abi ye yf yg abj yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;e6b4&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 0.94em 0px -0.46em; word-break: break-word;&quot;&gt;package com.example.demo.model;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;20ec&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;import org.springframework.data.annotation.Id;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;34b0&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;import org.springframework.data.mongodb.core.mapping.Document;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;6303&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;import java.time.LocalDateTime;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;0a73&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;@Document(collection = “products”)&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;cef5&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;public class Product {&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;c926&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;@Id&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;484d&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;private String id; // stores MongoDB ObjectId as hex string&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;66cb&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;private String name;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;1b62&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;private String description;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;635e&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;private double price;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;7840&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;private LocalDateTime createdAt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;da11&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;// getters, setters, constructors…&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;9ab9&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;}&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;af2d&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;span class=&quot;xp kh&quot; style=&quot;box-sizing: inherit; font-weight: 700;&quot;&gt;Notes&lt;/span&gt;:&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;ef41&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;Use @Document(collection = “name”) to map the collection.&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;2ec7&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;@Id can be String or org.bson.types.ObjectId. Using String is convenient because Spring converts for you.&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;3147&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;span class=&quot;xp kh&quot; style=&quot;box-sizing: inherit; font-weight: 700;&quot;&gt;Repository interface&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;ed03&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;package com.example.demo.repo;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;e687&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;import com.example.demo.model.Product;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;777c&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;import org.springframework.data.mongodb.repository.MongoRepository;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;e648&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;import java.util.List;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;e87d&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;public interface ProductRepository extends MongoRepository&amp;lt;Product, String&amp;gt; {&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;a2b9&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;List&amp;lt;Product&amp;gt; findByNameContainingIgnoreCase(String nameFragment);&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;4409&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;}&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;359a&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;Spring Data generates implementation automatically. Use typical CRUD methods: save, findById, findAll, deleteById.&lt;/p&gt;&lt;h2 class=&quot;zh zi tj bg zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz aba abb abc abd abe bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;66bc&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: sohne, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 24px; letter-spacing: -0.016em; line-height: 30px; margin: 1.95em 0px -0.28em;&quot;&gt;4 — Service and Controller (example REST CRUD)&lt;/h2&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq abf xs xt xu abg xw xx xy abh ya yb yc abi ye yf yg abj yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;daaa&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 0.94em 0px -0.46em; word-break: break-word;&quot;&gt;Service (simple)&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;b342&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;@Service&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;be24&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;public class ProductService {&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;fca9&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;private final ProductRepository repo;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;10e4&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;public ProductService(ProductRepository repo) { this.repo = repo; }&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;7a99&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;public Product create(Product p) {&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;c374&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;p.setCreatedAt(LocalDateTime.now());&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;bb0f&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;return repo.save(p);&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;ec1d&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;}&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;c728&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;public Optional&amp;lt;Product&amp;gt; getById(String id) { return repo.findById(id); }&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;e78c&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;public List&amp;lt;Product&amp;gt; search(String q) { return repo.findByNameContainingIgnoreCase(q); }&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;cb9e&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;public void delete(String id) { repo.deleteById(id); }&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;efb7&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;}&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;0cf4&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;span class=&quot;xp kh&quot; style=&quot;box-sizing: inherit; font-weight: 700;&quot;&gt;Controller&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;9666&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;@RestController&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;482a&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;@RequestMapping(“/api/products”)&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;ecdf&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;public class ProductController {&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;7861&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;private final ProductService svc;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;c88e&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;public ProductController(ProductService svc) { this.svc = svc; }&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;0eca&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;@PostMapping&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;7161&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;public ResponseEntity&amp;lt;Product&amp;gt; create(@RequestBody Product p) {&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;445f&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;return ResponseEntity.status(HttpStatus.CREATED).body(svc.create(p));&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;3d13&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;}&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;be81&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;@GetMapping(“/{id}”)&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;b49e&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;public ResponseEntity&amp;lt;Product&amp;gt; get(@PathVariable String id) {&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;1479&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;return svc.getById(id).map(ResponseEntity::ok).orElse(ResponseEntity.notFound().build());&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;5294&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;}&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xs xt xu xw xx xy ya yb yc ye yf yg yi yj abk yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;4645&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 24px 0px -0.46em; word-break: break-word;&quot;&gt;@GetMapping(“/search”)&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;4d10&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;public List&amp;lt;Product&amp;gt; search(@RequestParam String q) { return svc.search(q); }&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;598d&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;@DeleteMapping(“/{id}”)&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;e9bf&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;public ResponseEntity&amp;lt;Void&amp;gt; delete(@PathVariable String id) {&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;be3c&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;svc.delete(id);&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;efcd&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;return ResponseEntity.noContent().build();&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;c426&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;}&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;79cf&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;}&lt;/p&gt;&lt;h2 class=&quot;zh zi tj bg zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz aba abb abc abd abe bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;1134&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: sohne, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 24px; letter-spacing: -0.016em; line-height: 30px; margin: 1.95em 0px -0.28em;&quot;&gt;5 — Using MongoTemplate for custom queries&lt;/h2&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq abf xs xt xu abg xw xx xy abh ya yb yc abi ye yf yg abj yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;3ffb&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 0.94em 0px -0.46em; word-break: break-word;&quot;&gt;MongoRepository covers many use-cases; MongoTemplate is useful for complex queries or aggregations.&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;44bf&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;@Service&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;6d6e&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;public class CustomProductService {&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;15ae&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;private final MongoTemplate mongoTemplate;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;e688&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;public CustomProductService(MongoTemplate mongoTemplate) { this.mongoTemplate = mongoTemplate; }&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;cbbb&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;public List&amp;lt;Product&amp;gt; findExpensiveProducts(double minPrice) {&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;a993&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;Query q = new Query(Criteria.where(“price”).gte(minPrice));&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;62fc&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;q.with(Sort.by(Sort.Direction.DESC, “price”));&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;76b2&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;return mongoTemplate.find(q, Product.class);&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;5b46&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;}&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;432f&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;}&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;0506&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;MongoTemplate also supports aggregation pipelines with Aggregation classes.&lt;/p&gt;&lt;h2 class=&quot;zh zi tj bg zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz aba abb abc abd abe bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;d70a&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: sohne, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 24px; letter-spacing: -0.016em; line-height: 30px; margin: 1.95em 0px -0.28em;&quot;&gt;6 — Transactions with MongoDB&lt;/h2&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq abf xs xt xu abg xw xx xy abh ya yb yc abi ye yf yg abj yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;aa0a&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 0.94em 0px -0.46em; word-break: break-word;&quot;&gt;MongoDB supports multi-document transactions starting with 4.0, but they require a replica set (even single-node replica set). Spring provides MongoTransactionManager.&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;4f96&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;span class=&quot;xp kh&quot; style=&quot;box-sizing: inherit; font-weight: 700;&quot;&gt;Spring config for transactions&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;bd78&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;@Configuration&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;3afa&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;@EnableTransactionManagement&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;7ccd&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;public class MongoConfig {&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;6285&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;@Bean&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;1000&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;MongoTransactionManager transactionManager(MongoDatabaseFactory dbFactory) {&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;b5d3&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;return new MongoTransactionManager(dbFactory);&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;2ecd&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;}&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;cbc3&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;}&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;7d70&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;span class=&quot;xp kh&quot; style=&quot;box-sizing: inherit; font-weight: 700;&quot;&gt;Using transactions&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;b1e8&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;@Transactional&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;6fe9&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;public void performMultipleOps() {&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;791e&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;// multiple repository saves or template operations will be in same transaction&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;873b&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;repo.save(entity1);&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;fe93&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;repo.save(entity2);&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;369a&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;}&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;80e3&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;Remember: to use transactions locally, your Mongo instance must be a replica set. See Docker section below.&lt;/p&gt;&lt;h2 class=&quot;zh zi tj bg zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz aba abb abc abd abe bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;565d&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: sohne, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 24px; letter-spacing: -0.016em; line-height: 30px; margin: 1.95em 0px -0.28em;&quot;&gt;7 — Run MongoDB locally with Docker (single-node replica set for transactions)&lt;/h2&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq abf xs xt xu abg xw xx xy abh ya yb yc abi ye yf yg abj yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;ae77&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 0.94em 0px -0.46em; word-break: break-word;&quot;&gt;A minimal docker-compose for a single-node replica set:&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;8828&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;version: “3.8”&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;03a8&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;services:&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;c7c2&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;mongo:&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;2f95&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;image: mongo:6 # or your preferred version&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;3f30&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;container_name: mongo&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;5e6e&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;ports:&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;9562&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;- “27017:27017”&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;2c36&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;command: [“mongod”, “ — replSet”, “rs0”, “ — bind_ip_all”]&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;b05f&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;volumes:&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;78cc&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;- ./mongo-data:/data/db&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;6b40&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;span class=&quot;xp kh&quot; style=&quot;box-sizing: inherit; font-weight: 700;&quot;&gt;Start:&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;c862&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;docker-compose up -d&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;a96e&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;span class=&quot;xp kh&quot; style=&quot;box-sizing: inherit; font-weight: 700;&quot;&gt;Initialize replica set:&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;9eab&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;# either use mongosh inside container&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;1bc5&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;docker exec -it mongo mongosh — eval “rs.initiate()”&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;5acd&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;span class=&quot;xp kh&quot; style=&quot;box-sizing: inherit; font-weight: 700;&quot;&gt;If you need auth, create an admin user:&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;f131&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;docker exec -it mongo mongosh&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;aa90&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&amp;gt; use admin&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;665d&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&amp;gt; db.createUser({user: “admin”, pwd: “securepass”, roles:[“root”]})&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;50d7&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;Then use the URI with credentials:&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;7112&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;mongodb://admin:securepass@localhost:27017/?authSource=admin&amp;amp;replicaSet=rs0&lt;/p&gt;&lt;h2 class=&quot;zh zi tj bg zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz aba abb abc abd abe bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;63d2&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: sohne, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 24px; letter-spacing: -0.016em; line-height: 30px; margin: 1.95em 0px -0.28em;&quot;&gt;8 — Integration testing: Flapdoodle embedded Mongo&lt;/h2&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq abf xs xt xu abg xw xx xy abh ya yb yc abi ye yf yg abj yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;d807&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 0.94em 0px -0.46em; word-break: break-word;&quot;&gt;Add Flapdoodle dependency (already shown earlier). In tests, Spring Boot auto-config will connect to embedded Mongo when available.&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;335d&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;Example JUnit 5 test:&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;88ad&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;@SpringBootTest&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;e3d7&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;@AutoConfigureDataMongo&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;b9a5&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;public class ProductRepositoryTests {&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;7bb2&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;@Autowired&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;e596&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;private ProductRepository repo;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;a4ae&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;@Test&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;a699&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;void testSaveAndFind() {&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;f30f&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;Product p = new Product(null, “Test”, “desc”, 9.99, LocalDateTime.now());&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;5f96&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;repo.save(p);&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;314e&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;assertFalse(repo.findById(p.getId()).isEmpty());&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;87d9&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;}&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;fb39&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;}&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;24d2&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;This is great for CI because it avoids requiring external MongoDB.&lt;/p&gt;&lt;h2 class=&quot;zh zi tj bg zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz aba abb abc abd abe bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;cbfa&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: sohne, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 24px; letter-spacing: -0.016em; line-height: 30px; margin: 1.95em 0px -0.28em;&quot;&gt;9 — Practical tips, gotchas &amp;amp; troubleshooting&lt;/h2&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq abf xs xt xu abg xw xx xy abh ya yb yc abi ye yf yg abj yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;3740&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 0.94em 0px -0.46em; word-break: break-word;&quot;&gt;Connection refused: check Mongo server is running and correct host/port. If running in Docker, confirm ports and network.&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;5184&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;Authentication failed: ensure correct authSource (often admin) and that the user exists in that DB.&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;cb8b&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;Replica set required for transactions: if transactions fail, verify rs.status() and that replicaSet option is set in URI.&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;c21e&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;SSL/TLS errors: add tls=true and proper certificates, or disable certificate validation only for dev (not recommended for prod).&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;a5d7&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;ObjectId mapping: if using String for @Id, Spring maps it to/from ObjectId automatically. If you use ObjectId type, import org.bson.types.ObjectId.&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;8dc6&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;Indexes: create indexes for frequently queried fields. You can annotate your model with @Indexed:&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;ab25&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;@Indexed(direction = IndexDirection.DESCENDING)&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;b5a5&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;private LocalDateTime createdAt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;b64e&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;Performance: avoid unbounded queries (large pages). Use pagination with Pageable.&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;5ec3&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;Document design: MongoDB favors denormalized documents for read performance. Embed sub-documents when they are accessed together.&lt;/p&gt;&lt;h2 class=&quot;zh zi tj bg zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz aba abb abc abd abe bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;b387&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: sohne, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 24px; letter-spacing: -0.016em; line-height: 30px; margin: 1.95em 0px -0.28em;&quot;&gt;10 — Security &amp;amp; production best practices&lt;/h2&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq abf xs xt xu abg xw xx xy abh ya yb yc abi ye yf yg abj yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;cd72&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 0.94em 0px -0.46em; word-break: break-word;&quot;&gt;Do not hardcode credentials in application.properties. Use environment variables or secret managers.&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;6949&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;spring.data.mongodb.uri=${MONGODB_URI}&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;c4f5&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;Least privilege: create separate DB users with least privilege needed.&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;7fc5&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;TLS: enable TLS for in-transit encryption.&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;f139&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;IP whitelisting: only allow known IPs in cloud-managed MongoDB (Atlas).&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;f93b&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;Monitoring: enable monitoring/metrics (MongoDB Ops Manager, Atlas, or Prometheus exporters).&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;0e26&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;Backups: schedule periodic backups and test restores regularly.&lt;/p&gt;&lt;h2 class=&quot;zh zi tj bg zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz aba abb abc abd abe bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;5946&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: sohne, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 24px; letter-spacing: -0.016em; line-height: 30px; margin: 1.95em 0px -0.28em;&quot;&gt;11 — Quick checklist before you deploy&lt;/h2&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq abf xs xt xu abg xw xx xy abh ya yb yc abi ye yf yg abj yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;439a&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 0.94em 0px -0.46em; word-break: break-word;&quot;&gt;Connection string stored securely (env var / vault)&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;df36&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;Proper user roles &amp;amp; authSource configured&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;154f&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;Replica set configured if you require transactions&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;9056&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;Indexes created for critical queries&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;fe7a&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;Secrets rotated regularly&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;bec5&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;Monitoring and backups enabled&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;bd6e&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;span class=&quot;xp kh&quot; style=&quot;box-sizing: inherit; font-weight: 700;&quot;&gt;Example: full application.yml for production (env vars)&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;f225&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;spring:&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;6902&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;data:&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;46c3&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;mongodb:&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;91a6&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;uri: ${MONGODB_URI}&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;af55&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;span class=&quot;xp kh&quot; style=&quot;box-sizing: inherit; font-weight: 700;&quot;&gt;Where MONGODB_URI might be:&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;22de&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;mongodb://appuser:secret@mongo1:27017,mongo2:27017/mydb?authSource=admin&amp;amp;replicaSet=rs0&amp;amp;retryWrites=true&amp;amp;w=majority&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;11a2&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;Spring Data MongoDB makes it very quick to get started: define your domain, repository, and start CRUD operations.&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;8b6f&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;For complex operations, MongoTemplate and aggregation pipelines cover the gaps.&lt;/p&gt;&lt;p class=&quot;pw-post-body-paragraph xn xo tj xp b xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk nq bl&quot; data-selectable-paragraph=&quot;&quot; id=&quot;3acd&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242424; font-family: source-serif-pro, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; letter-spacing: -0.003em; line-height: 32px; margin: 2.14em 0px -0.46em; word-break: break-word;&quot;&gt;Always test locally (Docker or embedded Mongo) and validate replica set &amp;amp; auth configuration if you need transactions.&lt;/p&gt;</description><link>https://value2read.blogspot.com/2025/11/how-to-connect-spring-boot-application.html</link><author>noreply@blogger.com (Online Shopping)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEhuczTrKkX0w2tbrREuFBiXziSYy7GRGbLgnPx0iM9RyBukpaQvI7MlHqVhGZK9fKiqjnCkCD02hN-yguLHxP5au8pqksBNSHumvqiAoQfYmSwb8eBmnG8QSL3Zv9I767f9Kvo2ciBidjfn0HUKy5TyoPi8Lxx9tZcC2XAtpcMG-t26jxTJBCD_ztdWOuw=s72-w400-h266-c" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-3462638432620176877</guid><pubDate>Fri, 21 Nov 2025 11:23:00 +0000</pubDate><atom:updated>2025-11-28T00:25:54.163-08:00</atom:updated><title>🚀 Beyond Upwork &amp; Fiverr: Uncovering the Best Freelancing Platforms for Every Skill</title><description>&lt;p&gt;When you think &quot;freelancing,&quot; Upwork and Fiverr often come to mind first. They&#39;re giants for a reason, offering a vast marketplace for skills from writing to web development. But what if you&#39;re looking for less competition, higher-paying clients, or a platform perfectly tailored to your niche?&lt;/p&gt;&lt;p data-path-to-node=&quot;2&quot;&gt;The freelance landscape is far richer than just these two behemoths! Depending on your skill level, desired pay, and specific expertise, there&#39;s a platform out there designed to help you thrive. Let&#39;s dive into the top alternatives and specialized sites that can truly elevate your freelancing career.&lt;/p&gt;&lt;p data-path-to-node=&quot;2&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiaGzORooGRS9ATRKhy2-RQ5C9JKeVNbmrMLkWyclauVWMy6Co5jj0FBovA0GpAIxQhWY-r53ouyJaF3eGuwvSuEmPznQkMfqFYvGXuRH-wRAJK9dESVD8Fu34u0_ythXIm-kMoOkbvRDfkJEWzwW7XnFSnCRH7h-Mi-003xM5_NB9hknYEYakEL5P1fr0&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;1024&quot; data-original-width=&quot;1024&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiaGzORooGRS9ATRKhy2-RQ5C9JKeVNbmrMLkWyclauVWMy6Co5jj0FBovA0GpAIxQhWY-r53ouyJaF3eGuwvSuEmPznQkMfqFYvGXuRH-wRAJK9dESVD8Fu34u0_ythXIm-kMoOkbvRDfkJEWzwW7XnFSnCRH7h-Mi-003xM5_NB9hknYEYakEL5P1fr0=w640-h640&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;h3&gt;1. The Elite Club: Vetted Platforms for High-End Talent 💼&lt;/h3&gt;&lt;p&gt;&lt;/p&gt;&lt;p data-path-to-node=&quot;5&quot;&gt;If you&#39;ve honed your skills and are ready to command premium rates, these platforms are your gateway to top-tier clients and complex projects. The entry barrier is higher, but the rewards—and often, the lack of bidding wars—are well worth it.&lt;/p&gt;&lt;ul data-path-to-node=&quot;6&quot;&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;6,0,0&quot;&gt;&lt;b&gt;Toptal:&lt;/b&gt; The name says it all. Toptal boasts that it only accepts the &lt;b&gt;top 3%&lt;/b&gt; of freelance talent, primarily in &lt;b&gt;development, design, finance, and project management&lt;/b&gt;. Their screening process is intense, but once in, you enjoy high rates and no fees charged to you as a freelancer. This means you keep 100% of your negotiated rate.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;6,1,0&quot;&gt;&lt;b&gt;Wripple:&lt;/b&gt; For the &lt;b&gt;marketing guru&lt;/b&gt;, Wripple offers a fantastic opportunity with &lt;b&gt;zero commission&lt;/b&gt; taken from freelancers. It connects marketing professionals with leading brands, ensuring you get paid what you&#39;re worth.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;6,2,0&quot;&gt;&lt;b&gt;Kolabtree:&lt;/b&gt; Are you a &lt;b&gt;scientist, researcher, or technical expert&lt;/b&gt;? Kolabtree specializes in complex scientific and research projects, offering exceptional earning potential (think $300/hour!) for highly niche expertise.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;6,3,0&quot;&gt;&lt;b&gt;Codeable:&lt;/b&gt; If &lt;b&gt;WordPress development&lt;/b&gt; is your superpower, Codeable is where you&#39;ll find vetted, high-quality projects. They focus exclusively on WordPress, ensuring a streamlined experience for both clients and developers.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;2. General Marketplaces: Diverse Opportunities &amp;amp; Broader Appeal 🌍&lt;/h3&gt;&lt;p&gt;&lt;/p&gt;&lt;p data-path-to-node=&quot;9&quot;&gt;These platforms offer a similar breadth of opportunities to Upwork but often come with different fee structures, project types, or community dynamics. They&#39;re great for building experience or finding a steady stream of work.&lt;/p&gt;&lt;ul data-path-to-node=&quot;10&quot;&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;10,0,0&quot;&gt;&lt;b&gt;Freelancer.com:&lt;/b&gt; One of the oldest and largest, Freelancer.com hosts a vast array of projects. Beyond traditional bidding, it&#39;s famous for &lt;b&gt;design contests&lt;/b&gt;, which can be a quick way for new designers to earn and build a portfolio.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;10,1,0&quot;&gt;&lt;b&gt;Guru:&lt;/b&gt; Emphasizing professional services, Guru offers a balanced environment for developers, consultants, and finance experts. Its quote-based system can lead to more stable, longer-term engagements.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;10,2,0&quot;&gt;&lt;b&gt;PeoplePerHour:&lt;/b&gt; Particularly popular in the UK and Europe, PeoplePerHour combines aspects of both Fiverr (fixed-price &quot;Offers&quot;) and Upwork (project bidding), making it versatile for various digital skills.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;3. Niche &amp;amp; Creative Havens: Showcase Your Artistic Flair ✨&lt;/h3&gt;&lt;p&gt;&lt;/p&gt;&lt;p data-path-to-node=&quot;13&quot;&gt;For designers, illustrators, writers, and other creatives, these platforms are built to celebrate and monetize your artistic talents.&lt;/p&gt;&lt;ul data-path-to-node=&quot;14&quot;&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;14,0,0&quot;&gt;&lt;b&gt;99designs:&lt;/b&gt; The go-to platform for &lt;b&gt;graphic and logo designers&lt;/b&gt;, 99designs operates on a contest model. You submit designs, and if yours is chosen, you get paid. They also facilitate one-on-one projects once you&#39;ve built a reputation.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;14,1,0&quot;&gt;&lt;b&gt;Dribbble:&lt;/b&gt; While primarily a portfolio and community site, Dribbble&#39;s &quot;Jobs&quot; board is a magnet for top-tier clients seeking exceptional &lt;b&gt;visual designers, illustrators, and animators&lt;/b&gt;. It&#39;s about getting noticed for your aesthetic.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;14,2,0&quot;&gt;&lt;b&gt;Behance:&lt;/b&gt; Adobe&#39;s powerhouse platform is essential for any creative to host their portfolio. Its robust job board connects creatives directly with recruiters and clients looking for all disciplines, from UI/UX to photography.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;4. Remote Job Boards: For Contract &amp;amp; Full-Time Remote Roles 🏡&lt;/h3&gt;&lt;p&gt;&lt;/p&gt;&lt;p data-path-to-node=&quot;17&quot;&gt;Sometimes, &quot;freelance&quot; means a long-term contract or a full-time remote position. These boards are curated specifically for that kind of flexibility.&lt;/p&gt;&lt;ul data-path-to-node=&quot;18&quot;&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;18,0,0&quot;&gt;&lt;b&gt;FlexJobs:&lt;/b&gt; A subscription-based service that meticulously screens every job posting for legitimacy. If you&#39;re tired of sifting through scams, FlexJobs is a safe haven for finding genuine part-time or full-time remote contracts.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p data-path-to-node=&quot;18,1,0&quot;&gt;&lt;b&gt;We Work Remotely (WWR):&lt;/b&gt; As its name suggests, WWR is entirely focused on remote job listings, spanning everything from design and programming to customer service, often including contract and freelance roles.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p data-path-to-node=&quot;20&quot;&gt;&lt;b&gt;The Bottom Line:&lt;/b&gt; Don&#39;t limit your freelancing horizons! Exploring these diverse platforms can lead to better clients, higher pay, and a more fulfilling freelance career tailored to your unique skills and aspirations. Take the leap and discover where your talents can truly shine.&lt;/p&gt;&lt;p data-path-to-node=&quot;21&quot;&gt;Ready to start exploring? Here’s a visual representation of some of the categories we discussed!&lt;/p&gt;&lt;div class=&quot;attachment-container generated-images&quot;&gt;&lt;response-element ng-version=&quot;0.0.0-PLACEHOLDER&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;generated-image _nghost-ng-c813332279=&quot;&quot; class=&quot;ng-star-inserted&quot; style=&quot;aspect-ratio: auto;&quot;&gt;&lt;div _ngcontent-ng-c813332279=&quot;&quot; class=&quot;loader&quot;&gt;&lt;/div&gt;&lt;single-image _ngcontent-ng-c813332279=&quot;&quot; _nghost-ng-c2198724654=&quot;&quot; class=&quot;generated-image large&quot; data-hveid=&quot;0&quot; data-image-attachment-index=&quot;0&quot; data-is-interactive=&quot;false&quot; data-ved=&quot;0CAAQiKwLahgKEwidq5z5joORAxUAAAAAHQAAAAAQqgE&quot; decode-data-ved=&quot;1&quot; jslog=&quot;185864;track:generic_click,impression,attention;BardVeMetadataKey:[[&amp;quot;r_5b5106fa0d952a2c&amp;quot;,&amp;quot;c_8244523542c0ff33&amp;quot;,null,&amp;quot;rc_4052a12397d82501&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]];mutable:true&quot;&gt;&lt;div _ngcontent-ng-c2198724654=&quot;&quot; class=&quot;image-container replace-fife-images-at-export ng-star-inserted&quot; replace-fife-images-at-export=&quot;&quot;&gt;&lt;div _ngcontent-ng-c2198724654=&quot;&quot; class=&quot;overlay-container ng-star-inserted&quot;&gt;&lt;!----&gt;&lt;p data-path-to-node=&quot;0&quot; style=&quot;font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif; line-height: 1.15; margin-top: 0px;&quot;&gt;Here are the website links for the freelancing platforms previously discussed:&lt;/p&gt;&lt;div class=&quot;horizontal-scroll-wrapper&quot; style=&quot;font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;table data-path-to-node=&quot;1&quot; style=&quot;line-height: 1.15; margin-bottom: 32px; margin-top: 0px;&quot;&gt;&lt;thead style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;tr style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;strong style=&quot;line-height: 1.15; margin-bottom: 0px; margin-top: 0px;&quot;&gt;Platform&lt;/strong&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;strong style=&quot;line-height: 1.15; margin-bottom: 0px; margin-top: 0px;&quot;&gt;Website Link&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;tr style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;td data-path-to-node=&quot;1,1,0,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;b style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;Toptal&lt;/b&gt;&lt;/td&gt;&lt;td data-path-to-node=&quot;1,1,1,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;response-element ng-version=&quot;0.0.0-PLACEHOLDER&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;link-block _nghost-ng-c2552794435=&quot;&quot; class=&quot;ng-star-inserted&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;a _ngcontent-ng-c2552794435=&quot;&quot; _nghost-ng-c158840757=&quot;&quot; class=&quot;ng-star-inserted&quot; data-hveid=&quot;0&quot; data-ved=&quot;0CAAQ_4QMahgKEwidq5z5joORAxUAAAAAHQAAAAAQzgE&quot; decode-data-ved=&quot;1&quot; externallink=&quot;&quot; href=&quot;https://www.toptal.com/&quot; jslog=&quot;197247;track:generic_click,impression,attention;BardVeMetadataKey:[[&amp;quot;r_3a6906bd31c41aa3&amp;quot;,&amp;quot;c_8244523542c0ff33&amp;quot;,null,&amp;quot;rc_c7226a71c3a96ec5&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]]&quot; rel=&quot;noopener&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot; target=&quot;_blank&quot;&gt;https://www.toptal.com/&lt;/a&gt;&lt;!----&gt;&lt;/link-block&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;/response-element&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;td data-path-to-node=&quot;1,2,0,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;b style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;Wripple&lt;/b&gt;&lt;/td&gt;&lt;td data-path-to-node=&quot;1,2,1,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;response-element ng-version=&quot;0.0.0-PLACEHOLDER&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;link-block _nghost-ng-c2552794435=&quot;&quot; class=&quot;ng-star-inserted&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;a _ngcontent-ng-c2552794435=&quot;&quot; _nghost-ng-c158840757=&quot;&quot; class=&quot;ng-star-inserted&quot; data-hveid=&quot;0&quot; data-ved=&quot;0CAAQ_4QMahgKEwidq5z5joORAxUAAAAAHQAAAAAQzwE&quot; decode-data-ved=&quot;1&quot; externallink=&quot;&quot; href=&quot;https://www.wripple.com/&quot; jslog=&quot;197247;track:generic_click,impression,attention;BardVeMetadataKey:[[&amp;quot;r_3a6906bd31c41aa3&amp;quot;,&amp;quot;c_8244523542c0ff33&amp;quot;,null,&amp;quot;rc_c7226a71c3a96ec5&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]]&quot; rel=&quot;noopener&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot; target=&quot;_blank&quot;&gt;https://www.wripple.com/&lt;/a&gt;&lt;!----&gt;&lt;/link-block&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;/response-element&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;td data-path-to-node=&quot;1,3,0,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;b style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;Kolabtree&lt;/b&gt;&lt;/td&gt;&lt;td data-path-to-node=&quot;1,3,1,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;response-element ng-version=&quot;0.0.0-PLACEHOLDER&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;link-block _nghost-ng-c2552794435=&quot;&quot; class=&quot;ng-star-inserted&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;a _ngcontent-ng-c2552794435=&quot;&quot; _nghost-ng-c158840757=&quot;&quot; class=&quot;ng-star-inserted&quot; data-hveid=&quot;0&quot; data-ved=&quot;0CAAQ_4QMahgKEwidq5z5joORAxUAAAAAHQAAAAAQ0AE&quot; decode-data-ved=&quot;1&quot; externallink=&quot;&quot; href=&quot;https://www.kolabtree.com/&quot; jslog=&quot;197247;track:generic_click,impression,attention;BardVeMetadataKey:[[&amp;quot;r_3a6906bd31c41aa3&amp;quot;,&amp;quot;c_8244523542c0ff33&amp;quot;,null,&amp;quot;rc_c7226a71c3a96ec5&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]]&quot; rel=&quot;noopener&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot; target=&quot;_blank&quot;&gt;https://www.kolabtree.com/&lt;/a&gt;&lt;!----&gt;&lt;/link-block&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;/response-element&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;td data-path-to-node=&quot;1,4,0,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;b style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;Codeable&lt;/b&gt;&lt;/td&gt;&lt;td data-path-to-node=&quot;1,4,1,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;response-element ng-version=&quot;0.0.0-PLACEHOLDER&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;link-block _nghost-ng-c2552794435=&quot;&quot; class=&quot;ng-star-inserted&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;a _ngcontent-ng-c2552794435=&quot;&quot; _nghost-ng-c158840757=&quot;&quot; class=&quot;ng-star-inserted&quot; data-hveid=&quot;0&quot; data-ved=&quot;0CAAQ_4QMahgKEwidq5z5joORAxUAAAAAHQAAAAAQ0QE&quot; decode-data-ved=&quot;1&quot; externallink=&quot;&quot; href=&quot;https://www.codeable.io/&quot; jslog=&quot;197247;track:generic_click,impression,attention;BardVeMetadataKey:[[&amp;quot;r_3a6906bd31c41aa3&amp;quot;,&amp;quot;c_8244523542c0ff33&amp;quot;,null,&amp;quot;rc_c7226a71c3a96ec5&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]]&quot; rel=&quot;noopener&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot; target=&quot;_blank&quot;&gt;https://www.codeable.io/&lt;/a&gt;&lt;!----&gt;&lt;/link-block&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;/response-element&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;td data-path-to-node=&quot;1,5,0,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;b style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;Freelancer.com&lt;/b&gt;&lt;/td&gt;&lt;td data-path-to-node=&quot;1,5,1,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;response-element ng-version=&quot;0.0.0-PLACEHOLDER&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;link-block _nghost-ng-c2552794435=&quot;&quot; class=&quot;ng-star-inserted&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;a _ngcontent-ng-c2552794435=&quot;&quot; _nghost-ng-c158840757=&quot;&quot; class=&quot;ng-star-inserted&quot; data-hveid=&quot;0&quot; data-ved=&quot;0CAAQ_4QMahgKEwidq5z5joORAxUAAAAAHQAAAAAQ0gE&quot; decode-data-ved=&quot;1&quot; externallink=&quot;&quot; href=&quot;https://www.freelancer.com/&quot; jslog=&quot;197247;track:generic_click,impression,attention;BardVeMetadataKey:[[&amp;quot;r_3a6906bd31c41aa3&amp;quot;,&amp;quot;c_8244523542c0ff33&amp;quot;,null,&amp;quot;rc_c7226a71c3a96ec5&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]]&quot; rel=&quot;noopener&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot; target=&quot;_blank&quot;&gt;https://www.freelancer.com/&lt;/a&gt;&lt;!----&gt;&lt;/link-block&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;/response-element&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;td data-path-to-node=&quot;1,6,0,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;b style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;Guru&lt;/b&gt;&lt;/td&gt;&lt;td data-path-to-node=&quot;1,6,1,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;response-element ng-version=&quot;0.0.0-PLACEHOLDER&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;link-block _nghost-ng-c2552794435=&quot;&quot; class=&quot;ng-star-inserted&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;a _ngcontent-ng-c2552794435=&quot;&quot; _nghost-ng-c158840757=&quot;&quot; class=&quot;ng-star-inserted&quot; data-hveid=&quot;0&quot; data-ved=&quot;0CAAQ_4QMahgKEwidq5z5joORAxUAAAAAHQAAAAAQ0wE&quot; decode-data-ved=&quot;1&quot; externallink=&quot;&quot; href=&quot;https://www.guru.com/&quot; jslog=&quot;197247;track:generic_click,impression,attention;BardVeMetadataKey:[[&amp;quot;r_3a6906bd31c41aa3&amp;quot;,&amp;quot;c_8244523542c0ff33&amp;quot;,null,&amp;quot;rc_c7226a71c3a96ec5&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]]&quot; rel=&quot;noopener&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot; target=&quot;_blank&quot;&gt;https://www.guru.com/&lt;/a&gt;&lt;!----&gt;&lt;/link-block&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;/response-element&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;td data-path-to-node=&quot;1,7,0,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;b style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;PeoplePerHour&lt;/b&gt;&lt;/td&gt;&lt;td data-path-to-node=&quot;1,7,1,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;response-element ng-version=&quot;0.0.0-PLACEHOLDER&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;link-block _nghost-ng-c2552794435=&quot;&quot; class=&quot;ng-star-inserted&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;a _ngcontent-ng-c2552794435=&quot;&quot; _nghost-ng-c158840757=&quot;&quot; class=&quot;ng-star-inserted&quot; data-hveid=&quot;0&quot; data-ved=&quot;0CAAQ_4QMahgKEwidq5z5joORAxUAAAAAHQAAAAAQ1AE&quot; decode-data-ved=&quot;1&quot; externallink=&quot;&quot; href=&quot;https://www.peopleperhour.com/&quot; jslog=&quot;197247;track:generic_click,impression,attention;BardVeMetadataKey:[[&amp;quot;r_3a6906bd31c41aa3&amp;quot;,&amp;quot;c_8244523542c0ff33&amp;quot;,null,&amp;quot;rc_c7226a71c3a96ec5&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]]&quot; rel=&quot;noopener&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot; target=&quot;_blank&quot;&gt;https://www.peopleperhour.com/&lt;/a&gt;&lt;!----&gt;&lt;/link-block&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;/response-element&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;td data-path-to-node=&quot;1,8,0,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;b style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;99designs&lt;/b&gt;&lt;/td&gt;&lt;td data-path-to-node=&quot;1,8,1,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;response-element ng-version=&quot;0.0.0-PLACEHOLDER&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;link-block _nghost-ng-c2552794435=&quot;&quot; class=&quot;ng-star-inserted&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;a _ngcontent-ng-c2552794435=&quot;&quot; _nghost-ng-c158840757=&quot;&quot; class=&quot;ng-star-inserted&quot; data-hveid=&quot;0&quot; data-ved=&quot;0CAAQ_4QMahgKEwidq5z5joORAxUAAAAAHQAAAAAQ1QE&quot; decode-data-ved=&quot;1&quot; externallink=&quot;&quot; href=&quot;https://99designs.com/&quot; jslog=&quot;197247;track:generic_click,impression,attention;BardVeMetadataKey:[[&amp;quot;r_3a6906bd31c41aa3&amp;quot;,&amp;quot;c_8244523542c0ff33&amp;quot;,null,&amp;quot;rc_c7226a71c3a96ec5&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]]&quot; rel=&quot;noopener&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot; target=&quot;_blank&quot;&gt;https://99designs.com/&lt;/a&gt;&lt;!----&gt;&lt;/link-block&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;/response-element&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;td data-path-to-node=&quot;1,9,0,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;b style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;Dribbble&lt;/b&gt;&lt;/td&gt;&lt;td data-path-to-node=&quot;1,9,1,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;response-element ng-version=&quot;0.0.0-PLACEHOLDER&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;link-block _nghost-ng-c2552794435=&quot;&quot; class=&quot;ng-star-inserted&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;a _ngcontent-ng-c2552794435=&quot;&quot; _nghost-ng-c158840757=&quot;&quot; class=&quot;ng-star-inserted&quot; data-hveid=&quot;0&quot; data-ved=&quot;0CAAQ_4QMahgKEwidq5z5joORAxUAAAAAHQAAAAAQ1gE&quot; decode-data-ved=&quot;1&quot; externallink=&quot;&quot; href=&quot;https://dribbble.com/&quot; jslog=&quot;197247;track:generic_click,impression,attention;BardVeMetadataKey:[[&amp;quot;r_3a6906bd31c41aa3&amp;quot;,&amp;quot;c_8244523542c0ff33&amp;quot;,null,&amp;quot;rc_c7226a71c3a96ec5&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]]&quot; rel=&quot;noopener&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot; target=&quot;_blank&quot;&gt;https://dribbble.com/&lt;/a&gt;&lt;!----&gt;&lt;/link-block&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;/response-element&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;td data-path-to-node=&quot;1,10,0,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;b style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;Behance&lt;/b&gt;&lt;/td&gt;&lt;td data-path-to-node=&quot;1,10,1,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;response-element ng-version=&quot;0.0.0-PLACEHOLDER&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;link-block _nghost-ng-c2552794435=&quot;&quot; class=&quot;ng-star-inserted&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;a _ngcontent-ng-c2552794435=&quot;&quot; _nghost-ng-c158840757=&quot;&quot; class=&quot;ng-star-inserted&quot; data-hveid=&quot;0&quot; data-ved=&quot;0CAAQ_4QMahgKEwidq5z5joORAxUAAAAAHQAAAAAQ1wE&quot; decode-data-ved=&quot;1&quot; externallink=&quot;&quot; href=&quot;https://www.behance.net/&quot; jslog=&quot;197247;track:generic_click,impression,attention;BardVeMetadataKey:[[&amp;quot;r_3a6906bd31c41aa3&amp;quot;,&amp;quot;c_8244523542c0ff33&amp;quot;,null,&amp;quot;rc_c7226a71c3a96ec5&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]]&quot; rel=&quot;noopener&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot; target=&quot;_blank&quot;&gt;https://www.behance.net&lt;/a&gt;&lt;!----&gt;&lt;/link-block&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;/response-element&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;td data-path-to-node=&quot;1,11,0,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;b style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;FlexJobs&lt;/b&gt;&lt;/td&gt;&lt;td data-path-to-node=&quot;1,11,1,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;response-element ng-version=&quot;0.0.0-PLACEHOLDER&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;link-block _nghost-ng-c2552794435=&quot;&quot; class=&quot;ng-star-inserted&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;a _ngcontent-ng-c2552794435=&quot;&quot; _nghost-ng-c158840757=&quot;&quot; class=&quot;ng-star-inserted&quot; data-hveid=&quot;0&quot; data-ved=&quot;0CAAQ_4QMahgKEwidq5z5joORAxUAAAAAHQAAAAAQ2AE&quot; decode-data-ved=&quot;1&quot; externallink=&quot;&quot; href=&quot;https://www.flexjobs.com/&quot; jslog=&quot;197247;track:generic_click,impression,attention;BardVeMetadataKey:[[&amp;quot;r_3a6906bd31c41aa3&amp;quot;,&amp;quot;c_8244523542c0ff33&amp;quot;,null,&amp;quot;rc_c7226a71c3a96ec5&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]]&quot; rel=&quot;noopener&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot; target=&quot;_blank&quot;&gt;https://www.flexjobs.com/&lt;/a&gt;&lt;!----&gt;&lt;/link-block&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;/response-element&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;td data-path-to-node=&quot;1,12,0,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;b style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;We Work Remotely&lt;/b&gt;&lt;/td&gt;&lt;td data-path-to-node=&quot;1,12,1,0&quot; style=&quot;border: 1px solid; line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;response-element ng-version=&quot;0.0.0-PLACEHOLDER&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;link-block _nghost-ng-c2552794435=&quot;&quot; class=&quot;ng-star-inserted&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;a _ngcontent-ng-c2552794435=&quot;&quot; _nghost-ng-c158840757=&quot;&quot; class=&quot;ng-star-inserted&quot; data-hveid=&quot;0&quot; data-ved=&quot;0CAAQ_4QMahgKEwidq5z5joORAxUAAAAAHQAAAAAQ2QE&quot; decode-data-ved=&quot;1&quot; externallink=&quot;&quot; href=&quot;https://weworkremotely.com/&quot; jslog=&quot;197247;track:generic_click,impression,attention;BardVeMetadataKey:[[&amp;quot;r_3a6906bd31c41aa3&amp;quot;,&amp;quot;c_8244523542c0ff33&amp;quot;,null,&amp;quot;rc_c7226a71c3a96ec5&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]]&quot; rel=&quot;noopener&quot; style=&quot;line-height: 1.15; margin-top: 0px;&quot; target=&quot;_blank&quot;&gt;https://weworkremotely.com/&lt;/a&gt;&lt;/link-block&gt;&lt;/response-element&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;https://app.sourceknowledge.com/ui/affiliate/campaign/new&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/single-image&gt;&lt;/generated-image&gt;&lt;/response-element&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;</description><link>https://value2read.blogspot.com/2025/11/beyond-upwork-fiverr-uncovering-best.html</link><author>noreply@blogger.com (Online Shopping)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEiaGzORooGRS9ATRKhy2-RQ5C9JKeVNbmrMLkWyclauVWMy6Co5jj0FBovA0GpAIxQhWY-r53ouyJaF3eGuwvSuEmPznQkMfqFYvGXuRH-wRAJK9dESVD8Fu34u0_ythXIm-kMoOkbvRDfkJEWzwW7XnFSnCRH7h-Mi-003xM5_NB9hknYEYakEL5P1fr0=s72-w640-h640-c" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-1437881652310004625</guid><pubDate>Mon, 17 Nov 2025 06:58:00 +0000</pubDate><atom:updated>2025-11-16T22:58:51.632-08:00</atom:updated><title>Contrive</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;PZPZlf Tp2M5d&quot; data-attrid=&quot;EntryHeader&quot; data-psd=&quot;headword~:&amp;amp;contrive~;&amp;amp;tts_country~:&amp;amp;in~;&amp;amp;homograph_index~:&amp;amp;&quot; jsaction=&quot;NAozHc:siCL7e&quot; jscontroller=&quot;stMJSc&quot; style=&quot;align-items: center; background-color: #1f1f1f; color: #e8e8e8; display: flex; font-family: Arial, sans-serif; font-size: 14px;&quot;&gt;&lt;div class=&quot;k9Pknf&quot; style=&quot;align-items: center; display: flex;&quot;&gt;&lt;div aria-label=&quot; Listen  &quot; class=&quot;BRK39e D5gqpe&quot; data-animation-enabled=&quot;true&quot; data-audio-play-tts=&quot;true&quot; data-language-code=&quot;en-in&quot; data-tts-client-name=&quot;&quot; data-tts-string=&quot;contrive&quot; data-use-default-audio-speed=&quot;false&quot; data-uti=&quot;1&quot; data-ved=&quot;2ahUKEwjZjuDezPiQAxVhzzgGHUKIJO0QlfQBegQIHxAY&quot; jsaction=&quot;rcuQ6b:npT2md;DiIjNc;xLXIyb:DGzHQ&quot; jscontroller=&quot;UYJibd&quot; jsname=&quot;mNipWe&quot; role=&quot;button&quot; style=&quot;cursor: pointer; float: left; margin: -6px 6px -6px -6px; outline: 0px; padding: 6px; position: relative;&quot; tabindex=&quot;0&quot;&gt;&lt;div class=&quot;brWULd Bheyob&quot; style=&quot;background-clip: content-box; background-color: inherit; border-radius: 50%; border-width: 0px; height: 36px; margin: -4px; padding: 4px; vertical-align: baseline; width: 36px;&quot;&gt;&lt;span class=&quot;g1baVc aqCVJb&quot; jsname=&quot;qpYryf&quot; style=&quot;background-color: #a8c7fa; border-color: rgb(168, 199, 250); border-radius: 50%; border-style: solid; border-width: 1px; height: 34px; position: absolute; width: 34px;&quot;&gt;&lt;div class=&quot;pkt1Wd fjnQw vjtNRe&quot; style=&quot;background-image: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgdmlld2JveD0iMCAwIDIyIDIyIj4KICA8cG9seWdvbiBmaWxsPSIjMjAyMTI0IiBwb2ludHM9IjIuNzUgOC4yNSAyLjc1IDEzLjc1IDYuNDE3IDEzLjc1IDExIDE4LjMzMyAxMSAzLjY2NyA2LjQxNyA4LjI1IiAvPgo8L3N2Zz4K&amp;quot;); height: 22px; margin: 6px; position: absolute; width: 22px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;pkt1Wd nIW5Sd gfMd5c&quot; jsname=&quot;m1xdOb&quot; style=&quot;background-image: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgdmlld2JveD0iMCAwIDIyIDIyIj4KICA8cGF0aCBkPSJNMTUuMTI1LDExIEMxNS4xMjUsOS4zNzc1IDE0LjE5LDcuOTg0MTY2NjcgMTIuODMzMzMzMyw3LjMwNTgzMzMzIEwxMi44MzMzMzMzLDE0LjY4NSBDMTQuMTksMTQuMDE1ODMzMyAxNS4xMjUsMTIuNjIyNSAxNS4xMjUsMTEgWiIgZmlsbD0iIzIwMjEyNCIgZmlsbC1ydWxlPSJldmVub2RkIiAvPgo8L3N2Zz4K&amp;quot;); height: 22px; margin: 6px; position: absolute; width: 22px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;pkt1Wd byDyWd N8ZFrc&quot; jsname=&quot;DFrD7b&quot; style=&quot;background-image: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgdmlld2JveD0iMCAwIDIyIDIyIj4KICA8cGF0aCBkPSJNMTIuODMzMzMzMywyLjk2MDgzMzMzIEwxMi44MzMzMzMzLDQuODQ5MTY2NjcgQzE1LjQ4MjUsNS42Mzc1IDE3LjQxNjY2NjcsOC4wOTQxNjY2NyAxNy40MTY2NjY3LDExIEMxNy40MTY2NjY3LDEzLjkwNTgzMzMgMTUuNDgyNSwxNi4zNjI1IDEyLjgzMzMzMzMsMTcuMTUwODMzMyBMMTIuODMzMzMzMywxOS4wMzkxNjY3IEMxNi41MDkxNjY3LDE4LjIwNSAxOS4yNSwxNC45MjMzMzMzIDE5LjI1LDExIEMxOS4yNSw3LjA3NjY2NjY3IDE2LjUwOTE2NjcsMy43OTUgMTIuODMzMzMzMywyLjk2MDgzMzMzIFoiIGZpbGw9IiMyMDIxMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCIgLz4KPC9zdmc+Cg==&amp;quot;); height: 22px; margin: 6px; position: absolute; width: 22px;&quot;&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;gokfRc&quot;&gt;&lt;div class=&quot;cFP2pd&quot; style=&quot;font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;wqLW9c pb3iw RES9jf&quot; style=&quot;font-size: 28px; height: 36px; line-height: 36px;&quot;&gt;contrive&lt;/span&gt;&lt;/div&gt;&lt;div aria-hidden=&quot;true&quot; class=&quot;K6GhFd&quot; data-enable-pron-promo-always=&quot;false&quot; data-is-bilingual=&quot;true&quot; jsaction=&quot;BtuVOb:V46pce&quot; jscontroller=&quot;jhGntf&quot; style=&quot;max-height: 0px; opacity: 0; pointer-events: none; transition: max-height 0.3s, opacity 0.3s; visibility: hidden;&quot;&gt;&lt;div class=&quot;yFp4he&quot; style=&quot;padding: 8px 0px 6px;&quot;&gt;&lt;a data-ved=&quot;2ahUKEwjZjuDezPiQAxVhzzgGHUKIJO0Q3eEDegQIHxAZ&quot; href=&quot;https://www.google.com/search?num=10&amp;amp;sa=X&amp;amp;sca_esv=11e8326e624cff0c&amp;amp;rlz=1C1RXQR_enIN1186IN1186&amp;amp;biw=1536&amp;amp;bih=714&amp;amp;sxsrf=AE3TifMWQvwMl6jF1oZA866b7m5cF2GFEA:1763362372852&amp;amp;q=how+to+pronounce+contrive&amp;amp;stick=H4sIAAAAAAAAAOMIfcRoxS3w8sc9YSnDSWtOXmPU5uINKMrPK81LzkwsyczPExLhYglJLcoV4pHi4uJIzs8rKcosS7ViUWJKzeNZxCqZkV-uUJKvUADUkw_UlKoAUwIAFRH-WFsAAAA&amp;amp;pron_lang=en&amp;amp;pron_country=in&amp;amp;ved=2ahUKEwjZjuDezPiQAxVhzzgGHUKIJO0Q3eEDegQIHxAZ&quot; jsname=&quot;MDmfVb&quot; style=&quot;-webkit-tap-highlight-color: rgba(255, 255, 255, 0.1); color: #99c3ff; outline: 0px; text-decoration-line: none;&quot; tabindex=&quot;0&quot;&gt;&lt;div class=&quot;S5TwIf&quot; style=&quot;border-radius: 6px; box-shadow: rgb(60, 64, 67) 0px 0px 0px 1px inset; display: inline-block; overflow: hidden; padding-right: 12px; vertical-align: top;&quot;&gt;&lt;div class=&quot;FamOtd q1MG4e&quot; style=&quot;display: inline-block; height: 32px; vertical-align: middle;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;wA1Bge YQ4gaf zr758c&quot; data-atf=&quot;0&quot; data-csiid=&quot;RMYaadncM-Ge4-EPwpCS6Q4_2&quot; height=&quot;32&quot; id=&quot;dimg_RMYaadncM-Ge4-EPwpCS6Q4_3&quot; src=&quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgPGRlZnM+CiAgICA8cG9seWdvbiBpZD0ic21hbGwtdmlzZW1lLXYzLWEiIHBvaW50cz0iMCAwIDMyIDAgMzIgMzIgMCAzMiIvPgogIDwvZGVmcz4KICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgPG1hc2sgaWQ9InNtYWxsLXZpc2VtZS12My1iIiBmaWxsPSIjZmZmIj4KICAgICAgPHVzZSB4bGluazpocmVmPSIjc21hbGwtdmlzZW1lLXYzLWEiLz4KICAgIDwvbWFzaz4KICAgIDx1c2UgZmlsbD0iIzQyODVGNCIgeGxpbms6aHJlZj0iI3NtYWxsLXZpc2VtZS12My1hIi8+CiAgICA8cGF0aCBmaWxsPSIjRDJFM0ZDIiBkPSJNMCwxNS4yMzk3OTYzIEMyLjU0Mzg1NzE0LDE4Ljg3MDUyMDMgNS42NTIsMjIuMDgyMTk0NiA5LjIwMjI4NTcxLDI0Ljc0NDg3NjkgQzEzLjIxMTU3MTQsMjcuNzUxNzA3NyAxOC43ODg0Mjg2LDI3Ljc1MTcwNzcgMjIuNzk3NzE0MywyNC43NDQ4NzY5IEMyNi4zNDgsMjIuMDgyMTk0NiAyOS40NTYxNDI5LDE4Ljg3MDUyMDMgMzIsMTUuMjM5Nzk2MyBMMzIsLTcgTDAsLTcgTDAsMTUuMjM5Nzk2MyBaIiBtYXNrPSJ1cmwoI3NtYWxsLXZpc2VtZS12My1iKSIvPgogICAgPHBhdGggZmlsbD0iIzQyODVGNCIgZmlsbC1vcGFjaXR5PSIuNiIgZD0iTTE2LDIxLjIzMDY0OTIgQzE2LjkyNjA5OTEsMjEuMjMwNjQ5MiAxNy43OTEyNDY3LDIxLjQ5NDMxNTcgMTguNTI3MjEzNSwyMS45NTE1MDE5IEMxOC44MTA0NDEsMjIuMTI3MzMwOSAxOS4xMzYyNzM4LDIxLjc4ODc0ODUgMTguOTQwMzc5OSwyMS41MTY0Njc0IEMxOC4yNzg1NTU2LDIwLjU5NzMyNjMgMTcuMjA4MTEzNiwyMCAxNiwyMCBDMTQuNzkxODg2NCwyMCAxMy43MjE0NDQ0LDIwLjU5NzMyNjMgMTMuMDU5NjIwMSwyMS41MTY0Njc0IEMxMi44NjM3MjYyLDIxLjc4ODc0ODUgMTMuMTg5NTU5LDIyLjEyNzMzMDkgMTMuNDcyNzg2NSwyMS45NTE1MDE5IEMxNC4yMDg3NTMzLDIxLjQ5NDMxNTcgMTUuMDczOTAwOSwyMS4yMzA2NDkyIDE2LDIxLjIzMDY0OTIiIG1hc2s9InVybCgjc21hbGwtdmlzZW1lLXYzLWIpIi8+CiAgICA8cGF0aCBzdHJva2U9IiM0Mjg1RjQiIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiIGQ9Ik0yNSwxMyBDMjMsMTUuMzMzMzMzMyAyMCwxNi41IDE2LDE2LjUgQzEyLDE2LjUgOSwxNS4zMzMzMzMzIDcsMTMgTDEzLDEwLjUgTDE5LDEwLjUgTDI1LDEzIFoiIG1hc2s9InVybCgjc21hbGwtdmlzZW1lLXYzLWIpIi8+CiAgICA8cG9seWdvbiBmaWxsPSIjNDI4NUY0IiBmaWxsLXJ1bGU9Im5vbnplcm8iIHBvaW50cz0iOCAxNCA3IDEzIDI1IDEzIDI0IDE0IiBtYXNrPSJ1cmwoI3NtYWxsLXZpc2VtZS12My1iKSIvPgogICAgPHBhdGggc3Ryb2tlPSIjNDI4NUY0IiBzdHJva2UtbGluZWNhcD0icm91bmQiIGQ9Ik0yMCwzIEwxNy43Njc4NzUsNS4yNTg5MjYyMiBDMTYuNzkxNSw2LjI0NzAyNDU5IDE1LjIwODUsNi4yNDcwMjQ1OSAxNC4yMzIxMjUsNS4yNTg5MjYyMiBMMTIsMyIgbWFzaz0idXJsKCNzbWFsbC12aXNlbWUtdjMtYikiLz4KICA8L2c+Cjwvc3ZnPgo=&quot; style=&quot;border: 0px; display: block; position: relative;&quot; width=&quot;32&quot; /&gt;&lt;/div&gt;&lt;span class=&quot;fe69if&quot; style=&quot;margin-left: 10px; vertical-align: middle;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blv1db&quot; style=&quot;background-color: #1f1f1f; color: #e8e8e8; font-family: Arial, sans-serif; font-size: 14px; margin-top: 12px;&quot;&gt;&lt;div class=&quot;TiGmJf YrbPuc&quot; style=&quot;color: #9e9e9e; display: flex; line-height: 22px;&quot;&gt;&lt;div class=&quot;rmArTe ZYHQ7e&quot; style=&quot;padding-top: 8px;&quot;&gt;verb&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;xpdxpnd&quot; data-mh=&quot;-1&quot; style=&quot;max-height: none; overflow: hidden; transition: max-height 0.3s;&quot;&gt;&lt;span class=&quot;kqEaA&quot; style=&quot;color: #9e9e9e; line-height: 22px;&quot;&gt;verb&lt;/span&gt;:&amp;nbsp;&lt;span class=&quot;kqEaA z8gr9e&quot; style=&quot;color: #bfbfbf; line-height: 22px;&quot;&gt;&lt;b&gt;contrive&lt;/b&gt;&lt;/span&gt;;&amp;nbsp;&lt;span class=&quot;kqEaA&quot; style=&quot;color: #9e9e9e; line-height: 22px;&quot;&gt;past tense&lt;/span&gt;:&amp;nbsp;&lt;span class=&quot;kqEaA z8gr9e&quot; style=&quot;color: #bfbfbf; line-height: 22px;&quot;&gt;&lt;b&gt;contrived&lt;/b&gt;&lt;/span&gt;;&amp;nbsp;&lt;span class=&quot;kqEaA&quot; style=&quot;color: #9e9e9e; line-height: 22px;&quot;&gt;past participle&lt;/span&gt;:&amp;nbsp;&lt;span class=&quot;kqEaA z8gr9e&quot; style=&quot;color: #bfbfbf; line-height: 22px;&quot;&gt;&lt;b&gt;contrived&lt;/b&gt;&lt;/span&gt;;&amp;nbsp;&lt;span class=&quot;kqEaA&quot; style=&quot;color: #9e9e9e; line-height: 22px;&quot;&gt;3rd person present&lt;/span&gt;:&amp;nbsp;&lt;span class=&quot;kqEaA z8gr9e&quot; style=&quot;color: #bfbfbf; line-height: 22px;&quot;&gt;&lt;b&gt;contrives&lt;/b&gt;&lt;/span&gt;;&amp;nbsp;&lt;span class=&quot;kqEaA&quot; style=&quot;color: #9e9e9e; line-height: 22px;&quot;&gt;gerund or present participle&lt;/span&gt;:&amp;nbsp;&lt;span class=&quot;kqEaA z8gr9e&quot; style=&quot;color: #bfbfbf; line-height: 22px;&quot;&gt;&lt;b&gt;contriving&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;OXv3P&quot; style=&quot;margin-top: 8px; padding-left: 16px;&quot;&gt;&lt;div&gt;&lt;div class=&quot;c7GJde&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;div class=&quot;PZPZlf&quot; data-attrid=&quot;Sense&quot; data-psd=&quot;sense_definition~:&amp;amp;to manage to do something, although there are difficulties.&quot;&gt;&lt;div class=&quot;OYIXme tNxQIb RES9jf RiJqbb&quot; style=&quot;float: left; font-size: 16px; line-height: 24px; padding-right: 3px;&quot;&gt;1.&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;tNxQIb RiJqbb&quot; style=&quot;font-size: 16px; line-height: 24px;&quot;&gt;to manage to do something, although there are difficulties.&lt;/div&gt;&lt;div class=&quot;wHYlTd xxjvrc ZYHQ7e&quot; style=&quot;color: #9e9e9e; line-height: 22px; margin-top: 2px;&quot;&gt;சிரமங்களுக்கு இடையிலேயும் ஒன்றை ஒருவாறாகச் செய்துமுடி. சமாளித்துச் செயலாற்று.&lt;/div&gt;&lt;div class=&quot;WQqGFd&quot; style=&quot;margin-top: 8px; padding-bottom: 4px;&quot;&gt;&lt;div class=&quot;Yixicc&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;div class=&quot;CW9Geb&quot; data-animation-enabled=&quot;true&quot; data-language-code=&quot;en-in&quot; data-tts-string=&quot;If I can contrive to get off work early, I&#39;ll see you later.&quot; jsaction=&quot;rcuQ6b:npT2md;xLXIyb:DGzHQ&quot; jscontroller=&quot;op4Gbb&quot; style=&quot;position: relative;&quot;&gt;&lt;div class=&quot;r9Iaj&quot; data-ved=&quot;2ahUKEwjZjuDezPiQAxVhzzgGHUKIJO0Q1KgDegQIHxAc&quot; jsaction=&quot;DiIjNc&quot; role=&quot;button&quot; style=&quot;cursor: pointer; display: inline-block; margin: -7px 0px; outline: 0px; padding: 7px 0px;&quot; tabindex=&quot;0&quot;&gt;&lt;div class=&quot;XiZcCe WAvpX FtzkAd Pqkn2e&quot; jsname=&quot;bvGZZ&quot; style=&quot;border-color: rgb(60, 64, 67); border-radius: 17px; border-style: solid; border-width: 1px; display: inline-block; font-size: 16px; line-height: 24px; margin-left: 8px; padding: 6px 36px 6px 12px; position: absolute; word-break: break-word; z-index: 1;&quot;&gt;If I can contrive to get off work early, I&#39;ll see you later.&lt;div class=&quot;ctWsee S9Cklb&quot; style=&quot;background-image: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMHB4IiBoZWlnaHQ9IjEwcHgiIHZpZXdib3g9IjAgMCAxMCAxMCI+CiAgPHBhdGggZD0iTTguNzE3MzIwMTEsMTMuNDcwOTM0MSBDNi4zNzgxODQ0MSwxMy4yOTk0MDI3IDMuNjE3MTM1MzMsMTIuNzA2MDkwOCAwLjY3MDA5MTI2NCwxMS43NTA3MTg0IEMxLjUzODYyMzIxLDE1LjAyNDU3MzYgNC4zNzYyNTA1NCwxNy44NzAyMDUxIDguOTY5MDc0MTgsMjAuMTg0NjQ5MSIgZmlsbC1vcGFjaXR5PSIwLjAiIHN0cm9rZT0iIzNjNDA0MyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCwgLTExKSI+PC9wYXRoPgogIDxwYXRoIGQ9Ik04LjcxNzMyMDExLDEzLjQ3MDkzNDEgTDEwLjcxNzMyMDExLDEzLjQ3MDkzNDEgTDEwLjk2OTA3NDE4LDIwLjE4NDY0OTEgTDguNzE3MzIwMTEsMjAuMTg0NjQ5MSBaIiBmaWxsPSIjMjAyMTI0IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwLCAtMTEpIj48L3BhdGg+Cjwvc3ZnPgo=&amp;quot;); height: 10px; left: -9px; margin-top: -5px; position: absolute; top: 18px; width: 10px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;oNRNzc LvQ1Sd&quot; style=&quot;background-image: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgdmlld2JveD0iMCAwIDIyIDIyIj4KICA8cG9seWdvbiBmaWxsPSIjNzU3NTc1IiBwb2ludHM9IjIuNzUgOC4yNSAyLjc1IDEzLjc1IDYuNDE3IDEzLjc1IDExIDE4LjMzMyAxMSAzLjY2NyA2LjQxNyA4LjI1IiAvPgogIDxwYXRoIGQ9Ik0xNS4xMjUsMTEgQzE1LjEyNSw5LjM3NzUgMTQuMTksNy45ODQxNjY2NyAxMi44MzMzMzMzLDcuMzA1ODMzMzMgTDEyLjgzMzMzMzMsMTQuNjg1IEMxNC4xOSwxNC4wMTU4MzMzIDE1LjEyNSwxMi42MjI1IDE1LjEyNSwxMSBaIiBmaWxsPSIjNzU3NTc1IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIC8+CiAgPHBhdGggZD0iTTEyLjgzMzMzMzMsMi45NjA4MzMzMyBMMTIuODMzMzMzMyw0Ljg0OTE2NjY3IEMxNS40ODI1LDUuNjM3NSAxNy40MTY2NjY3LDguMDk0MTY2NjcgMTcuNDE2NjY2NywxMSBDMTcuNDE2NjY2NywxMy45MDU4MzMzIDE1LjQ4MjUsMTYuMzYyNSAxMi44MzMzMzMzLDE3LjE1MDgzMzMgTDEyLjgzMzMzMzMsMTkuMDM5MTY2NyBDMTYuNTA5MTY2NywxOC4yMDUgMTkuMjUsMTQuOTIzMzMzMyAxOS4yNSwxMSBDMTkuMjUsNy4wNzY2NjY2NyAxNi41MDkxNjY3LDMuNzk1IDEyLjgzMzMzMzMsMi45NjA4MzMzMyBaIiBmaWxsPSIjNzU3NTc1IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIC8+Cjwvc3ZnPgo=&amp;quot;); background-size: 16px 16px; height: 16px; margin-top: -8px; position: absolute; right: 12px; top: 18px; width: 16px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;XiZcCe xhNVP Pqkn2e&quot; jsname=&quot;G0x8uc&quot; style=&quot;background-color: #8ab4f8; border-color: rgb(174, 203, 250); border-radius: 17px; border-style: solid; border-width: 1px; color: #8ab4f8; display: inline-block; font-size: 16px; line-height: 24px; margin-left: 8px; opacity: 0; padding: 6px 36px 6px 12px; position: relative; word-break: break-word;&quot;&gt;If I can contrive to get off work early, I&#39;ll see you later.&lt;div class=&quot;ctWsee yKsu5&quot; style=&quot;background-image: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMHB4IiBoZWlnaHQ9IjEwcHgiIHZpZXdib3g9IjAgMCAxMCAxMCI+CiAgPHBhdGggZD0iTTguNzE3MzIwMTEsMTMuNDcwOTM0MSBDNi4zNzgxODQ0MSwxMy4yOTk0MDI3IDMuNjE3MTM1MzMsMTIuNzA2MDkwOCAwLjY3MDA5MTI2NCwxMS43NTA3MTg0IEMxLjUzODYyMzIxLDE1LjAyNDU3MzYgNC4zNzYyNTA1NCwxNy44NzAyMDUxIDguOTY5MDc0MTgsMjAuMTg0NjQ5MSIgZmlsbD0iI0U4RjBGRSIgc3Ryb2tlPSIjRDJFM0ZDIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwLCAtMTEpIj48L3BhdGg+CiAgPHBhdGggZD0iTTguNzE3MzIwMTEsMTMuNDcwOTM0MSBMMTAuNzE3MzIwMTEsMTMuNDcwOTM0MSBMMTAuOTY5MDc0MTgsMjAuMTg0NjQ5MSBMOC43MTczMjAxMSwyMC4xODQ2NDkxIFoiIGZpbGw9IiNFOEYwRkUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAsIC0xMSkiPjwvcGF0aD4KPC9zdmc+Cg==&amp;quot;); height: 10px; left: -9px; margin-top: -5px; position: absolute; top: 18px; width: 10px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;oNRNzc vCEiaf&quot; style=&quot;background-image: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgdmlld2JveD0iMCAwIDIyIDIyIj4KICA8cG9seWdvbiBmaWxsPSIjMUE3M0U4IiBwb2ludHM9IjIuNzUgOC4yNSAyLjc1IDEzLjc1IDYuNDE3IDEzLjc1IDExIDE4LjMzMyAxMSAzLjY2NyA2LjQxNyA4LjI1IiAvPgo8L3N2Zz4K&amp;quot;); background-size: 16px 16px; height: 16px; margin-top: -8px; position: absolute; right: 12px; top: 18px; width: 16px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;oNRNzc dUrmvf&quot; jsname=&quot;m1xdOb&quot; style=&quot;background-image: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgdmlld2JveD0iMCAwIDIyIDIyIj4KICA8cGF0aCBkPSJNMTUuMTI1LDExIEMxNS4xMjUsOS4zNzc1IDE0LjE5LDcuOTg0MTY2NjcgMTIuODMzMzMzMyw3LjMwNTgzMzMzIEwxMi44MzMzMzMzLDE0LjY4NSBDMTQuMTksMTQuMDE1ODMzMyAxNS4xMjUsMTIuNjIyNSAxNS4xMjUsMTEgWiIgZmlsbD0iIzFBNzNFOCIgZmlsbC1ydWxlPSJldmVub2RkIiAvPgo8L3N2Zz4K&amp;quot;); background-size: 16px 16px; height: 16px; margin-top: -8px; position: absolute; right: 12px; top: 18px; width: 16px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;oNRNzc QUoEGf&quot; jsname=&quot;DFrD7b&quot; style=&quot;background-image: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgdmlld2JveD0iMCAwIDIyIDIyIj4KICA8cGF0aCBkPSJNMTIuODMzMzMzMywyLjk2MDgzMzMzIEwxMi44MzMzMzMzLDQuODQ5MTY2NjcgQzE1LjQ4MjUsNS42Mzc1IDE3LjQxNjY2NjcsOC4wOTQxNjY2NyAxNy40MTY2NjY3LDExIEMxNy40MTY2NjY3LDEzLjkwNTgzMzMgMTUuNDgyNSwxNi4zNjI1IDEyLjgzMzMzMzMsMTcuMTUwODMzMyBMMTIuODMzMzMzMywxOS4wMzkxNjY3IEMxNi41MDkxNjY3LDE4LjIwNSAxOS4yNSwxNC45MjMzMzMzIDE5LjI1LDExIEMxOS4yNSw3LjA3NjY2NjY3IDE2LjUwOTE2NjcsMy43OTUgMTIuODMzMzMzMywyLjk2MDgzMzMzIFoiIGZpbGw9IiMxQTczRTgiIGZpbGwtcnVsZT0iZXZlbm9kZCIgLz4KPC9zdmc+Cg==&amp;quot;); background-size: 16px 16px; height: 16px; margin-top: -8px; position: absolute; right: 12px; top: 18px; width: 16px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;woZQnf&quot; style=&quot;margin-top: 16px;&quot;&gt;&lt;div class=&quot;PZPZlf&quot; data-attrid=&quot;Sense&quot; data-psd=&quot;sense_definition~:&amp;amp;to plan or invent something in a clever and/or dishonest way.&quot;&gt;&lt;div class=&quot;OYIXme tNxQIb RES9jf RiJqbb&quot; style=&quot;float: left; font-size: 16px; line-height: 24px; padding-right: 3px;&quot;&gt;2.&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;tNxQIb RiJqbb&quot; style=&quot;font-size: 16px; line-height: 24px;&quot;&gt;to plan or invent something in a clever and/or dishonest way.&lt;/div&gt;&lt;div class=&quot;wHYlTd xxjvrc ZYHQ7e&quot; style=&quot;color: #9e9e9e; line-height: 22px; margin-top: 2px;&quot;&gt;அறிவுத் திறனைப் பயன்படுத்தி அல்லது நேர்மையற்ற முறையில் அல்லது அறிவுத் திறனையும் நேர்மையின்மையையும் ஒருசேரப் பயன்படுத்தி ஒன்றைத் திட்டமிடு அல்லது புதிதாக உருவாக்கு. சூழ்ச்சித் திறனுடன் ஒன்றைச் செய் அல்லது உருவாக்கு.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description><link>https://value2read.blogspot.com/2025/11/contrive.html</link><author>noreply@blogger.com (Online Shopping)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-5983501893400430812</guid><pubDate>Fri, 14 Nov 2025 18:17:00 +0000</pubDate><atom:updated>2025-11-14T10:17:39.663-08:00</atom:updated><title>classes ([a-z])</title><description>&lt;p&gt;&amp;nbsp;classes ([a-z])&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;Y3BBE&quot; data-hveid=&quot;CAEQAA&quot; data-processed=&quot;true&quot; data-sfc-cp=&quot;&quot; jsaction=&quot;rcuQ6b:&amp;amp;HAIvgc_8|npT2md&quot; jscontroller=&quot;zcfIf&quot; jsuid=&quot;HAIvgc_8&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Roboto, Arial, sans-serif; font-size: 16px; line-height: 24px; margin: 0px 0px 20px; overflow-wrap: break-word;&quot;&gt;The regular expression&amp;nbsp;&lt;code class=&quot;o8j0Mc&quot; data-processed=&quot;true&quot; dir=&quot;ltr&quot; jscontroller=&quot;PR9Qj&quot; jsuid=&quot;HAIvgc_a&quot; style=&quot;background-color: #28292a; border-color: rgb(40, 41, 42); border-image: none 100% / 1 / 0 stretch; border-radius: 4px; border-style: solid; border-width: 0.8px; font-size: 14px; line-height: 22px; padding: 2px 4px;&quot;&gt;[a-z]&lt;/code&gt;&amp;nbsp;is a&amp;nbsp;&lt;span class=&quot;Yjhzub&quot; data-processed=&quot;true&quot; jscontroller=&quot;VhkxAe&quot; jsuid=&quot;HAIvgc_b&quot; style=&quot;font-weight: bolder;&quot;&gt;character class&lt;/span&gt;&amp;nbsp;that matches any single lowercase letter from &#39;a&#39; to &#39;z&#39;, inclusive.&lt;span class=&quot;uJ19be notranslate&quot; data-processed=&quot;true&quot; data-wiz-uids=&quot;HAIvgc_c,HAIvgc_d,HAIvgc_e&quot; jsaction=&quot;rcuQ6b:&amp;amp;HAIvgc_c|npT2md&quot; jscontroller=&quot;udAs2b&quot; jsuid=&quot;HAIvgc_c&quot;&gt;&lt;span class=&quot;vKEkVd&quot; data-animation-atomic=&quot;&quot; data-processed=&quot;true&quot; style=&quot;position: relative; text-wrap-mode: nowrap;&quot;&gt;&amp;nbsp;&lt;button aria-label=&quot;View related links&quot; class=&quot;rBl3me&quot; data-amic=&quot;true&quot; data-icl-uuid=&quot;48a1f5bb-fff7-4865-814b-98ce10170755&quot; data-processed=&quot;true&quot; data-ved=&quot;2ahUKEwjj-ILOn_KQAxVkSWwGHcqgNMwQye0OegQIARAB&quot; data-wiz-attrbind=&quot;disabled=HAIvgc_c_C5gNJc;class=HAIvgc_c_UpSNec;&quot; jsaction=&quot;click:&amp;amp;HAIvgc_c|S9kKve;mouseenter:&amp;amp;HAIvgc_c|sbHm2b;mouseleave:&amp;amp;HAIvgc_c|Tx5Rb&quot; jsuid=&quot;HAIvgc_e&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-color: initial; border-radius: 10px; border-style: none; border-width: initial; cursor: pointer; height: 20px; margin: 0px 6px 0px 0px; outline: 0px; padding: 0px; position: relative; width: 28px;&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;wiMplc ofC0Ud&quot; data-processed=&quot;true&quot; style=&quot;color: #eef0ff; display: inline-block; transform: rotate(135deg);&quot;&gt;&lt;svg fill=&quot;currentColor&quot; focusable=&quot;false&quot; height=&quot;12px&quot; style=&quot;margin-top: 3px;&quot; viewbox=&quot;0 0 24 24&quot; width=&quot;12px&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;Fsg96&quot; data-processed=&quot;true&quot; data-sfc-cp=&quot;&quot; jsaction=&quot;rcuQ6b:&amp;amp;HAIvgc_h|npT2md&quot; jscontroller=&quot;KHhJQ&quot; jsuid=&quot;HAIvgc_h&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Roboto, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;/div&gt;&lt;div aria-level=&quot;3&quot; class=&quot;AdPoic&quot; data-animation-nesting=&quot;&quot; data-processed=&quot;true&quot; data-sfc-cp=&quot;&quot; jscontroller=&quot;SF2W9b&quot; jsuid=&quot;HAIvgc_i&quot; role=&quot;heading&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Roboto, Arial, sans-serif; font-size: 20px; font-weight: 600; line-height: 28px; margin: 20px 0px 10px;&quot;&gt;Explanation of&amp;nbsp;&lt;code class=&quot;o8j0Mc&quot; data-processed=&quot;true&quot; dir=&quot;ltr&quot; jscontroller=&quot;PR9Qj&quot; jsuid=&quot;HAIvgc_j&quot; style=&quot;background-color: #28292a; border-color: rgb(40, 41, 42); border-image: none 100% / 1 / 0 stretch; border-radius: 4px; border-style: solid; border-width: 0.8px; font-size: 14px; line-height: 22px; padding: 2px 4px;&quot;&gt;[a-z]&lt;/code&gt;&lt;span class=&quot;txxDge notranslate&quot; data-processed=&quot;true&quot; data-wiz-uids=&quot;HAIvgc_k,HAIvgc_l,HAIvgc_m&quot; jsaction=&quot;rcuQ6b:&amp;amp;HAIvgc_k|npT2md&quot; jscontroller=&quot;udAs2b&quot; jsuid=&quot;HAIvgc_k&quot; style=&quot;visibility: hidden;&quot;&gt;&lt;span class=&quot;vKEkVd&quot; data-animation-atomic=&quot;&quot; data-processed=&quot;true&quot; style=&quot;position: relative; text-wrap-mode: nowrap;&quot;&gt;&lt;button aria-label=&quot;View related links&quot; class=&quot;rBl3me&quot; data-amic=&quot;true&quot; data-icl-uuid=&quot;40689f58-32cb-4982-a548-14a49b83f907&quot; data-processed=&quot;true&quot; data-ved=&quot;2ahUKEwjj-ILOn_KQAxVkSWwGHcqgNMwQye0OegQIAhAA&quot; data-wiz-attrbind=&quot;disabled=HAIvgc_k_C5gNJc;class=HAIvgc_k_UpSNec;&quot; jsaction=&quot;click:&amp;amp;HAIvgc_k|S9kKve;mouseenter:&amp;amp;HAIvgc_k|sbHm2b;mouseleave:&amp;amp;HAIvgc_k|Tx5Rb&quot; jsuid=&quot;HAIvgc_m&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-color: initial; border-radius: 10px; border-style: none; border-width: initial; cursor: pointer; height: 20px; margin: 0px 6px 0px 0px; outline: 0px; padding: 0px; position: relative; width: 28px;&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;wiMplc ofC0Ud&quot; data-processed=&quot;true&quot; style=&quot;color: #eef0ff; display: inline-block; transform: rotate(135deg);&quot;&gt;&lt;svg fill=&quot;currentColor&quot; focusable=&quot;false&quot; height=&quot;12px&quot; style=&quot;margin-top: 3px;&quot; viewbox=&quot;0 0 24 24&quot; width=&quot;12px&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul class=&quot;KsbFXc U6u95&quot; data-processed=&quot;true&quot; jscontroller=&quot;mPWODf&quot; jsuid=&quot;HAIvgc_n&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Roboto, Arial, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 20px; padding-inline-start: 16px; padding: 0px;&quot;&gt;&lt;li data-hveid=&quot;CAMQAA&quot; data-processed=&quot;true&quot; jscontroller=&quot;vsuOFb&quot; jsuid=&quot;HAIvgc_o&quot; style=&quot;list-style: disc; margin: 0px 0px 12px; padding-inline-start: 4px; padding: 0px;&quot;&gt;&lt;span class=&quot;T286Pc&quot; data-processed=&quot;true&quot; data-sfc-cp=&quot;&quot; jscontroller=&quot;fly6D&quot; jsuid=&quot;HAIvgc_p&quot; style=&quot;overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;Yjhzub&quot; data-processed=&quot;true&quot; jscontroller=&quot;VhkxAe&quot; jsuid=&quot;HAIvgc_q&quot; style=&quot;font-weight: bolder;&quot;&gt;&lt;code class=&quot;o8j0Mc&quot; data-processed=&quot;true&quot; dir=&quot;ltr&quot; jscontroller=&quot;PR9Qj&quot; jsuid=&quot;HAIvgc_r&quot; style=&quot;background-color: #28292a; border-color: rgb(40, 41, 42); border-image: none 100% / 1 / 0 stretch; border-radius: 4px; border-style: solid; border-width: 0.8px; font-size: 14px; line-height: 22px; padding: 2px 4px;&quot;&gt;[]&lt;/code&gt;&amp;nbsp;(Square Brackets):&lt;/span&gt;&amp;nbsp;These define a character class (or set). Any single character within the input string that matches any character in the set will satisfy this part of the expression.&lt;/span&gt;&lt;/li&gt;&lt;li data-hveid=&quot;CAMQAQ&quot; data-processed=&quot;true&quot; jscontroller=&quot;vsuOFb&quot; jsuid=&quot;HAIvgc_s&quot; style=&quot;list-style: disc; margin: 0px 0px 12px; padding-inline-start: 4px; padding: 0px;&quot;&gt;&lt;span class=&quot;T286Pc&quot; data-processed=&quot;true&quot; data-sfc-cp=&quot;&quot; jscontroller=&quot;fly6D&quot; jsuid=&quot;HAIvgc_t&quot; style=&quot;overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;Yjhzub&quot; data-processed=&quot;true&quot; jscontroller=&quot;VhkxAe&quot; jsuid=&quot;HAIvgc_u&quot; style=&quot;font-weight: bolder;&quot;&gt;&lt;code class=&quot;o8j0Mc&quot; data-processed=&quot;true&quot; dir=&quot;ltr&quot; jscontroller=&quot;PR9Qj&quot; jsuid=&quot;HAIvgc_v&quot; style=&quot;background-color: #28292a; border-color: rgb(40, 41, 42); border-image: none 100% / 1 / 0 stretch; border-radius: 4px; border-style: solid; border-width: 0.8px; font-size: 14px; line-height: 22px; padding: 2px 4px;&quot;&gt;a-z&lt;/code&gt;&amp;nbsp;(Hyphenated Range):&lt;/span&gt;&amp;nbsp;The hyphen inside the square brackets specifies a range of characters. It includes every character in the range between the start character (&#39;a&#39;) and the end character (&#39;z&#39;), based on the character encoding (typically ASCII or Unicode).&lt;/span&gt;&lt;span class=&quot;uJ19be notranslate&quot; data-processed=&quot;true&quot; data-wiz-uids=&quot;HAIvgc_w,HAIvgc_x,HAIvgc_y&quot; jsaction=&quot;rcuQ6b:&amp;amp;HAIvgc_w|npT2md&quot; jscontroller=&quot;udAs2b&quot; jsuid=&quot;HAIvgc_w&quot;&gt;&lt;span class=&quot;vKEkVd&quot; data-animation-atomic=&quot;&quot; data-processed=&quot;true&quot; style=&quot;position: relative; text-wrap-mode: nowrap;&quot;&gt;&amp;nbsp;&lt;button aria-label=&quot;View related links&quot; class=&quot;rBl3me&quot; data-amic=&quot;true&quot; data-icl-uuid=&quot;1730400b-3c43-426f-8329-453cf8e15154&quot; data-processed=&quot;true&quot; data-ved=&quot;2ahUKEwjj-ILOn_KQAxVkSWwGHcqgNMwQye0OegQIAxAC&quot; data-wiz-attrbind=&quot;disabled=HAIvgc_w_C5gNJc;class=HAIvgc_w_UpSNec;&quot; jsaction=&quot;click:&amp;amp;HAIvgc_w|S9kKve;mouseenter:&amp;amp;HAIvgc_w|sbHm2b;mouseleave:&amp;amp;HAIvgc_w|Tx5Rb&quot; jsuid=&quot;HAIvgc_y&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-color: initial; border-radius: 10px; border-style: none; border-width: initial; cursor: pointer; height: 20px; margin: 0px 6px 0px 0px; outline: 0px; padding: 0px; position: relative; width: 28px;&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;wiMplc ofC0Ud&quot; data-processed=&quot;true&quot; style=&quot;color: #eef0ff; display: inline-block; transform: rotate(135deg);&quot;&gt;&lt;svg fill=&quot;currentColor&quot; focusable=&quot;false&quot; height=&quot;12px&quot; style=&quot;margin-top: 3px;&quot; viewbox=&quot;0 0 24 24&quot; width=&quot;12px&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;Fsg96&quot; data-processed=&quot;true&quot; data-sfc-cp=&quot;&quot; jsaction=&quot;rcuQ6b:&amp;amp;HAIvgc_12|npT2md&quot; jscontroller=&quot;KHhJQ&quot; jsuid=&quot;HAIvgc_12&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Roboto, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;/div&gt;&lt;div aria-level=&quot;3&quot; class=&quot;AdPoic&quot; data-animation-nesting=&quot;&quot; data-processed=&quot;true&quot; data-sfc-cp=&quot;&quot; jscontroller=&quot;SF2W9b&quot; jsuid=&quot;HAIvgc_13&quot; role=&quot;heading&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Roboto, Arial, sans-serif; font-size: 20px; font-weight: 600; line-height: 28px; margin: 20px 0px 10px;&quot;&gt;Key Points&lt;span class=&quot;txxDge notranslate&quot; data-processed=&quot;true&quot; data-wiz-uids=&quot;HAIvgc_14,HAIvgc_15,HAIvgc_16&quot; jsaction=&quot;rcuQ6b:&amp;amp;HAIvgc_14|npT2md&quot; jscontroller=&quot;udAs2b&quot; jsuid=&quot;HAIvgc_14&quot; style=&quot;visibility: hidden;&quot;&gt;&lt;span class=&quot;vKEkVd&quot; data-animation-atomic=&quot;&quot; data-processed=&quot;true&quot; style=&quot;position: relative; text-wrap-mode: nowrap;&quot;&gt;&lt;button aria-label=&quot;View related links&quot; class=&quot;rBl3me&quot; data-amic=&quot;true&quot; data-icl-uuid=&quot;ff5a161d-d272-440f-97f2-f952cf222541&quot; data-processed=&quot;true&quot; data-ved=&quot;2ahUKEwjj-ILOn_KQAxVkSWwGHcqgNMwQye0OegQIBBAA&quot; data-wiz-attrbind=&quot;disabled=HAIvgc_14_C5gNJc;class=HAIvgc_14_UpSNec;&quot; jsaction=&quot;click:&amp;amp;HAIvgc_14|S9kKve;mouseenter:&amp;amp;HAIvgc_14|sbHm2b;mouseleave:&amp;amp;HAIvgc_14|Tx5Rb&quot; jsuid=&quot;HAIvgc_16&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-color: initial; border-radius: 10px; border-style: none; border-width: initial; cursor: pointer; height: 20px; margin: 0px 6px 0px 0px; outline: 0px; padding: 0px; position: relative; width: 28px;&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;wiMplc ofC0Ud&quot; data-processed=&quot;true&quot; style=&quot;color: #eef0ff; display: inline-block; transform: rotate(135deg);&quot;&gt;&lt;svg fill=&quot;currentColor&quot; focusable=&quot;false&quot; height=&quot;12px&quot; style=&quot;margin-top: 3px;&quot; viewbox=&quot;0 0 24 24&quot; width=&quot;12px&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul class=&quot;KsbFXc U6u95&quot; data-processed=&quot;true&quot; jscontroller=&quot;mPWODf&quot; jsuid=&quot;HAIvgc_2v&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Roboto, Arial, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 20px; padding-inline-start: 16px; padding: 0px;&quot;&gt;&lt;li data-hveid=&quot;CAYQAA&quot; data-processed=&quot;true&quot; jscontroller=&quot;vsuOFb&quot; jsuid=&quot;HAIvgc_2w&quot; style=&quot;list-style: disc; margin: 0px 0px 12px; padding-inline-start: 4px; padding: 0px;&quot;&gt;&lt;span class=&quot;T286Pc&quot; data-processed=&quot;true&quot; data-sfc-cp=&quot;&quot; jscontroller=&quot;fly6D&quot; jsuid=&quot;HAIvgc_2x&quot; style=&quot;overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;Yjhzub&quot; data-processed=&quot;true&quot; jscontroller=&quot;VhkxAe&quot; jsuid=&quot;HAIvgc_2y&quot; style=&quot;font-weight: bolder;&quot;&gt;Single Character Match:&lt;/span&gt;&amp;nbsp;&lt;code class=&quot;o8j0Mc&quot; data-processed=&quot;true&quot; dir=&quot;ltr&quot; jscontroller=&quot;PR9Qj&quot; jsuid=&quot;HAIvgc_2z&quot; style=&quot;background-color: #28292a; border-color: rgb(40, 41, 42); border-image: none 100% / 1 / 0 stretch; border-radius: 4px; border-style: solid; border-width: 0.8px; font-size: 14px; line-height: 22px; padding: 2px 4px;&quot;&gt;[a-z]&lt;/code&gt;&amp;nbsp;matches&amp;nbsp;&lt;em class=&quot;eujQNb&quot; data-processed=&quot;true&quot; jscontroller=&quot;yHWXO&quot; jsuid=&quot;HAIvgc_30&quot; style=&quot;font-weight: inherit;&quot;&gt;one&lt;/em&gt;&amp;nbsp;single character, which can be &#39;a&#39;, &#39;b&#39;, &#39;c&#39;, ..., all the way to &#39;z&#39;.&lt;/span&gt;&lt;/li&gt;&lt;li data-hveid=&quot;CAYQAQ&quot; data-processed=&quot;true&quot; jscontroller=&quot;vsuOFb&quot; jsuid=&quot;HAIvgc_31&quot; style=&quot;list-style: disc; margin: 0px 0px 12px; padding-inline-start: 4px; padding: 0px;&quot;&gt;&lt;span class=&quot;T286Pc&quot; data-processed=&quot;true&quot; data-sfc-cp=&quot;&quot; jscontroller=&quot;fly6D&quot; jsuid=&quot;HAIvgc_32&quot; style=&quot;overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;Yjhzub&quot; data-processed=&quot;true&quot; jscontroller=&quot;VhkxAe&quot; jsuid=&quot;HAIvgc_33&quot; style=&quot;font-weight: bolder;&quot;&gt;Case Sensitivity:&lt;/span&gt;&amp;nbsp;By default, this expression is case-sensitive and will not match uppercase letters like &#39;A&#39;, &#39;B&#39;, etc. To match both cases, you would use&amp;nbsp;&lt;code class=&quot;o8j0Mc&quot; data-processed=&quot;true&quot; dir=&quot;ltr&quot; jscontroller=&quot;PR9Qj&quot; jsuid=&quot;HAIvgc_34&quot; style=&quot;background-color: #28292a; border-color: rgb(40, 41, 42); border-image: none 100% / 1 / 0 stretch; border-radius: 4px; border-style: solid; border-width: 0.8px; font-size: 14px; line-height: 22px; padding: 2px 4px;&quot;&gt;[a-zA-Z]&lt;/code&gt;.&lt;/span&gt;&lt;/li&gt;&lt;li data-hveid=&quot;CAYQAg&quot; data-processed=&quot;true&quot; jscontroller=&quot;vsuOFb&quot; jsuid=&quot;HAIvgc_35&quot; style=&quot;list-style: disc; margin: 0px 0px 12px; padding-inline-start: 4px; padding: 0px;&quot;&gt;&lt;span class=&quot;T286Pc&quot; data-processed=&quot;true&quot; data-sfc-cp=&quot;&quot; jscontroller=&quot;fly6D&quot; jsuid=&quot;HAIvgc_36&quot; style=&quot;overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;Yjhzub&quot; data-processed=&quot;true&quot; jscontroller=&quot;VhkxAe&quot; jsuid=&quot;HAIvgc_37&quot; style=&quot;font-weight: bolder;&quot;&gt;Multiple Occurrences:&lt;/span&gt;&amp;nbsp;To match a sequence of one or more lowercase letters, you would append a quantifier, such as the plus sign (&lt;code class=&quot;o8j0Mc&quot; data-processed=&quot;true&quot; dir=&quot;ltr&quot; jscontroller=&quot;PR9Qj&quot; jsuid=&quot;HAIvgc_38&quot; style=&quot;background-color: #28292a; border-color: rgb(40, 41, 42); border-image: none 100% / 1 / 0 stretch; border-radius: 4px; border-style: solid; border-width: 0.8px; font-size: 14px; line-height: 22px; padding: 2px 4px;&quot;&gt;+&lt;/code&gt;) for one or more (&lt;code class=&quot;o8j0Mc&quot; data-processed=&quot;true&quot; dir=&quot;ltr&quot; jscontroller=&quot;PR9Qj&quot; jsuid=&quot;HAIvgc_39&quot; style=&quot;background-color: #28292a; border-color: rgb(40, 41, 42); border-image: none 100% / 1 / 0 stretch; border-radius: 4px; border-style: solid; border-width: 0.8px; font-size: 14px; line-height: 22px; padding: 2px 4px;&quot;&gt;[a-z]+&lt;/code&gt;) or the asterisk (&lt;code class=&quot;o8j0Mc&quot; data-processed=&quot;true&quot; dir=&quot;ltr&quot; jscontroller=&quot;PR9Qj&quot; jsuid=&quot;HAIvgc_3a&quot; style=&quot;background-color: #28292a; border-color: rgb(40, 41, 42); border-image: none 100% / 1 / 0 stretch; border-radius: 4px; border-style: solid; border-width: 0.8px; font-size: 14px; line-height: 22px; padding: 2px 4px;&quot;&gt;*&lt;/code&gt;) for zero or more (&lt;code class=&quot;o8j0Mc&quot; data-processed=&quot;true&quot; dir=&quot;ltr&quot; jscontroller=&quot;PR9Qj&quot; jsuid=&quot;HAIvgc_3b&quot; style=&quot;background-color: #28292a; border-color: rgb(40, 41, 42); border-image: none 100% / 1 / 0 stretch; border-radius: 4px; border-style: solid; border-width: 0.8px; font-size: 14px; line-height: 22px; padding: 2px 4px;&quot;&gt;[a-z]*&lt;/code&gt;).&lt;/span&gt;&lt;/li&gt;&lt;li data-hveid=&quot;CAYQAw&quot; data-processed=&quot;true&quot; jscontroller=&quot;vsuOFb&quot; jsuid=&quot;HAIvgc_3c&quot; style=&quot;list-style: disc; margin: 0px 0px 12px; padding-inline-start: 4px; padding: 0px;&quot;&gt;&lt;span class=&quot;T286Pc&quot; data-processed=&quot;true&quot; data-sfc-cp=&quot;&quot; jscontroller=&quot;fly6D&quot; jsuid=&quot;HAIvgc_3d&quot; style=&quot;overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;Yjhzub&quot; data-processed=&quot;true&quot; jscontroller=&quot;VhkxAe&quot; jsuid=&quot;HAIvgc_3e&quot; style=&quot;font-weight: bolder;&quot;&gt;Context:&lt;/span&gt;&amp;nbsp;The behavior can be slightly different depending on the specific regular expression engine or programming language (e.g., Python, JavaScript, Java), but the core concept of a lowercase character class remains consistent.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;</description><link>https://value2read.blogspot.com/2025/11/classes-z.html</link><author>noreply@blogger.com (Online Shopping)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-5846479983366567854</guid><pubDate>Thu, 13 Nov 2025 18:13:08 +0000</pubDate><atom:updated>2025-11-13T10:13:19.165-08:00</atom:updated><title>🛑 The Problem: Diverged History</title><description>&lt;p&gt;&amp;nbsp;That error message is a very common scenario in Git, and it clearly explains what the problem is!&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;The message: &lt;b&gt;&quot;Updates were rejected because the tip of your current branch is behind its remote counterpart&quot;&lt;/b&gt; means that someone (or you, via the GitHub interface) has made changes and committed them to the repository on GitHub &lt;b&gt;after&lt;/b&gt; you last updated your local copy.&lt;/p&gt;&lt;p&gt;Your local history and the remote history have &quot;diverged.&quot; Git is preventing you from pushing because doing so would overwrite the remote changes and potentially cause a loss of work.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;h2&gt;✅ The Solution: Integrate Remote Changes (&lt;code&gt;git pull&lt;/code&gt;)&lt;/h2&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;To fix this, you need to first &lt;b&gt;pull&lt;/b&gt; the new changes from GitHub into your local branch. This integrates the remote work with your local commits.&lt;/p&gt;&lt;p&gt;You have two main options for pulling:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;h3&gt;Option 1: &lt;code&gt;git pull&lt;/code&gt; (Default: Merge)&lt;/h3&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;This is the standard approach. It downloads the remote changes and creates a special &lt;b&gt;merge commit&lt;/b&gt; to join the two diverging histories.&lt;/p&gt;&lt;response-element class=&quot;&quot; ng-version=&quot;0.0.0-PLACEHOLDER&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;code-block _nghost-ng-c2267283082=&quot;&quot; class=&quot;ng-tns-c2267283082-55 ng-star-inserted&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;div _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;code-block ng-tns-c2267283082-55 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation&quot; data-hveid=&quot;0&quot; data-ved=&quot;0CAAQhtANahcKEwiazaCg3O-QAxUAAAAAHQAAAAAQbA&quot; decode-data-ved=&quot;1&quot; jslog=&quot;223238;track:impression,attention;BardVeMetadataKey:[[&amp;quot;r_d1432b7e8359d005&amp;quot;,&amp;quot;c_2eb7c92aa21410ce&amp;quot;,null,&amp;quot;rc_be32316c02eb9c7d&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]]&quot;&gt;&lt;div _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c2267283082-55 ng-star-inserted&quot;&gt;&lt;span _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;ng-tns-c2267283082-55&quot;&gt;Bash&lt;/span&gt;&lt;div _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;buttons ng-tns-c2267283082-55 ng-star-inserted&quot;&gt;&lt;button _ngcontent-ng-c2267283082=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c2267283082-55 mat-unthemed ng-star-inserted&quot; jslog=&quot;179062;track:generic_click,impression;BardVeMetadataKey:[[&amp;quot;r_d1432b7e8359d005&amp;quot;,&amp;quot;c_2eb7c92aa21410ce&amp;quot;,null,&amp;quot;rc_be32316c02eb9c7d&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]];mutable:true&quot; mat-icon-button=&quot;&quot; mat-ripple-loader-centered=&quot;&quot; mat-ripple-loader-class-name=&quot;mat-mdc-button-ripple&quot; mat-ripple-loader-uninitialized=&quot;&quot; mattooltip=&quot;Copy code&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot;&gt;&lt;/span&gt;&lt;mat-icon _ngcontent-ng-c2267283082=&quot;&quot; aria-hidden=&quot;true&quot; class=&quot;mat-icon notranslate google-symbols mat-ligature-font mat-icon-no-color&quot; data-mat-icon-name=&quot;content_copy&quot; data-mat-icon-type=&quot;font&quot; fonticon=&quot;content_copy&quot; role=&quot;img&quot;&gt;&lt;/mat-icon&gt;&lt;span class=&quot;mat-focus-indicator&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;!----&gt;&lt;!----&gt;&lt;/div&gt;&lt;!----&gt;&lt;/div&gt;&lt;!----&gt;&lt;div _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c2267283082-55&quot;&gt;&lt;div _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;animated-opacity ng-tns-c2267283082-55&quot;&gt;&lt;pre _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;ng-tns-c2267283082-55&quot;&gt;&lt;code _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;code-container formatted ng-tns-c2267283082-55&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot;&gt;git pull origin main
&lt;/code&gt;&lt;/pre&gt;&lt;!----&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;!----&gt;&lt;!----&gt;&lt;/code-block&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;/response-element&gt;&lt;p&gt;&lt;i&gt;(Use &lt;code&gt;main&lt;/code&gt; or &lt;code&gt;master&lt;/code&gt;, whichever branch you are working on.)&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;h3&gt;Option 2: &lt;code&gt;git pull --rebase&lt;/code&gt; (Recommended for Cleaner History)&lt;/h3&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;This is often preferred as it rewrites your local commits to occur &lt;i&gt;after&lt;/i&gt; the remote commits, resulting in a perfectly linear history (no extra merge commit).&lt;/p&gt;&lt;response-element class=&quot;&quot; ng-version=&quot;0.0.0-PLACEHOLDER&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;code-block _nghost-ng-c2267283082=&quot;&quot; class=&quot;ng-tns-c2267283082-56 ng-star-inserted&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;div _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;code-block ng-tns-c2267283082-56 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation&quot; data-hveid=&quot;0&quot; data-ved=&quot;0CAAQhtANahcKEwiazaCg3O-QAxUAAAAAHQAAAAAQbQ&quot; decode-data-ved=&quot;1&quot; jslog=&quot;223238;track:impression,attention;BardVeMetadataKey:[[&amp;quot;r_d1432b7e8359d005&amp;quot;,&amp;quot;c_2eb7c92aa21410ce&amp;quot;,null,&amp;quot;rc_be32316c02eb9c7d&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]]&quot;&gt;&lt;div _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c2267283082-56 ng-star-inserted&quot;&gt;&lt;span _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;ng-tns-c2267283082-56&quot;&gt;Bash&lt;/span&gt;&lt;div _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;buttons ng-tns-c2267283082-56 ng-star-inserted&quot;&gt;&lt;button _ngcontent-ng-c2267283082=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c2267283082-56 mat-unthemed ng-star-inserted&quot; jslog=&quot;179062;track:generic_click,impression;BardVeMetadataKey:[[&amp;quot;r_d1432b7e8359d005&amp;quot;,&amp;quot;c_2eb7c92aa21410ce&amp;quot;,null,&amp;quot;rc_be32316c02eb9c7d&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]];mutable:true&quot; mat-icon-button=&quot;&quot; mat-ripple-loader-centered=&quot;&quot; mat-ripple-loader-class-name=&quot;mat-mdc-button-ripple&quot; mat-ripple-loader-uninitialized=&quot;&quot; mattooltip=&quot;Copy code&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot;&gt;&lt;/span&gt;&lt;mat-icon _ngcontent-ng-c2267283082=&quot;&quot; aria-hidden=&quot;true&quot; class=&quot;mat-icon notranslate google-symbols mat-ligature-font mat-icon-no-color&quot; data-mat-icon-name=&quot;content_copy&quot; data-mat-icon-type=&quot;font&quot; fonticon=&quot;content_copy&quot; role=&quot;img&quot;&gt;&lt;/mat-icon&gt;&lt;span class=&quot;mat-focus-indicator&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;!----&gt;&lt;!----&gt;&lt;/div&gt;&lt;!----&gt;&lt;/div&gt;&lt;!----&gt;&lt;div _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c2267283082-56&quot;&gt;&lt;div _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;animated-opacity ng-tns-c2267283082-56&quot;&gt;&lt;pre _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;ng-tns-c2267283082-56&quot;&gt;&lt;code _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;code-container formatted ng-tns-c2267283082-56&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot;&gt;git pull --rebase origin main
&lt;/code&gt;&lt;/pre&gt;&lt;!----&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;!----&gt;&lt;!----&gt;&lt;/code-block&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;/response-element&gt;&lt;p&gt;&lt;b&gt;Steps to Resolve the Error:&lt;/b&gt;&lt;/p&gt;&lt;ol start=&quot;1&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Pull the Changes:&lt;/b&gt; Run the preferred &lt;code&gt;git pull&lt;/code&gt; command (I recommend the rebase option):&lt;/p&gt;&lt;response-element class=&quot;&quot; ng-version=&quot;0.0.0-PLACEHOLDER&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;code-block _nghost-ng-c2267283082=&quot;&quot; class=&quot;ng-tns-c2267283082-57 ng-star-inserted&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;div _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;code-block ng-tns-c2267283082-57 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation&quot; data-hveid=&quot;0&quot; data-ved=&quot;0CAAQhtANahcKEwiazaCg3O-QAxUAAAAAHQAAAAAQbg&quot; decode-data-ved=&quot;1&quot; jslog=&quot;223238;track:impression,attention;BardVeMetadataKey:[[&amp;quot;r_d1432b7e8359d005&amp;quot;,&amp;quot;c_2eb7c92aa21410ce&amp;quot;,null,&amp;quot;rc_be32316c02eb9c7d&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]]&quot;&gt;&lt;div _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c2267283082-57 ng-star-inserted&quot;&gt;&lt;span _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;ng-tns-c2267283082-57&quot;&gt;Bash&lt;/span&gt;&lt;div _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;buttons ng-tns-c2267283082-57 ng-star-inserted&quot;&gt;&lt;button _ngcontent-ng-c2267283082=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c2267283082-57 mat-unthemed ng-star-inserted&quot; jslog=&quot;179062;track:generic_click,impression;BardVeMetadataKey:[[&amp;quot;r_d1432b7e8359d005&amp;quot;,&amp;quot;c_2eb7c92aa21410ce&amp;quot;,null,&amp;quot;rc_be32316c02eb9c7d&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]];mutable:true&quot; mat-icon-button=&quot;&quot; mat-ripple-loader-centered=&quot;&quot; mat-ripple-loader-class-name=&quot;mat-mdc-button-ripple&quot; mat-ripple-loader-uninitialized=&quot;&quot; mattooltip=&quot;Copy code&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot;&gt;&lt;/span&gt;&lt;mat-icon _ngcontent-ng-c2267283082=&quot;&quot; aria-hidden=&quot;true&quot; class=&quot;mat-icon notranslate google-symbols mat-ligature-font mat-icon-no-color&quot; data-mat-icon-name=&quot;content_copy&quot; data-mat-icon-type=&quot;font&quot; fonticon=&quot;content_copy&quot; role=&quot;img&quot;&gt;&lt;/mat-icon&gt;&lt;span class=&quot;mat-focus-indicator&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;!----&gt;&lt;!----&gt;&lt;/div&gt;&lt;!----&gt;&lt;/div&gt;&lt;!----&gt;&lt;div _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c2267283082-57&quot;&gt;&lt;div _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;animated-opacity ng-tns-c2267283082-57&quot;&gt;&lt;pre _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;ng-tns-c2267283082-57&quot;&gt;&lt;code _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;code-container formatted ng-tns-c2267283082-57&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot;&gt;git pull --rebase origin main
&lt;/code&gt;&lt;/pre&gt;&lt;!----&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;!----&gt;&lt;!----&gt;&lt;/code-block&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;/response-element&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Resolve Conflicts (If they occur):&lt;/b&gt; If both you and the remote change the &lt;i&gt;same lines&lt;/i&gt; in the &lt;i&gt;same file&lt;/i&gt;, Git will pause and ask you to resolve the &lt;b&gt;merge conflict&lt;/b&gt;.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Open the conflicting files (they will have &lt;code&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/code&gt;, &lt;code&gt;=======&lt;/code&gt;, and &lt;code&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/code&gt; markers).&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Edit the file to include the final desired code.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Stage the resolved file(s): &lt;code&gt;git add .&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Continue the rebase/merge:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;If using &lt;b&gt;&lt;code&gt;--rebase&lt;/code&gt;&lt;/b&gt;: &lt;code&gt;git rebase --continue&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;If using &lt;b&gt;merge&lt;/b&gt;: &lt;code&gt;git commit -m &quot;Merged remote changes&quot;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Push the Integrated Changes:&lt;/b&gt; Once the pull/merge/rebase is complete, your local branch is up-to-date and ahead of the remote. You can now push successfully.&lt;/p&gt;&lt;response-element class=&quot;&quot; ng-version=&quot;0.0.0-PLACEHOLDER&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;code-block _nghost-ng-c2267283082=&quot;&quot; class=&quot;ng-tns-c2267283082-58 ng-star-inserted&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;div _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;code-block ng-tns-c2267283082-58 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation&quot; data-hveid=&quot;0&quot; data-ved=&quot;0CAAQhtANahcKEwiazaCg3O-QAxUAAAAAHQAAAAAQbw&quot; decode-data-ved=&quot;1&quot; jslog=&quot;223238;track:impression,attention;BardVeMetadataKey:[[&amp;quot;r_d1432b7e8359d005&amp;quot;,&amp;quot;c_2eb7c92aa21410ce&amp;quot;,null,&amp;quot;rc_be32316c02eb9c7d&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]]&quot;&gt;&lt;div _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c2267283082-58 ng-star-inserted&quot;&gt;&lt;span _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;ng-tns-c2267283082-58&quot;&gt;Bash&lt;/span&gt;&lt;div _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;buttons ng-tns-c2267283082-58 ng-star-inserted&quot;&gt;&lt;button _ngcontent-ng-c2267283082=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c2267283082-58 mat-unthemed ng-star-inserted&quot; jslog=&quot;179062;track:generic_click,impression;BardVeMetadataKey:[[&amp;quot;r_d1432b7e8359d005&amp;quot;,&amp;quot;c_2eb7c92aa21410ce&amp;quot;,null,&amp;quot;rc_be32316c02eb9c7d&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]];mutable:true&quot; mat-icon-button=&quot;&quot; mat-ripple-loader-centered=&quot;&quot; mat-ripple-loader-class-name=&quot;mat-mdc-button-ripple&quot; mat-ripple-loader-uninitialized=&quot;&quot; mattooltip=&quot;Copy code&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot;&gt;&lt;/span&gt;&lt;mat-icon _ngcontent-ng-c2267283082=&quot;&quot; aria-hidden=&quot;true&quot; class=&quot;mat-icon notranslate google-symbols mat-ligature-font mat-icon-no-color&quot; data-mat-icon-name=&quot;content_copy&quot; data-mat-icon-type=&quot;font&quot; fonticon=&quot;content_copy&quot; role=&quot;img&quot;&gt;&lt;/mat-icon&gt;&lt;span class=&quot;mat-focus-indicator&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;!----&gt;&lt;!----&gt;&lt;/div&gt;&lt;!----&gt;&lt;/div&gt;&lt;!----&gt;&lt;div _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c2267283082-58&quot;&gt;&lt;div _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;animated-opacity ng-tns-c2267283082-58&quot;&gt;&lt;pre _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;ng-tns-c2267283082-58&quot;&gt;&lt;code _ngcontent-ng-c2267283082=&quot;&quot; class=&quot;code-container formatted ng-tns-c2267283082-58&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot;&gt;git push
&lt;/code&gt;&lt;/pre&gt;&lt;!----&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;!----&gt;&lt;!----&gt;&lt;/code-block&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;/response-element&gt;&lt;p&gt;(You don&#39;t need the &lt;code&gt;-u origin main&lt;/code&gt; this time unless you haven&#39;t used it before).&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Let me know if you run into any &lt;b&gt;merge conflicts&lt;/b&gt;!&lt;/p&gt;</description><link>https://value2read.blogspot.com/2025/11/problem-diverged-history.html</link><author>noreply@blogger.com (Online Shopping)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-6592709871879732453</guid><pubDate>Wed, 12 Nov 2025 14:24:00 +0000</pubDate><atom:updated>2025-11-12T06:24:10.103-08:00</atom:updated><title>server.error.include-message=always</title><description>&lt;p&gt;In Java itself, there is &lt;strong&gt;no built‑in “application property”&lt;/strong&gt; that automatically makes exceptions show their messages — exceptions always have a &lt;code&gt;getMessage()&lt;/code&gt; method, and whether they are shown depends on &lt;strong&gt;how your application logs or prints them&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;However, in &lt;strong&gt;Java frameworks&lt;/strong&gt; (like Spring Boot, Jakarta EE, Micronaut, etc.), there &lt;em&gt;are&lt;/em&gt; configuration properties that control whether exception messages are shown in responses or logs.&lt;/p&gt;
&lt;hr /&gt;
&lt;h3&gt;&lt;strong&gt;Spring Boot Example&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;If you are using &lt;strong&gt;Spring Boot&lt;/strong&gt;, the property to show exception messages in HTTP error responses is:&lt;/p&gt;
&lt;pre data-priority=&quot;2&quot;&gt;&lt;div class=&quot;b_crtrm_code_header&quot;&gt;&lt;h5 class=&quot;b_crtrm_code_title&quot;&gt;Properties&lt;/h5&gt;&lt;div class=&quot;b_crtrm_code_tooltips&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;code class=&quot;language-properties&quot;&gt;server.error.include-message=always
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Options:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;never&lt;/code&gt; (default) → Never include the exception message in the response.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;always&lt;/code&gt; → Always include it.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;on_param&lt;/code&gt; → Include it only if a specific request parameter is present.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can also control stack traces:&lt;/p&gt;
&lt;pre data-priority=&quot;2&quot;&gt;&lt;div class=&quot;b_crtrm_code_header&quot;&gt;&lt;h5 class=&quot;b_crtrm_code_title&quot;&gt;Properties&lt;/h5&gt;&lt;div class=&quot;b_crtrm_code_tooltips&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;code class=&quot;language-properties&quot;&gt;server.error.include-stacktrace=always
&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;h3&gt;&lt;strong&gt;Jakarta EE / Plain Java&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;In plain Java (without a framework), you control exception messages manually:&lt;/p&gt;
&lt;pre data-priority=&quot;2&quot;&gt;&lt;div class=&quot;b_crtrm_code_header&quot;&gt;&lt;h5 class=&quot;b_crtrm_code_title&quot;&gt;Java&lt;/h5&gt;&lt;div class=&quot;b_crtrm_code_tooltips&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;code class=&quot;language-java&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;try&lt;/span&gt; {
    &lt;span class=&quot;hljs-type&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;10&lt;/span&gt; / &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;;
} &lt;span class=&quot;hljs-keyword&quot;&gt;catch&lt;/span&gt; (ArithmeticException e) {
    System.out.println(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Error: &quot;&lt;/span&gt; + e.getMessage()); &lt;span class=&quot;hljs-comment&quot;&gt;// Shows the message&lt;/span&gt;
    e.printStackTrace(); &lt;span class=&quot;hljs-comment&quot;&gt;// Shows full stack trace&lt;/span&gt;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;p&gt;✅ &lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Plain Java&lt;/strong&gt; → No property; you must explicitly log or print exception messages.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Spring Boot&lt;/strong&gt; → Use &lt;code&gt;server.error.include-message&lt;/code&gt; in &lt;code&gt;application.properties&lt;/code&gt; or &lt;code&gt;application.yml&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other frameworks&lt;/strong&gt; → Similar config keys exist, but names differ.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;p&gt;If you want, I can give you a &lt;strong&gt;full Spring Boot example&lt;/strong&gt; that shows exception messages in API responses.&lt;br /&gt;
Do you want me to prepare that?&lt;/p&gt;</description><link>https://value2read.blogspot.com/2025/11/servererrorinclude-messagealways.html</link><author>noreply@blogger.com (Online Shopping)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-6948810748907822537</guid><pubDate>Tue, 11 Nov 2025 17:00:15 +0000</pubDate><atom:updated>2025-11-11T09:00:39.458-08:00</atom:updated><title>orElseThrow() in Java</title><description>&lt;p&gt;&lt;span style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;The&lt;/span&gt;&lt;span style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; color: #e6e8f0; font-size: 16px; padding: 0px 4px;&quot;&gt;orElseThrow()&lt;/code&gt;&lt;span style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;method in Java is a part of the&lt;/span&gt;&lt;span style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; color: #e6e8f0; font-size: 16px; padding: 0px 4px;&quot;&gt;java.util.Optional&lt;/code&gt;&lt;span style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;class, and its primary purpose is to retrieve the value contained within an&lt;/span&gt;&lt;span style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; color: #e6e8f0; font-size: 16px; padding: 0px 4px;&quot;&gt;Optional&lt;/code&gt;&lt;span style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;instance or, if no value is present, to throw an exception.&lt;/span&gt;&lt;span class=&quot;pjBG2e&quot; data-cid=&quot;ff278666-5e46-4a49-b426-3779a46bc896&quot; jsaction=&quot;rcuQ6b:npT2md&quot; jscontroller=&quot;JHnpme&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span class=&quot;UV3uM&quot; style=&quot;text-wrap-mode: nowrap;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;WaaZC&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;div class=&quot;rPeykc&quot; data-hveid=&quot;CDQQAQ&quot; data-ved=&quot;2ahUKEwjVzZ3mweqQAxWlWGwGHeFbMGYQo_EKegQINBAB&quot; style=&quot;margin: 0px 0px 10px;&quot;&gt;&lt;span data-huuid=&quot;2296131090686719753&quot;&gt;&lt;span class=&quot;pjBG2e&quot; data-cid=&quot;ff278666-5e46-4a49-b426-3779a46bc896&quot; jsaction=&quot;rcuQ6b:npT2md&quot; jscontroller=&quot;JHnpme&quot;&gt;&lt;span class=&quot;UV3uM&quot; style=&quot;text-wrap-mode: nowrap;&quot;&gt;&lt;div class=&quot;NPrrbc&quot; data-cid=&quot;ff278666-5e46-4a49-b426-3779a46bc896&quot; data-uuids=&quot;2296131090686719753&quot; style=&quot;display: inline-flex; margin-inline-end: 6px; vertical-align: middle;&quot;&gt;&lt;div aria-label=&quot;View related links&quot; class=&quot;BMebGe btku5b LwdV0e FR7ZSc OJeuxf&quot; data-hveid=&quot;CDYQAQ&quot; data-ved=&quot;2ahUKEwjVzZ3mweqQAxWlWGwGHeFbMGYQ3fYKegQINhAB&quot; jsaction=&quot;KjsqPd&quot; jsname=&quot;HtgYJd&quot; role=&quot;button&quot; style=&quot;-webkit-tap-highlight-color: transparent; color: #a8c7fa; cursor: pointer; display: inline-flex !important; outline: 0px; vertical-align: middle;&quot; tabindex=&quot;0&quot;&gt;&lt;div class=&quot;niO4u&quot; style=&quot;align-items: center; background-attachment: initial; background-clip: initial; background-color: rgb(44, 48, 61) !important; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 9999px; box-sizing: border-box; display: flex; height: 20px; justify-content: center; margin: 0px auto; min-height: 20px; outline-offset: -1px; outline: transparent solid 1px; padding: 0px; position: relative; width: 28px; z-index: 0;&quot;&gt;&lt;span class=&quot;d3o3Ad TwMgNb Hkv2Pe&quot; style=&quot;align-items: center; background: unset !important; color: rgb(232, 232, 232) !important; display: flex; flex-shrink: 0;&quot;&gt;&lt;span class=&quot;iPjmzb Sorfoc gNGSDf&quot; style=&quot;display: flex; height: unset; rotate: 135deg;&quot;&gt;&lt;span class=&quot;z1asCe Sb7k4e&quot; style=&quot;display: inline-block; fill: currentcolor; height: 18px; line-height: 18px; position: relative; width: 18px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; viewbox=&quot;0 0 24 24&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;WaaZC&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;div class=&quot;rPeykc uP58nb&quot; data-hveid=&quot;CDMQAQ&quot; data-ved=&quot;2ahUKEwjVzZ3mweqQAxWlWGwGHeFbMGYQo_EKegQIMxAB&quot; style=&quot;font-size: 20px; font-weight: 600; line-height: 28px; margin: 20px 0px 10px;&quot;&gt;&lt;span data-huuid=&quot;2296131090686719843&quot;&gt;There are two main variations of&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;orElseThrow()&lt;/code&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;WaaZC&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;ul data-hveid=&quot;CDgQAQ&quot; data-ved=&quot;2ahUKEwjVzZ3mweqQAxWlWGwGHeFbMGYQm_YKegQIOBAB&quot; jsaction=&quot;jZtoLb:SaHfyb&quot; jscontroller=&quot;M2ABbc&quot; style=&quot;line-height: 24px; margin: 10px 0px 20px; padding-inline-start: 16px; padding: 0px;&quot;&gt;&lt;li style=&quot;list-style: inherit; margin: 0px 0px 8px; padding-inline-start: 4px; padding: 0px;&quot;&gt;&lt;div class=&quot;zMgcWd dSKvsb&quot; data-il=&quot;&quot; style=&quot;border-bottom: none; padding-bottom: 0px; padding-top: 0px;&quot;&gt;&lt;div data-crb-p=&quot;&quot;&gt;&lt;div class=&quot;xFTqob&quot; style=&quot;flex: 1 1 0%; min-width: 0px;&quot;&gt;&lt;div class=&quot;Gur8Ad&quot; style=&quot;display: inline; line-height: 24px; overflow: hidden; padding-bottom: 4px; transition: transform 200ms cubic-bezier(0.2, 0, 0, 1);&quot;&gt;&lt;span data-huuid=&quot;2296131090686722026&quot;&gt;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;public T orElseThrow()&lt;/code&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;vM0jzc&quot; style=&quot;display: inline; line-height: 24px;&quot;&gt;&lt;ul data-hveid=&quot;CEIQAQ&quot; data-ved=&quot;2ahUKEwjVzZ3mweqQAxWlWGwGHeFbMGYQm_YKegQIQhAB&quot; jsaction=&quot;jZtoLb:SaHfyb&quot; jscontroller=&quot;M2ABbc&quot; style=&quot;line-height: 24px !important; margin-bottom: 20px; margin-left: 0px; margin-right: 0px; margin-top: 8px !important; padding-inline-start: 16px; padding: 0px;&quot;&gt;&lt;li style=&quot;list-style-image: inherit; list-style-position: inherit; list-style-type: disc; margin: 0px 0px 8px; padding-inline-start: 4px; padding: 0px;&quot;&gt;&lt;span data-huuid=&quot;2296131090686720113&quot;&gt;This version returns the value if it&#39;s present in the&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;Optional&lt;/code&gt;.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;list-style-image: inherit; list-style-position: inherit; list-style-type: disc; margin: 0px; padding-inline-start: 4px; padding: 0px;&quot;&gt;&lt;span data-huuid=&quot;2296131090686720203&quot;&gt;If the&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;Optional&lt;/code&gt;&amp;nbsp;is empty, it throws a&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;NoSuchElementException&lt;/code&gt;.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;list-style: inherit; margin: 0px; padding-inline-start: 4px; padding: 0px;&quot;&gt;&lt;div class=&quot;zMgcWd dSKvsb&quot; data-il=&quot;&quot; style=&quot;border-bottom: none; padding-bottom: 0px; padding-top: 8px;&quot;&gt;&lt;div data-crb-p=&quot;&quot;&gt;&lt;div class=&quot;xFTqob&quot; style=&quot;flex: 1 1 0%; min-width: 0px;&quot;&gt;&lt;div class=&quot;Gur8Ad&quot; style=&quot;display: inline; line-height: 24px; overflow: hidden; padding-bottom: 4px; transition: transform 200ms cubic-bezier(0.2, 0, 0, 1);&quot;&gt;&lt;span data-huuid=&quot;2296131090686720293&quot;&gt;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;public &amp;lt;X extends Throwable&amp;gt; T orElseThrow(Supplier&amp;lt;? extends X&amp;gt; exceptionSupplier) throws X&lt;/code&gt;:&lt;span class=&quot;pjBG2e&quot; data-cid=&quot;2554be04-51a2-43dd-8ae7-afd274908fdc&quot; jsaction=&quot;rcuQ6b:npT2md&quot; jscontroller=&quot;JHnpme&quot;&gt;&lt;span class=&quot;UV3uM&quot; style=&quot;text-wrap-mode: nowrap;&quot;&gt;&amp;nbsp;&lt;div class=&quot;NPrrbc&quot; data-cid=&quot;2554be04-51a2-43dd-8ae7-afd274908fdc&quot; data-uuids=&quot;2296131090686720293&quot; style=&quot;display: inline-flex; margin-inline-end: 6px; vertical-align: middle;&quot;&gt;&lt;div aria-label=&quot;View related links&quot; class=&quot;BMebGe btku5b LwdV0e FR7ZSc OJeuxf&quot; data-hveid=&quot;CD8QAQ&quot; data-ved=&quot;2ahUKEwjVzZ3mweqQAxWlWGwGHeFbMGYQ3fYKegQIPxAB&quot; jsaction=&quot;KjsqPd&quot; jsname=&quot;HtgYJd&quot; role=&quot;button&quot; style=&quot;-webkit-tap-highlight-color: transparent; color: #a8c7fa; cursor: pointer; display: inline-flex !important; outline: 0px; vertical-align: middle;&quot; tabindex=&quot;0&quot;&gt;&lt;div class=&quot;niO4u&quot; style=&quot;align-items: center; background-attachment: initial; background-clip: initial; background-color: rgb(44, 48, 61) !important; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 9999px; box-sizing: border-box; display: flex; height: 20px; justify-content: center; margin: 0px auto; min-height: 20px; outline-offset: -1px; outline: transparent solid 1px; padding: 0px; position: relative; width: 28px; z-index: 0;&quot;&gt;&lt;span class=&quot;d3o3Ad TwMgNb Hkv2Pe&quot; style=&quot;align-items: center; background: unset !important; color: rgb(232, 232, 232) !important; display: flex; flex-shrink: 0;&quot;&gt;&lt;span class=&quot;iPjmzb Sorfoc gNGSDf&quot; style=&quot;display: flex; height: unset; rotate: 135deg;&quot;&gt;&lt;span class=&quot;z1asCe Sb7k4e&quot; style=&quot;display: inline-block; fill: currentcolor; height: 18px; line-height: 18px; position: relative; width: 18px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; viewbox=&quot;0 0 24 24&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;vM0jzc&quot; style=&quot;display: inline; line-height: 24px;&quot;&gt;&lt;div class=&quot;bsmXxe&quot; id=&quot;v2MTaZXyGKWxseMP4bfBsQY__60&quot; role=&quot;none&quot; style=&quot;display: contents;&quot;&gt;&lt;ul data-hveid=&quot;CIcBEAE&quot; data-ved=&quot;2ahUKEwjVzZ3mweqQAxWlWGwGHeFbMGYQm_YKegUIhwEQAQ&quot; jsaction=&quot;jZtoLb:SaHfyb&quot; jscontroller=&quot;M2ABbc&quot; style=&quot;line-height: 24px !important; margin-bottom: 20px; margin-left: 0px; margin-right: 0px; margin-top: 8px !important; padding-inline-start: 16px; padding: 0px;&quot;&gt;&lt;div class=&quot;bsmXxe&quot; id=&quot;v2MTaZXyGKWxseMP4bfBsQY__61&quot; role=&quot;none&quot; style=&quot;display: contents;&quot;&gt;&lt;li style=&quot;list-style-image: inherit; list-style-position: inherit; list-style-type: disc; margin: 0px 0px 8px; padding-inline-start: 4px; padding: 0px;&quot;&gt;&lt;span data-huuid=&quot;2296131090686718380&quot;&gt;This version also returns the value if present.&lt;/span&gt;&lt;/li&gt;&lt;/div&gt;&lt;div class=&quot;bsmXxe&quot; id=&quot;v2MTaZXyGKWxseMP4bfBsQY__64&quot; role=&quot;none&quot; style=&quot;display: contents;&quot;&gt;&lt;li style=&quot;list-style-image: inherit; list-style-position: inherit; list-style-type: disc; margin: 0px; padding-inline-start: 4px; padding: 0px;&quot;&gt;&lt;span data-huuid=&quot;2296131090686718470&quot;&gt;If the&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;Optional&lt;/code&gt;&amp;nbsp;is empty, it uses the provided&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;exceptionSupplier&lt;/code&gt;&amp;nbsp;to create and throw a custom exception of type&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;X&lt;/code&gt;. This allows for more specific error handling than the default&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;NoSuchElementException&lt;/code&gt;.&lt;/span&gt;&lt;/li&gt;&lt;/div&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class=&quot;WaaZC&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;div class=&quot;bsmXxe&quot; id=&quot;v2MTaZXyGKWxseMP4bfBsQY__68&quot; role=&quot;none&quot; style=&quot;display: contents;&quot;&gt;&lt;div class=&quot;rPeykc pyPiTc&quot; data-hveid=&quot;CIkBEAE&quot; data-ved=&quot;2ahUKEwjVzZ3mweqQAxWlWGwGHeFbMGYQo_EKegUIiQEQAQ&quot; style=&quot;font-size: 20px; font-weight: 600; line-height: 28px; margin: 20px 0px 10px;&quot;&gt;&lt;span data-huuid=&quot;15556424112951608159&quot;&gt;How it works:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;WaaZC&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;div class=&quot;bsmXxe&quot; id=&quot;v2MTaZXyGKWxseMP4bfBsQY__65&quot; role=&quot;none&quot; style=&quot;display: contents;&quot;&gt;&lt;ul data-hveid=&quot;CIwBEAE&quot; data-ved=&quot;2ahUKEwjVzZ3mweqQAxWlWGwGHeFbMGYQm_YKegUIjAEQAQ&quot; jsaction=&quot;jZtoLb:SaHfyb&quot; jscontroller=&quot;M2ABbc&quot; style=&quot;line-height: 24px; margin: 10px 0px 20px; padding-inline-start: 16px; padding: 0px;&quot;&gt;&lt;div class=&quot;bsmXxe&quot; id=&quot;v2MTaZXyGKWxseMP4bfBsQY__69&quot; role=&quot;none&quot; style=&quot;display: contents;&quot;&gt;&lt;li style=&quot;list-style: inherit; margin: 0px 0px 8px; padding-inline-start: 4px; padding: 0px;&quot;&gt;&lt;div class=&quot;zMgcWd dSKvsb&quot; data-il=&quot;&quot; style=&quot;border-bottom: none; padding-bottom: 0px; padding-top: 0px;&quot;&gt;&lt;div data-crb-p=&quot;&quot;&gt;&lt;div class=&quot;xFTqob&quot; style=&quot;flex: 1 1 0%; min-width: 0px;&quot;&gt;&lt;div class=&quot;Gur8Ad&quot; style=&quot;display: inline; line-height: 24px; overflow: hidden; padding-bottom: 4px; transition: transform 200ms cubic-bezier(0.2, 0, 0, 1);&quot;&gt;&lt;span data-huuid=&quot;15556424112951607466&quot;&gt;&lt;strong&gt;Value Present:&lt;/strong&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;vM0jzc&quot; style=&quot;display: inline; line-height: 24px;&quot;&gt;&lt;span data-huuid=&quot;15556424112951611331&quot;&gt;If the&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;Optional&lt;/code&gt;&amp;nbsp;object contains a non-null value,&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;orElseThrow()&lt;/code&gt;&amp;nbsp;simply returns that value.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;/div&gt;&lt;div class=&quot;bsmXxe&quot; id=&quot;v2MTaZXyGKWxseMP4bfBsQY__76&quot; role=&quot;none&quot; style=&quot;display: contents;&quot;&gt;&lt;li style=&quot;list-style: inherit; margin: 0px; padding-inline-start: 4px; padding: 0px;&quot;&gt;&lt;div class=&quot;zMgcWd dSKvsb&quot; data-il=&quot;&quot; style=&quot;border-bottom: none; padding-bottom: 0px; padding-top: 0px;&quot;&gt;&lt;div data-crb-p=&quot;&quot;&gt;&lt;div class=&quot;xFTqob&quot; style=&quot;flex: 1 1 0%; min-width: 0px;&quot;&gt;&lt;div class=&quot;Gur8Ad&quot; style=&quot;display: inline; line-height: 24px; overflow: hidden; padding-bottom: 4px; transition: transform 200ms cubic-bezier(0.2, 0, 0, 1);&quot;&gt;&lt;span data-huuid=&quot;15556424112951610869&quot;&gt;&lt;strong&gt;Value Not Present:&lt;/strong&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;vM0jzc&quot; style=&quot;display: inline; line-height: 24px;&quot;&gt;&lt;span data-huuid=&quot;15556424112951610638&quot;&gt;If the&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;Optional&lt;/code&gt;&amp;nbsp;object is empty (i.e., it doesn&#39;t contain a value),&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;orElseThrow()&lt;/code&gt;&amp;nbsp;will either throw a&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;NoSuchElementException&lt;/code&gt;&amp;nbsp;(in the no-argument version) or throw the exception generated by the&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;exceptionSupplier&lt;/code&gt;&amp;nbsp;(in the version with a&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;Supplier&lt;/code&gt;&amp;nbsp;argument).&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;/div&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;WaaZC&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;div class=&quot;bsmXxe&quot; id=&quot;v2MTaZXyGKWxseMP4bfBsQY__73&quot; role=&quot;none&quot; style=&quot;display: contents;&quot;&gt;&lt;div class=&quot;rPeykc pyPiTc&quot; data-hveid=&quot;CIsBEAE&quot; data-ved=&quot;2ahUKEwjVzZ3mweqQAxWlWGwGHeFbMGYQo_EKegUIiwEQAQ&quot; style=&quot;font-size: 20px; font-weight: 600; line-height: 28px; margin: 20px 0px 10px;&quot;&gt;&lt;span data-huuid=&quot;2296131090686719460&quot;&gt;Example:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;WaaZC&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;div class=&quot;bsmXxe&quot; id=&quot;v2MTaZXyGKWxseMP4bfBsQY__80&quot; role=&quot;none&quot; style=&quot;display: contents;&quot;&gt;&lt;div jsaction=&quot;rcuQ6b:npT2md&quot; jscontroller=&quot;JegcYe&quot;&gt;&lt;div class=&quot;ecCNFc&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgba(36, 40, 50, 0.5); border-color: rgb(66, 70, 84); border-image: none 100% / 1 / 0 stretch; border-radius: 8px; border-style: solid; border-width: 0.8px; font-size: 14px; margin-bottom: 20px;&quot;&gt;&lt;div class=&quot;zYSUYd&quot; style=&quot;border-radius: 8px 8px 0px 0px; display: flex; flex-direction: row; overflow: hidden;&quot;&gt;&lt;div class=&quot;FS7GEb&quot; style=&quot;display: flex; flex-direction: column; flex-grow: 1; min-width: 38%; width: 630.4px;&quot;&gt;&lt;div class=&quot;dDrxod&quot; style=&quot;align-items: center; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-bottom: 0.8px solid rgb(66, 70, 84); display: flex; height: 34px; justify-content: space-between;&quot;&gt;&lt;div class=&quot;x7ndcb&quot; style=&quot;align-items: center; display: flex; padding-left: 16px;&quot;&gt;Java&lt;/div&gt;&lt;div aria-live=&quot;polite&quot; class=&quot;WDoJJe&quot; style=&quot;align-items: center; display: flex; margin-right: 4px;&quot;&gt;&lt;button aria-label=&quot;Copy code to clipboard&quot; class=&quot;hqI3tf B4zsNc&quot; data-ved=&quot;2ahUKEwjVzZ3mweqQAxWlWGwGHeFbMGYQ9MILegUIigEQAQ&quot; jsaction=&quot;VTVhdd&quot; jsname=&quot;jCCvxc&quot; role=&quot;button&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: none; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: initial; border-style: none; border-width: initial; color: #a8c7fa; height: 34px; margin: 0px 2px; outline: 0px; position: relative; top: 2px;&quot; tabindex=&quot;0&quot; title=&quot;Copy&quot;&gt;&lt;span class=&quot;z1asCe wm4nBd&quot; style=&quot;display: inline-block; fill: currentcolor; height: 20px; line-height: 20px; position: relative; width: 20px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; enable-background=&quot;new 0 0 24 24&quot; focusable=&quot;false&quot; height=&quot;24&quot; viewbox=&quot;0 0 24 24&quot; width=&quot;24&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;g&gt;&lt;rect fill=&quot;none&quot; height=&quot;24&quot; width=&quot;24&quot;&gt;&lt;/rect&gt;&lt;/g&gt;&lt;g&gt;&lt;path d=&quot;M16,20H5V6H3v14c0,1.1,0.9,2,2,2h11V20z M20,16V4c0-1.1-0.9-2-2-2H9C7.9,2,7,2.9,7,4v12c0,1.1,0.9,2,2,2h9 C19.1,18,20,17.1,20,16z M18,16H9V4h9V16z&quot;&gt;&lt;/path&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;QQjpRc&quot; style=&quot;background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border-radius: 0px 0px 8px 8px; display: flex; flex-direction: row; overflow: hidden;&quot;&gt;&lt;div class=&quot;FS7GEb&quot; jsname=&quot;zEXxAd&quot; style=&quot;display: flex; flex-direction: column; flex-grow: 1; min-width: 38%; width: 630.4px;&quot;&gt;&lt;pre jsaction=&quot;copy:A7D85c&quot; style=&quot;display: inline-grid; margin: 0px;&quot;&gt;&lt;code data-ved=&quot;2ahUKEwjVzZ3mweqQAxWlWGwGHeFbMGYQjZIMegUIigEQAg&quot; jsname=&quot;feLNVc&quot; style=&quot;background: transparent; display: block; line-height: 22px; overflow-x: auto; padding: 16px 16px 22px;&quot;&gt;&lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;import&lt;/span&gt; java.util.Optional;&lt;br aria-hidden=&quot;true&quot; /&gt;&lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;import&lt;/span&gt; java.util.NoSuchElementException;&lt;br aria-hidden=&quot;true&quot; /&gt;&lt;br aria-hidden=&quot;true&quot; /&gt;&lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;OptionalOrElseThrowExample&lt;/span&gt; {&lt;br aria-hidden=&quot;true&quot; /&gt;    &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;mFP83e&quot; style=&quot;color: #fa903e;&quot;&gt;main&lt;/span&gt;(&lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;String&lt;/span&gt;[] &lt;span class=&quot;mFP83e&quot; style=&quot;color: #fa903e;&quot;&gt;args&lt;/span&gt;) {&lt;br aria-hidden=&quot;true&quot; /&gt;        &lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;Optional&lt;/span&gt;&amp;lt;&lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;String&lt;/span&gt;&amp;gt; &lt;span class=&quot;mFP83e&quot; style=&quot;color: #fa903e;&quot;&gt;presentOptional&lt;/span&gt; = Optional.of(&lt;span class=&quot;rQeGvc&quot; style=&quot;color: #81c995;&quot;&gt;&quot;Hello&quot;&lt;/span&gt;);&lt;br aria-hidden=&quot;true&quot; /&gt;        &lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;Optional&lt;/span&gt;&amp;lt;&lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;String&lt;/span&gt;&amp;gt; &lt;span class=&quot;mFP83e&quot; style=&quot;color: #fa903e;&quot;&gt;emptyOptional&lt;/span&gt; = Optional.empty();&lt;br aria-hidden=&quot;true&quot; /&gt;&lt;br aria-hidden=&quot;true&quot; /&gt;        &lt;span class=&quot;a7yfkb&quot; style=&quot;color: #9aa0a6; font-style: italic;&quot;&gt;// Using orElseThrow() with a present value&lt;/span&gt;&lt;br aria-hidden=&quot;true&quot; /&gt;        &lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;mFP83e&quot; style=&quot;color: #fa903e;&quot;&gt;value1&lt;/span&gt; = &lt;span class=&quot;VQ2nqe&quot; style=&quot;color: #f28b82;&quot;&gt;presentOptional&lt;/span&gt;.orElseThrow();&lt;br aria-hidden=&quot;true&quot; /&gt;        System.out.println(&lt;span class=&quot;rQeGvc&quot; style=&quot;color: #81c995;&quot;&gt;&quot;Value from present Optional: &quot;&lt;/span&gt; + &lt;span class=&quot;VQ2nqe&quot; style=&quot;color: #f28b82;&quot;&gt;value1&lt;/span&gt;);&lt;br aria-hidden=&quot;true&quot; /&gt;&lt;br aria-hidden=&quot;true&quot; /&gt;        &lt;span class=&quot;a7yfkb&quot; style=&quot;color: #9aa0a6; font-style: italic;&quot;&gt;// Using orElseThrow() with a custom exception supplier&lt;/span&gt;&lt;br aria-hidden=&quot;true&quot; /&gt;        &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;try&lt;/span&gt; {&lt;br aria-hidden=&quot;true&quot; /&gt;            &lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;mFP83e&quot; style=&quot;color: #fa903e;&quot;&gt;value2&lt;/span&gt; = &lt;span class=&quot;VQ2nqe&quot; style=&quot;color: #f28b82;&quot;&gt;emptyOptional&lt;/span&gt;.orElseThrow(() -&amp;gt; &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;IllegalArgumentException&lt;/span&gt;(&lt;span class=&quot;rQeGvc&quot; style=&quot;color: #81c995;&quot;&gt;&quot;No value found in optional!&quot;&lt;/span&gt;));&lt;br aria-hidden=&quot;true&quot; /&gt;            System.out.println(&lt;span class=&quot;rQeGvc&quot; style=&quot;color: #81c995;&quot;&gt;&quot;This won&#39;t be printed.&quot;&lt;/span&gt;);&lt;br aria-hidden=&quot;true&quot; /&gt;        } &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;IllegalArgumentException&lt;/span&gt; &lt;span class=&quot;mFP83e&quot; style=&quot;color: #fa903e;&quot;&gt;e&lt;/span&gt;) {&lt;br aria-hidden=&quot;true&quot; /&gt;            System.out.println(&lt;span class=&quot;rQeGvc&quot; style=&quot;color: #81c995;&quot;&gt;&quot;Caught custom exception: &quot;&lt;/span&gt; + &lt;span class=&quot;VQ2nqe&quot; style=&quot;color: #f28b82;&quot;&gt;e&lt;/span&gt;.getMessage());&lt;br aria-hidden=&quot;true&quot; /&gt;        }&lt;br aria-hidden=&quot;true&quot; /&gt;&lt;br aria-hidden=&quot;true&quot; /&gt;        &lt;span class=&quot;a7yfkb&quot; style=&quot;color: #9aa0a6; font-style: italic;&quot;&gt;// Using orElseThrow() on an empty Optional (throws NoSuchElementException)&lt;/span&gt;&lt;br aria-hidden=&quot;true&quot; /&gt;        &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;try&lt;/span&gt; {&lt;br aria-hidden=&quot;true&quot; /&gt;            &lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;mFP83e&quot; style=&quot;color: #fa903e;&quot;&gt;value3&lt;/span&gt; = &lt;span class=&quot;VQ2nqe&quot; style=&quot;color: #f28b82;&quot;&gt;emptyOptional&lt;/span&gt;.orElseThrow();&lt;br aria-hidden=&quot;true&quot; /&gt;            System.out.println(&lt;span class=&quot;rQeGvc&quot; style=&quot;color: #81c995;&quot;&gt;&quot;This also won&#39;t be printed.&quot;&lt;/span&gt;);&lt;br aria-hidden=&quot;true&quot; /&gt;        } &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;NoSuchElementException&lt;/span&gt; &lt;span class=&quot;mFP83e&quot; style=&quot;color: #fa903e;&quot;&gt;e&lt;/span&gt;) {&lt;br aria-hidden=&quot;true&quot; /&gt;            System.out.println(&lt;span class=&quot;rQeGvc&quot; style=&quot;color: #81c995;&quot;&gt;&quot;Caught default exception: &quot;&lt;/span&gt; + &lt;span class=&quot;VQ2nqe&quot; style=&quot;color: #f28b82;&quot;&gt;e&lt;/span&gt;.getMessage());&lt;br aria-hidden=&quot;true&quot; /&gt;        }&lt;br aria-hidden=&quot;true&quot; /&gt;    }&lt;br aria-hidden=&quot;true&quot; /&gt;}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description><link>https://value2read.blogspot.com/2025/11/orelsethrow-in-java.html</link><author>noreply@blogger.com (Online Shopping)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-9044332590535050178</guid><pubDate>Tue, 11 Nov 2025 16:35:17 +0000</pubDate><atom:updated>2025-11-11T08:35:34.794-08:00</atom:updated><title>How to Use Optional with findBy Methods:</title><description>&lt;p&gt;&lt;span data-huuid=&quot;7390170289816073624&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;Spring Data MongoDB repositories support the use of&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;java.util.Optional&lt;/code&gt;&amp;nbsp;as a return type for&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;findBy&lt;/code&gt;&amp;nbsp;methods.&amp;nbsp;&lt;/span&gt;&lt;span data-huuid=&quot;7390170289816076261&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;This provides a robust way to handle cases where a matching document might not be found, preventing&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;NullPointerExceptions&lt;/code&gt;&amp;nbsp;and promoting clearer code.&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;WaaZC&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;div class=&quot;RJPOee EIJn2&quot; style=&quot;animation: auto ease 0s 1 normal none running none !important;&quot;&gt;&lt;div class=&quot;rPeykc pyPiTc&quot; data-hveid=&quot;CAQQAQ&quot; data-ved=&quot;2ahUKEwiBnuCKw-qQAxUxRmwGHXdOEn0Qo_EKegQIBBAB&quot; style=&quot;font-size: 20px; font-weight: 600; line-height: 28px; margin: 20px 0px 10px;&quot;&gt;&lt;span data-huuid=&quot;7390170289816073343&quot;&gt;How to Use&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;Optional&lt;/code&gt;&amp;nbsp;with&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;findBy&lt;/code&gt;&amp;nbsp;Methods:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;WaaZC&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;div class=&quot;RJPOee EIJn2&quot; style=&quot;animation: auto ease 0s 1 normal none running none !important;&quot;&gt;&lt;ul data-hveid=&quot;CAcQAQ&quot; data-ved=&quot;2ahUKEwiBnuCKw-qQAxUxRmwGHXdOEn0Qm_YKegQIBxAB&quot; jsaction=&quot;jZtoLb:SaHfyb&quot; jscontroller=&quot;M2ABbc&quot; style=&quot;line-height: 24px; margin: 10px 0px 20px; padding-inline-start: 16px; padding: 0px;&quot;&gt;&lt;li style=&quot;list-style: inherit; margin: 0px; padding-inline-start: 4px; padding: 0px;&quot;&gt;&lt;span data-huuid=&quot;7390170289816073062&quot;&gt;&lt;strong&gt;Define the Repository Method:&lt;/strong&gt;&amp;nbsp;&lt;/span&gt;&lt;span data-huuid=&quot;7390170289816075699&quot;&gt;Declare your&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;findBy&lt;/code&gt;&amp;nbsp;method in your Spring Data MongoDB repository interface with&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;Optional&amp;lt;YourEntityType&amp;gt;&lt;/code&gt;&amp;nbsp;as the return type.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;WaaZC&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;div class=&quot;RJPOee EIJn2&quot; style=&quot;animation: auto ease 0s 1 normal none running none !important;&quot;&gt;&lt;div jsaction=&quot;rcuQ6b:npT2md&quot; jscontroller=&quot;JegcYe&quot;&gt;&lt;div class=&quot;ecCNFc&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgba(36, 40, 50, 0.5); border-color: rgb(66, 70, 84); border-image: none 100% / 1 / 0 stretch; border-radius: 8px; border-style: solid; border-width: 0.8px; font-size: 14px; margin-bottom: 20px;&quot;&gt;&lt;div class=&quot;zYSUYd&quot; style=&quot;border-radius: 8px 8px 0px 0px; display: flex; flex-direction: row; overflow: hidden;&quot;&gt;&lt;div class=&quot;FS7GEb&quot; style=&quot;display: flex; flex-direction: column; flex-grow: 1; min-width: 38%; width: 630.4px;&quot;&gt;&lt;div class=&quot;dDrxod&quot; style=&quot;align-items: center; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-bottom: 0.8px solid rgb(66, 70, 84); display: flex; height: 34px; justify-content: space-between;&quot;&gt;&lt;div class=&quot;x7ndcb&quot; style=&quot;align-items: center; display: flex; padding-left: 16px;&quot;&gt;Java&lt;/div&gt;&lt;div aria-live=&quot;polite&quot; class=&quot;WDoJJe&quot; style=&quot;align-items: center; display: flex; margin-right: 4px;&quot;&gt;&lt;button aria-label=&quot;Copy code to clipboard&quot; class=&quot;hqI3tf B4zsNc&quot; data-ved=&quot;2ahUKEwiBnuCKw-qQAxUxRmwGHXdOEn0Q9MILegQIDxAB&quot; jsaction=&quot;VTVhdd&quot; jsname=&quot;jCCvxc&quot; role=&quot;button&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: none; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: initial; border-style: none; border-width: initial; color: #a8c7fa; height: 34px; margin: 0px 2px; outline: 0px; position: relative; top: 2px;&quot; tabindex=&quot;0&quot; title=&quot;Copy&quot;&gt;&lt;span class=&quot;z1asCe wm4nBd&quot; style=&quot;display: inline-block; fill: currentcolor; height: 20px; line-height: 20px; position: relative; width: 20px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; enable-background=&quot;new 0 0 24 24&quot; focusable=&quot;false&quot; height=&quot;24&quot; viewbox=&quot;0 0 24 24&quot; width=&quot;24&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;g&gt;&lt;rect fill=&quot;none&quot; height=&quot;24&quot; width=&quot;24&quot;&gt;&lt;/rect&gt;&lt;/g&gt;&lt;g&gt;&lt;path d=&quot;M16,20H5V6H3v14c0,1.1,0.9,2,2,2h11V20z M20,16V4c0-1.1-0.9-2-2-2H9C7.9,2,7,2.9,7,4v12c0,1.1,0.9,2,2,2h9 C19.1,18,20,17.1,20,16z M18,16H9V4h9V16z&quot;&gt;&lt;/path&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;QQjpRc&quot; style=&quot;background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border-radius: 0px 0px 8px 8px; display: flex; flex-direction: row; overflow: hidden;&quot;&gt;&lt;div class=&quot;FS7GEb&quot; jsname=&quot;zEXxAd&quot; style=&quot;display: flex; flex-direction: column; flex-grow: 1; min-width: 38%; width: 630.4px;&quot;&gt;&lt;pre jsaction=&quot;copy:A7D85c&quot; style=&quot;display: inline-grid; margin: 0px;&quot;&gt;&lt;code data-ved=&quot;2ahUKEwiBnuCKw-qQAxUxRmwGHXdOEn0QjZIMegQIDxAC&quot; jsname=&quot;feLNVc&quot; style=&quot;background: transparent; display: block; line-height: 22px; overflow-x: auto; padding: 16px 16px 22px;&quot;&gt;    &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;import&lt;/span&gt; java.util.Optional;&lt;br aria-hidden=&quot;true&quot; /&gt;    &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;import&lt;/span&gt; org.springframework.data.mongodb.repository.MongoRepository;&lt;br aria-hidden=&quot;true&quot; /&gt;    &lt;br aria-hidden=&quot;true&quot; /&gt;    &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;UserRepository&lt;/span&gt; &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;MongoRepository&lt;/span&gt;&amp;lt;&lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;User&lt;/span&gt;, &lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;String&lt;/span&gt;&amp;gt; {&lt;br aria-hidden=&quot;true&quot; /&gt;        &lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;Optional&lt;/span&gt;&amp;lt;&lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;User&lt;/span&gt;&amp;gt; &lt;span class=&quot;mFP83e&quot; style=&quot;color: #fa903e;&quot;&gt;findByEmail&lt;/span&gt;(&lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;mFP83e&quot; style=&quot;color: #fa903e;&quot;&gt;email&lt;/span&gt;);&lt;br aria-hidden=&quot;true&quot; /&gt;        &lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;Optional&lt;/span&gt;&amp;lt;&lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;User&lt;/span&gt;&amp;gt; &lt;span class=&quot;mFP83e&quot; style=&quot;color: #fa903e;&quot;&gt;findById&lt;/span&gt;(&lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;mFP83e&quot; style=&quot;color: #fa903e;&quot;&gt;id&lt;/span&gt;); &lt;span class=&quot;a7yfkb&quot; style=&quot;color: #9aa0a6; font-style: italic;&quot;&gt;// findById already returns Optional by default&lt;/span&gt;&lt;br aria-hidden=&quot;true&quot; /&gt;    }&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;WaaZC&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;div class=&quot;RJPOee EIJn2&quot; style=&quot;animation: auto ease 0s 1 normal none running none !important;&quot;&gt;&lt;ul data-hveid=&quot;CBEQAQ&quot; data-ved=&quot;2ahUKEwiBnuCKw-qQAxUxRmwGHXdOEn0Qm_YKegQIERAB&quot; jsaction=&quot;jZtoLb:SaHfyb&quot; jscontroller=&quot;M2ABbc&quot; style=&quot;line-height: 24px; margin: 10px 0px 20px; padding-inline-start: 16px; padding: 0px;&quot;&gt;&lt;li style=&quot;list-style: inherit; margin: 0px; padding-inline-start: 4px; padding: 0px;&quot;&gt;&lt;span data-huuid=&quot;11664634180169774477&quot;&gt;Consume the&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;Optional&lt;/code&gt;&amp;nbsp;Result:&amp;nbsp;&lt;/span&gt;&lt;span data-huuid=&quot;11664634180169773560&quot;&gt;When calling these methods, you will receive an&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;Optional&lt;/code&gt;&amp;nbsp;object.&amp;nbsp;&lt;/span&gt;&lt;span data-huuid=&quot;11664634180169776739&quot;&gt;You can then use the various methods provided by&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;Optional&lt;/code&gt;&amp;nbsp;to handle the presence or absence of a user.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;WaaZC&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;div class=&quot;RJPOee EIJn2&quot; style=&quot;animation: auto ease 0s 1 normal none running none !important;&quot;&gt;&lt;div jsaction=&quot;rcuQ6b:npT2md&quot; jscontroller=&quot;JegcYe&quot;&gt;&lt;div class=&quot;ecCNFc&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgba(36, 40, 50, 0.5); border-color: rgb(66, 70, 84); border-image: none 100% / 1 / 0 stretch; border-radius: 8px; border-style: solid; border-width: 0.8px; font-size: 14px; margin-bottom: 20px;&quot;&gt;&lt;div class=&quot;zYSUYd&quot; style=&quot;border-radius: 8px 8px 0px 0px; display: flex; flex-direction: row; overflow: hidden;&quot;&gt;&lt;div class=&quot;FS7GEb&quot; style=&quot;display: flex; flex-direction: column; flex-grow: 1; min-width: 38%; width: 630.4px;&quot;&gt;&lt;div class=&quot;dDrxod&quot; style=&quot;align-items: center; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-bottom: 0.8px solid rgb(66, 70, 84); display: flex; height: 34px; justify-content: space-between;&quot;&gt;&lt;div class=&quot;x7ndcb&quot; style=&quot;align-items: center; display: flex; padding-left: 16px;&quot;&gt;Java&lt;/div&gt;&lt;div aria-live=&quot;polite&quot; class=&quot;WDoJJe&quot; style=&quot;align-items: center; display: flex; margin-right: 4px;&quot;&gt;&lt;button aria-label=&quot;Copy code to clipboard&quot; class=&quot;hqI3tf B4zsNc&quot; data-ved=&quot;2ahUKEwiBnuCKw-qQAxUxRmwGHXdOEn0Q9MILegQIFxAB&quot; jsaction=&quot;VTVhdd&quot; jsname=&quot;jCCvxc&quot; role=&quot;button&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: none; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: initial; border-style: none; border-width: initial; color: #a8c7fa; height: 34px; margin: 0px 2px; outline: 0px; position: relative; top: 2px;&quot; tabindex=&quot;0&quot; title=&quot;Copy&quot;&gt;&lt;span class=&quot;z1asCe wm4nBd&quot; style=&quot;display: inline-block; fill: currentcolor; height: 20px; line-height: 20px; position: relative; width: 20px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; enable-background=&quot;new 0 0 24 24&quot; focusable=&quot;false&quot; height=&quot;24&quot; viewbox=&quot;0 0 24 24&quot; width=&quot;24&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;g&gt;&lt;rect fill=&quot;none&quot; height=&quot;24&quot; width=&quot;24&quot;&gt;&lt;/rect&gt;&lt;/g&gt;&lt;g&gt;&lt;path d=&quot;M16,20H5V6H3v14c0,1.1,0.9,2,2,2h11V20z M20,16V4c0-1.1-0.9-2-2-2H9C7.9,2,7,2.9,7,4v12c0,1.1,0.9,2,2,2h9 C19.1,18,20,17.1,20,16z M18,16H9V4h9V16z&quot;&gt;&lt;/path&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;QQjpRc&quot; style=&quot;background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border-radius: 0px 0px 8px 8px; display: flex; flex-direction: row; overflow: hidden;&quot;&gt;&lt;div class=&quot;FS7GEb&quot; jsname=&quot;zEXxAd&quot; style=&quot;display: flex; flex-direction: column; flex-grow: 1; min-width: 38%; width: 630.4px;&quot;&gt;&lt;pre jsaction=&quot;copy:A7D85c&quot; style=&quot;display: inline-grid; margin: 0px;&quot;&gt;&lt;code data-ved=&quot;2ahUKEwiBnuCKw-qQAxUxRmwGHXdOEn0QjZIMegQIFxAC&quot; jsname=&quot;feLNVc&quot; style=&quot;background: transparent; display: block; line-height: 22px; overflow-x: auto; padding: 16px 16px 22px;&quot;&gt;    &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;import&lt;/span&gt; java.util.Optional;&lt;br aria-hidden=&quot;true&quot; /&gt;    &lt;br aria-hidden=&quot;true&quot; /&gt;    &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;UserService&lt;/span&gt; {&lt;br aria-hidden=&quot;true&quot; /&gt;        &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;UserRepository&lt;/span&gt; &lt;span class=&quot;mFP83e&quot; style=&quot;color: #fa903e;&quot;&gt;userRepository&lt;/span&gt;;&lt;br aria-hidden=&quot;true&quot; /&gt;    &lt;br aria-hidden=&quot;true&quot; /&gt;        &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;mFP83e&quot; style=&quot;color: #fa903e;&quot;&gt;UserService&lt;/span&gt;(&lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;UserRepository&lt;/span&gt; &lt;span class=&quot;mFP83e&quot; style=&quot;color: #fa903e;&quot;&gt;userRepository&lt;/span&gt;) {&lt;br aria-hidden=&quot;true&quot; /&gt;            &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;this&lt;/span&gt;.userRepository = &lt;span class=&quot;VQ2nqe&quot; style=&quot;color: #f28b82;&quot;&gt;userRepository&lt;/span&gt;;&lt;br aria-hidden=&quot;true&quot; /&gt;        }&lt;br aria-hidden=&quot;true&quot; /&gt;    &lt;br aria-hidden=&quot;true&quot; /&gt;        &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;User&lt;/span&gt; &lt;span class=&quot;mFP83e&quot; style=&quot;color: #fa903e;&quot;&gt;getUserByEmail&lt;/span&gt;(&lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;mFP83e&quot; style=&quot;color: #fa903e;&quot;&gt;email&lt;/span&gt;) {&lt;br aria-hidden=&quot;true&quot; /&gt;            &lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;Optional&lt;/span&gt;&amp;lt;&lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;User&lt;/span&gt;&amp;gt; &lt;span class=&quot;mFP83e&quot; style=&quot;color: #fa903e;&quot;&gt;userOptional&lt;/span&gt; = userRepository.findByEmail(&lt;span class=&quot;VQ2nqe&quot; style=&quot;color: #f28b82;&quot;&gt;email&lt;/span&gt;);&lt;br aria-hidden=&quot;true&quot; /&gt;    &lt;br aria-hidden=&quot;true&quot; /&gt;            &lt;span class=&quot;a7yfkb&quot; style=&quot;color: #9aa0a6; font-style: italic;&quot;&gt;// Option 1: Check for presence and act accordingly&lt;/span&gt;&lt;br aria-hidden=&quot;true&quot; /&gt;            &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;VQ2nqe&quot; style=&quot;color: #f28b82;&quot;&gt;userOptional&lt;/span&gt;.isPresent()) {&lt;br aria-hidden=&quot;true&quot; /&gt;                &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;VQ2nqe&quot; style=&quot;color: #f28b82;&quot;&gt;userOptional&lt;/span&gt;.get(); &lt;span class=&quot;a7yfkb&quot; style=&quot;color: #9aa0a6; font-style: italic;&quot;&gt;// Get the User object&lt;/span&gt;&lt;br aria-hidden=&quot;true&quot; /&gt;            } &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;else&lt;/span&gt; {&lt;br aria-hidden=&quot;true&quot; /&gt;                &lt;span class=&quot;a7yfkb&quot; style=&quot;color: #9aa0a6; font-style: italic;&quot;&gt;// Handle case where user is not found&lt;/span&gt;&lt;br aria-hidden=&quot;true&quot; /&gt;                &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;VSzkzc&quot; style=&quot;color: #c58af9;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;aPB6vc&quot; style=&quot;color: #c58af9;&quot;&gt;UserNotFoundException&lt;/span&gt;(&lt;span class=&quot;rQeGvc&quot; style=&quot;color: #81c995;&quot;&gt;&quot;User with email &quot;&lt;/span&gt; + &lt;span class=&quot;VQ2nqe&quot; style=&quot;color: #f28b82;&quot;&gt;email&lt;/span&gt; + &lt;span class=&quot;rQeGvc&quot; style=&quot;color: #81c995;&quot;&gt;&quot; not found.&quot;&lt;/span&gt;);&lt;br aria-hidden=&quot;true&quot; /&gt;            }&lt;br aria-hidden=&quot;true&quot; /&gt;    &lt;br aria-hidden=&quot;true&quot; /&gt;            &lt;span class=&quot;a7yfkb&quot; style=&quot;color: #9aa0a6; font-style: italic;&quot;&gt;// Option 2: Use orElse() to provide a default value&lt;/span&gt;&lt;br aria-hidden=&quot;true&quot; /&gt;            &lt;span class=&quot;a7yfkb&quot; style=&quot;color: #9aa0a6; font-style: italic;&quot;&gt;// return userOptional.orElse(new User(&quot;default@example.com&quot;)); &lt;/span&gt;&lt;br aria-hidden=&quot;true&quot; /&gt;    &lt;br aria-hidden=&quot;true&quot; /&gt;            &lt;span class=&quot;a7yfkb&quot; style=&quot;color: #9aa0a6; font-style: italic;&quot;&gt;// Option 3: Use orElseThrow() to throw a specific exception if not present&lt;/span&gt;&lt;br aria-hidden=&quot;true&quot; /&gt;            &lt;span class=&quot;a7yfkb&quot; style=&quot;color: #9aa0a6; font-style: italic;&quot;&gt;// return userOptional.orElseThrow(() -&amp;gt; new UserNotFoundException(&quot;User with email &quot; + email + &quot; not found.&quot;));&lt;/span&gt;&lt;br aria-hidden=&quot;true&quot; /&gt;        }&lt;br aria-hidden=&quot;true&quot; /&gt;    }&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;WaaZC&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;div class=&quot;RJPOee EIJn2&quot; style=&quot;animation: auto ease 0s 1 normal none running none !important;&quot;&gt;&lt;div class=&quot;rPeykc pyPiTc&quot; data-hveid=&quot;CBkQAQ&quot; data-ved=&quot;2ahUKEwiBnuCKw-qQAxUxRmwGHXdOEn0Qo_EKegQIGRAB&quot; style=&quot;font-size: 20px; font-weight: 600; line-height: 28px; margin: 20px 0px 10px;&quot;&gt;&lt;span data-huuid=&quot;12047285069845960640&quot;&gt;Benefits of Using&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;Optional&lt;/code&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;WaaZC&quot; style=&quot;background-color: #1f1f1f; color: #e6e8f0; font-family: &amp;quot;Google Sans&amp;quot;, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;div class=&quot;RJPOee EIJn2&quot; style=&quot;animation: auto ease 0s 1 normal none running none !important;&quot;&gt;&lt;ul data-hveid=&quot;CCQQAQ&quot; data-ved=&quot;2ahUKEwiBnuCKw-qQAxUxRmwGHXdOEn0Qm_YKegQIJBAB&quot; jsaction=&quot;jZtoLb:SaHfyb&quot; jscontroller=&quot;M2ABbc&quot; style=&quot;line-height: 24px; margin: 10px 0px 20px; padding-inline-start: 16px; padding: 0px;&quot;&gt;&lt;li style=&quot;list-style: inherit; margin: 0px 0px 8px; padding-inline-start: 4px; padding: 0px;&quot;&gt;&lt;div class=&quot;zMgcWd dSKvsb&quot; data-il=&quot;&quot; style=&quot;border-bottom: none; padding-bottom: 0px; padding-top: 0px;&quot;&gt;&lt;div data-crb-p=&quot;&quot;&gt;&lt;div class=&quot;xFTqob&quot; style=&quot;flex: 1 1 0%; min-width: 0px;&quot;&gt;&lt;div class=&quot;Gur8Ad&quot; style=&quot;display: inline; line-height: 24px; overflow: hidden; padding-bottom: 4px; transition: transform 200ms cubic-bezier(0.2, 0, 0, 1);&quot;&gt;&lt;span data-huuid=&quot;12047285069845961129&quot;&gt;&lt;strong&gt;Explicit Null Handling:&lt;/strong&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;vM0jzc&quot; style=&quot;display: inline; line-height: 24px;&quot;&gt;&lt;span data-huuid=&quot;12047285069845961292&quot;&gt;Forces you to explicitly consider the possibility of a null result, reducing the likelihood of&amp;nbsp;&lt;code class=&quot;mv6bHd&quot; style=&quot;background: none 0% 0% / auto repeat scroll padding-box border-box rgb(44, 48, 61); border-radius: 4px; padding: 0px 4px;&quot;&gt;NullPointerExceptions&lt;/code&gt;.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;list-style: inherit; margin: 0px 0px 8px; padding-inline-start: 4px; padding: 0px;&quot;&gt;&lt;div class=&quot;zMgcWd dSKvsb&quot; data-il=&quot;&quot; style=&quot;border-bottom: none; padding-bottom: 0px; padding-top: 8px;&quot;&gt;&lt;div data-crb-p=&quot;&quot;&gt;&lt;div class=&quot;xFTqob&quot; style=&quot;flex: 1 1 0%; min-width: 0px;&quot;&gt;&lt;div class=&quot;Gur8Ad&quot; style=&quot;display: inline; line-height: 24px; overflow: hidden; padding-bottom: 4px; transition: transform 200ms cubic-bezier(0.2, 0, 0, 1);&quot;&gt;&lt;span data-huuid=&quot;12047285069845961618&quot;&gt;&lt;strong&gt;Improved Readability:&lt;/strong&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;vM0jzc&quot; style=&quot;display: inline; line-height: 24px;&quot;&gt;&lt;span data-huuid=&quot;12047285069845961781&quot;&gt;Makes the code&#39;s intent clearer, as the return type itself indicates that the value might be absent.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;list-style: inherit; margin: 0px; padding-inline-start: 4px; padding: 0px;&quot;&gt;&lt;div class=&quot;zMgcWd dSKvsb&quot; data-il=&quot;&quot; style=&quot;border-bottom: none; padding-bottom: 0px; padding-top: 8px;&quot;&gt;&lt;div data-crb-p=&quot;&quot;&gt;&lt;div class=&quot;xFTqob&quot; style=&quot;flex: 1 1 0%; min-width: 0px;&quot;&gt;&lt;div class=&quot;Gur8Ad&quot; style=&quot;display: inline; line-height: 24px; overflow: hidden; padding-bottom: 4px; transition: transform 200ms cubic-bezier(0.2, 0, 0, 1);&quot;&gt;&lt;span data-huuid=&quot;12047285069845962107&quot;&gt;&lt;strong&gt;Functional Programming Style:&lt;/strong&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;vM0jzc&quot; style=&quot;display: inline; line-height: 24px;&quot;&gt;&lt;span data-huuid=&quot;12047285069845962270&quot;&gt;Integrates well with functional programming constructs available in Java 8 and later.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;</description><link>https://value2read.blogspot.com/2025/11/how-to-use-optional-with-findby-methods.html</link><author>noreply@blogger.com (Online Shopping)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-4087826543820268752</guid><pubDate>Tue, 11 Nov 2025 05:04:00 +0000</pubDate><atom:updated>2025-11-10T21:04:36.815-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">eci</category><title>How to Find Your BLO Name and Contact Details in Minutes?</title><description>&lt;p&gt;The &lt;b&gt;Booth Level Officer (BLO)&lt;/b&gt; is your most important contact for everything related to your voter ID, registration, and the ongoing electoral roll revision drives like &lt;b&gt;SIR&lt;/b&gt; (Special Intensive Revision). They are the official link between you and the Election Commission.&lt;/p&gt;&lt;p&gt;If your BLO hasn&#39;t visited your home or you need to contact them for corrections, here is the fastest way to find their name and phone number using official government portals.&lt;/p&gt;&lt;h3&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEi75bjRMUr8c0EJyTMQ6l4Xb4YFqLMhH_yPPu0MFszYnDcixNJ1a2mv_L7btn3WYaeJL51CN5iIkejDKkUQOldBSUyMr0WazIo1LomsFnpgDEPYK8sJDoART9h0-Zzarq-LPOkMDQRuAYNOXaEg-c9gvUPFO41ktIoiblBDK77x8I_TuI5g9QIb6LD52N8&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;720&quot; data-original-width=&quot;1280&quot; height=&quot;180&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEi75bjRMUr8c0EJyTMQ6l4Xb4YFqLMhH_yPPu0MFszYnDcixNJ1a2mv_L7btn3WYaeJL51CN5iIkejDKkUQOldBSUyMr0WazIo1LomsFnpgDEPYK8sJDoART9h0-Zzarq-LPOkMDQRuAYNOXaEg-c9gvUPFO41ktIoiblBDK77x8I_TuI5g9QIb6LD52N8&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Method 1: The National ECI Portal (Recommended for All States)&lt;/h3&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;The Election Commission of India (ECI) provides a universal portal to help you locate your polling station details, which includes your BLO&#39;s information.&lt;/p&gt;&lt;ol start=&quot;1&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Navigate to the Search Page:&lt;/b&gt; Open the official ECI search tool: &lt;response-element ng-version=&quot;0.0.0-PLACEHOLDER&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;link-block _nghost-ng-c2903608492=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;a _ngcontent-ng-c2903608492=&quot;&quot; _nghost-ng-c3106697118=&quot;&quot; class=&quot;ng-star-inserted&quot; data-hveid=&quot;0&quot; data-ved=&quot;0CAAQ_4QMahgKEwj0j8Hvo-mQAxUAAAAAHQAAAAAQigE&quot; decode-data-ved=&quot;1&quot; externallink=&quot;&quot; href=&quot;https://electoralsearch.eci.gov.in/pollingstation&quot; jslog=&quot;197247;track:generic_click,impression,attention;BardVeMetadataKey:[[&amp;quot;r_a1ea528f1d77e69c&amp;quot;,&amp;quot;c_c176941ccb9eb93e&amp;quot;,null,&amp;quot;rc_69ddfe354b3c14b5&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]]&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;electoralsearch.eci.gov.in/pollingstation&lt;/a&gt;&lt;!----&gt;&lt;/link-block&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;/response-element&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Choose Your Search Method:&lt;/b&gt; You will typically have two options:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Search by EPIC (Voter ID) Number:&lt;/b&gt; This is the quickest and most accurate method. Enter your 10-digit Voter ID Number (EPIC), select your State and Captcha, then click &lt;b&gt;&quot;Search&quot;&lt;/b&gt;.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Search by Details:&lt;/b&gt; If you don&#39;t have your EPIC number, you can search by entering your name, father’s/husband’s name, age, date of birth, state, district, and Assembly Constituency.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;View Your Details:&lt;/b&gt; Once the search is complete, the page will display your electoral information.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Find the BLO Contact:&lt;/b&gt; Look for a section or button titled &lt;b&gt;&quot;View Details&quot;&lt;/b&gt;, &lt;b&gt;&quot;Get BLO Details&quot;&lt;/b&gt;, or check the bottom of the displayed record. This is where you will find the:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Polling Station Name&lt;/b&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;BLO Name&lt;/b&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;BLO Phone Number&lt;/b&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Save the Information:&lt;/b&gt; Make sure to save the BLO&#39;s name and contact number for any future verification or correction needs.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;hr /&gt;&lt;p&gt;&lt;/p&gt;&lt;h3&gt;Method 2: State-Specific Chief Electoral Officer (CEO) Portal&lt;/h3&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Most states provide a direct link on their respective CEO websites, which can sometimes be more user-friendly or up-to-date with local revisions.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Example: Tamil Nadu&lt;/b&gt;&lt;/p&gt;&lt;ol start=&quot;1&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Visit the CEO Website:&lt;/b&gt; Go to the official state website, such as the Chief Electoral Officer, Tamil Nadu: &lt;response-element ng-version=&quot;0.0.0-PLACEHOLDER&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;link-block _nghost-ng-c2903608492=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;a _ngcontent-ng-c2903608492=&quot;&quot; _nghost-ng-c3106697118=&quot;&quot; class=&quot;ng-star-inserted&quot; data-hveid=&quot;0&quot; data-ved=&quot;0CAAQ_4QMahgKEwj0j8Hvo-mQAxUAAAAAHQAAAAAQiwE&quot; decode-data-ved=&quot;1&quot; externallink=&quot;&quot; href=&quot;https://www.elections.tn.gov.in/index.aspx&quot; jslog=&quot;197247;track:generic_click,impression,attention;BardVeMetadataKey:[[&amp;quot;r_a1ea528f1d77e69c&amp;quot;,&amp;quot;c_c176941ccb9eb93e&amp;quot;,null,&amp;quot;rc_69ddfe354b3c14b5&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]]&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;elections.tn.gov.in/index.aspx&lt;/a&gt;&lt;!----&gt;&lt;/link-block&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;/response-element&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Look for Voter Services:&lt;/b&gt; Navigate to the section dedicated to &lt;b&gt;&quot;Voters&#39; Services&quot;&lt;/b&gt; or &lt;b&gt;&quot;Search Electoral Roll&quot;&lt;/b&gt;.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Use the Dedicated Tool:&lt;/b&gt; Look for a link specifically labeled &lt;b&gt;&quot;Know Your BLO&quot;&lt;/b&gt; or &lt;b&gt;&quot;Search Your Name in Electoral Roll&quot;&lt;/b&gt;.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Enter Credentials:&lt;/b&gt; You will typically be prompted to enter your &lt;b&gt;EPIC Number&lt;/b&gt; or other personal details.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Retrieve Contact:&lt;/b&gt; The state portal will then display your polling station details and the contact information for your designated &lt;b&gt;BLO&lt;/b&gt;.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;hr /&gt;&lt;p&gt;&lt;/p&gt;&lt;h3&gt;💡 Pro-Tip: Use the Voter Helpline App&lt;/h3&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;For the easiest way to access all election services, download the &lt;b&gt;Voter Helpline App&lt;/b&gt; on your smartphone. The app has a dedicated section to search the electoral roll and immediately display your BLO&#39;s contact details, ensuring you have the information ready when you need it for verification or updates.&lt;/p&gt;</description><link>https://value2read.blogspot.com/2025/11/how-to-find-your-blo-name-and-contact.html</link><author>noreply@blogger.com (Online Shopping)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEi75bjRMUr8c0EJyTMQ6l4Xb4YFqLMhH_yPPu0MFszYnDcixNJ1a2mv_L7btn3WYaeJL51CN5iIkejDKkUQOldBSUyMr0WazIo1LomsFnpgDEPYK8sJDoART9h0-Zzarq-LPOkMDQRuAYNOXaEg-c9gvUPFO41ktIoiblBDK77x8I_TuI5g9QIb6LD52N8=s72-c" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-251676453828736452</guid><pubDate>Mon, 10 Nov 2025 12:19:00 +0000</pubDate><atom:updated>2025-11-10T04:19:44.073-08:00</atom:updated><title>The key concept in understanding how the Repository layer (especially in Spring Data JPA) works</title><description>&lt;p&gt;&amp;nbsp;Let’s go through this &lt;strong data-end=&quot;182&quot; data-start=&quot;166&quot;&gt;step by step&lt;/strong&gt; so it’s 100% clear 👇&lt;/p&gt;
&lt;hr data-end=&quot;211&quot; data-start=&quot;208&quot; /&gt;
&lt;h2 data-end=&quot;261&quot; data-start=&quot;213&quot;&gt;🧩 1. What the Repository Layer Actually Does&lt;/h2&gt;
&lt;p data-end=&quot;451&quot; data-start=&quot;262&quot;&gt;In Spring Boot (with Spring Data JPA), the &lt;strong data-end=&quot;325&quot; data-start=&quot;305&quot;&gt;repository layer&lt;/strong&gt; is responsible for &lt;strong data-end=&quot;378&quot; data-start=&quot;345&quot;&gt;interacting with the database&lt;/strong&gt; — performing CRUD (Create, Read, Update, Delete) operations on entities.&lt;/p&gt;
&lt;p data-end=&quot;509&quot; data-start=&quot;453&quot;&gt;Spring gives you the base repository interfaces such as:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;606&quot; data-start=&quot;511&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;JpaRepository&lt;/span&gt;&amp;lt;T, ID&amp;gt; &lt;span class=&quot;hljs-keyword&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;PagingAndSortingRepository&lt;/span&gt;&amp;lt;T, ID&amp;gt; { }
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;735&quot; data-start=&quot;608&quot;&gt;When you extend this interface (e.g., &lt;code data-end=&quot;678&quot; data-start=&quot;646&quot;&gt;JpaRepository&amp;lt;Product, String&amp;gt;&lt;/code&gt;), you get &lt;strong data-end=&quot;728&quot; data-start=&quot;689&quot;&gt;many built-in methods automatically&lt;/strong&gt;, like:&lt;/p&gt;
&lt;ul data-end=&quot;810&quot; data-start=&quot;736&quot;&gt;
&lt;li data-end=&quot;746&quot; data-start=&quot;736&quot;&gt;
&lt;p data-end=&quot;746&quot; data-start=&quot;738&quot;&gt;&lt;code data-end=&quot;746&quot; data-start=&quot;738&quot;&gt;save()&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;761&quot; data-start=&quot;747&quot;&gt;
&lt;p data-end=&quot;761&quot; data-start=&quot;749&quot;&gt;&lt;code data-end=&quot;761&quot; data-start=&quot;749&quot;&gt;findById()&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;775&quot; data-start=&quot;762&quot;&gt;
&lt;p data-end=&quot;775&quot; data-start=&quot;764&quot;&gt;&lt;code data-end=&quot;775&quot; data-start=&quot;764&quot;&gt;findAll()&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;792&quot; data-start=&quot;776&quot;&gt;
&lt;p data-end=&quot;792&quot; data-start=&quot;778&quot;&gt;&lt;code data-end=&quot;792&quot; data-start=&quot;778&quot;&gt;deleteById()&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;810&quot; data-start=&quot;793&quot;&gt;
&lt;p data-end=&quot;810&quot; data-start=&quot;795&quot;&gt;&lt;code data-end=&quot;804&quot; data-start=&quot;795&quot;&gt;count()&lt;/code&gt;, etc.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;815&quot; data-start=&quot;812&quot; /&gt;
&lt;h2 data-end=&quot;885&quot; data-start=&quot;817&quot;&gt;⚙️ 2. Custom Method Naming — the &quot;Magic&quot; of Derived Query Methods&lt;/h2&gt;
&lt;p data-end=&quot;1047&quot; data-start=&quot;886&quot;&gt;You &lt;strong data-end=&quot;897&quot; data-start=&quot;890&quot;&gt;can&lt;/strong&gt; define your own methods — but &lt;strong data-end=&quot;967&quot; data-start=&quot;928&quot;&gt;you must follow a naming convention&lt;/strong&gt; if you want Spring Data JPA to &lt;strong data-end=&quot;1025&quot; data-start=&quot;999&quot;&gt;automatically generate&lt;/strong&gt; the SQL/JPQL for you.&lt;/p&gt;
&lt;p data-end=&quot;1063&quot; data-start=&quot;1049&quot;&gt;For example 👇&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1354&quot; data-start=&quot;1065&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;ProductRepository&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;JpaRepository&lt;/span&gt;&amp;lt;Product, String&amp;gt; {

    List&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;findByCategory&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(String category)&lt;/span&gt;;
    Product &lt;span class=&quot;hljs-title function_&quot;&gt;findByName&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(String name)&lt;/span&gt;;
    List&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;findByPriceGreaterThan&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(&lt;span class=&quot;hljs-type&quot;&gt;double&lt;/span&gt;&lt;/span&gt; price);
    List&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;findByStockLessThanEqual&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(&lt;span class=&quot;hljs-type&quot;&gt;int&lt;/span&gt;&lt;/span&gt; stock);
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1376&quot; data-start=&quot;1356&quot;&gt;Here’s what happens:&lt;/p&gt;
&lt;ul data-end=&quot;1623&quot; data-start=&quot;1377&quot;&gt;
&lt;li data-end=&quot;1457&quot; data-start=&quot;1377&quot;&gt;
&lt;p data-end=&quot;1457&quot; data-start=&quot;1379&quot;&gt;&lt;code data-end=&quot;1412&quot; data-start=&quot;1379&quot;&gt;findByCategory(String category)&lt;/code&gt; → &lt;code data-end=&quot;1457&quot; data-start=&quot;1415&quot;&gt;SELECT * FROM product WHERE category = ?&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1540&quot; data-start=&quot;1458&quot;&gt;
&lt;p data-end=&quot;1540&quot; data-start=&quot;1460&quot;&gt;&lt;code data-end=&quot;1498&quot; data-start=&quot;1460&quot;&gt;findByPriceGreaterThan(double price)&lt;/code&gt; → &lt;code data-end=&quot;1540&quot; data-start=&quot;1501&quot;&gt;SELECT * FROM product WHERE price &amp;gt; ?&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1623&quot; data-start=&quot;1541&quot;&gt;
&lt;p data-end=&quot;1623&quot; data-start=&quot;1543&quot;&gt;&lt;code data-end=&quot;1580&quot; data-start=&quot;1543&quot;&gt;findByStockLessThanEqual(int stock)&lt;/code&gt; → &lt;code data-end=&quot;1623&quot; data-start=&quot;1583&quot;&gt;SELECT * FROM product WHERE stock &amp;lt;= ?&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1697&quot; data-start=&quot;1625&quot;&gt;✅ &lt;strong data-end=&quot;1661&quot; data-start=&quot;1627&quot;&gt;Spring parses your method name&lt;/strong&gt; and builds the query automatically.&lt;/p&gt;
&lt;p data-end=&quot;1766&quot; data-start=&quot;1699&quot;&gt;That’s why the &lt;strong data-end=&quot;1759&quot; data-start=&quot;1714&quot;&gt;method name must follow specific patterns&lt;/strong&gt;, like:&lt;/p&gt;
&lt;ul data-end=&quot;1838&quot; data-start=&quot;1767&quot;&gt;
&lt;li data-end=&quot;1777&quot; data-start=&quot;1767&quot;&gt;
&lt;p data-end=&quot;1777&quot; data-start=&quot;1769&quot;&gt;&lt;code data-end=&quot;1777&quot; data-start=&quot;1769&quot;&gt;findBy&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1789&quot; data-start=&quot;1778&quot;&gt;
&lt;p data-end=&quot;1789&quot; data-start=&quot;1780&quot;&gt;&lt;code data-end=&quot;1789&quot; data-start=&quot;1780&quot;&gt;countBy&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1802&quot; data-start=&quot;1790&quot;&gt;
&lt;p data-end=&quot;1802&quot; data-start=&quot;1792&quot;&gt;&lt;code data-end=&quot;1802&quot; data-start=&quot;1792&quot;&gt;existsBy&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1815&quot; data-start=&quot;1803&quot;&gt;
&lt;p data-end=&quot;1815&quot; data-start=&quot;1805&quot;&gt;&lt;code data-end=&quot;1815&quot; data-start=&quot;1805&quot;&gt;deleteBy&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1826&quot; data-start=&quot;1816&quot;&gt;
&lt;p data-end=&quot;1826&quot; data-start=&quot;1818&quot;&gt;&lt;code data-end=&quot;1826&quot; data-start=&quot;1818&quot;&gt;readBy&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1838&quot; data-start=&quot;1827&quot;&gt;
&lt;p data-end=&quot;1838&quot; data-start=&quot;1829&quot;&gt;&lt;code data-end=&quot;1838&quot; data-start=&quot;1829&quot;&gt;queryBy&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1881&quot; data-start=&quot;1840&quot;&gt;You can also combine multiple conditions:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1970&quot; data-start=&quot;1882&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;List&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;findByCategoryAndPriceLessThan&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(String category, &lt;span class=&quot;hljs-type&quot;&gt;double&lt;/span&gt;&lt;/span&gt; price);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;1975&quot; data-start=&quot;1972&quot; /&gt;
&lt;h2 data-end=&quot;2035&quot; data-start=&quot;1977&quot;&gt;🧠 3. If You Don’t Want to Follow the Naming Convention&lt;/h2&gt;
&lt;p data-end=&quot;2204&quot; data-start=&quot;2036&quot;&gt;You can still define your own custom methods &lt;strong data-end=&quot;2107&quot; data-start=&quot;2081&quot;&gt;with any name you like&lt;/strong&gt;, but then &lt;strong data-end=&quot;2171&quot; data-start=&quot;2118&quot;&gt;you must tell Spring explicitly what query to run&lt;/strong&gt; — using the &lt;code data-end=&quot;2192&quot; data-start=&quot;2184&quot;&gt;@Query&lt;/code&gt; annotation.&lt;/p&gt;
&lt;p data-end=&quot;2214&quot; data-start=&quot;2206&quot;&gt;Example:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2470&quot; data-start=&quot;2215&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;ProductRepository&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;JpaRepository&lt;/span&gt;&amp;lt;Product, String&amp;gt; {

    &lt;span class=&quot;hljs-meta&quot;&gt;@Query(&quot;SELECT p FROM Product p WHERE p.name LIKE %:keyword% OR p.category LIKE %:keyword%&quot;)&lt;/span&gt;
    List&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;searchProducts&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(&lt;span class=&quot;hljs-meta&quot;&gt;@Param(&quot;keyword&quot;)&lt;/span&gt;&lt;/span&gt; String keyword);
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;2628&quot; data-start=&quot;2472&quot;&gt;✅ Here, &lt;code data-end=&quot;2498&quot; data-start=&quot;2480&quot;&gt;searchProducts()&lt;/code&gt; is your own name — it doesn’t follow the &lt;code data-end=&quot;2551&quot; data-start=&quot;2540&quot;&gt;findBy...&lt;/code&gt; pattern, but it’s perfectly fine because you’ve provided the query manually.&lt;/p&gt;
&lt;hr data-end=&quot;2633&quot; data-start=&quot;2630&quot; /&gt;
&lt;h2 data-end=&quot;2685&quot; data-start=&quot;2635&quot;&gt;🧩 4. If You Need Complex or Native SQL Queries&lt;/h2&gt;
&lt;p data-end=&quot;2748&quot; data-start=&quot;2686&quot;&gt;You can use &lt;code data-end=&quot;2718&quot; data-start=&quot;2698&quot;&gt;nativeQuery = true&lt;/code&gt; to write SQL instead of JPQL:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2947&quot; data-start=&quot;2750&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;span class=&quot;hljs-meta&quot;&gt;@Query(value = &quot;SELECT * FROM product WHERE price BETWEEN :min AND :max&quot;, nativeQuery = true)&lt;/span&gt;
List&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;findProductsInPriceRange&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(&lt;span class=&quot;hljs-meta&quot;&gt;@Param(&quot;min&quot;)&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-type&quot;&gt;double&lt;/span&gt; min, &lt;span class=&quot;hljs-meta&quot;&gt;@Param(&quot;max&quot;)&lt;/span&gt; &lt;span class=&quot;hljs-type&quot;&gt;double&lt;/span&gt; max);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;2952&quot; data-start=&quot;2949&quot; /&gt;
&lt;h2 data-end=&quot;3014&quot; data-start=&quot;2954&quot;&gt;⚖️ 5. Summary — When You Can and Can’t Use Your Own Names&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;3521&quot; data-start=&quot;3016&quot;&gt;&lt;thead data-end=&quot;3074&quot; data-start=&quot;3016&quot;&gt;&lt;tr data-end=&quot;3074&quot; data-start=&quot;3016&quot;&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;3023&quot; data-start=&quot;3016&quot;&gt;Case&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;3059&quot; data-start=&quot;3023&quot;&gt;Can You Use Your Own Method Name?&lt;/th&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;3074&quot; data-start=&quot;3059&quot;&gt;Requirement&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;3521&quot; data-start=&quot;3134&quot;&gt;&lt;tr data-end=&quot;3237&quot; data-start=&quot;3134&quot;&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;3172&quot; data-start=&quot;3134&quot;&gt;✅ Derived query (like &lt;code data-end=&quot;3170&quot; data-start=&quot;3158&quot;&gt;findByName&lt;/code&gt;)&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3206&quot; data-start=&quot;3172&quot;&gt;No — must follow naming pattern&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;3237&quot; data-start=&quot;3206&quot;&gt;Spring auto-generates query&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3306&quot; data-start=&quot;3238&quot;&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;3269&quot; data-start=&quot;3238&quot;&gt;✅ Annotated query (&lt;code data-end=&quot;3267&quot; data-start=&quot;3259&quot;&gt;@Query&lt;/code&gt;)&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3275&quot; data-start=&quot;3269&quot;&gt;Yes&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;3306&quot; data-start=&quot;3275&quot;&gt;You write your own JPQL/SQL&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3429&quot; data-start=&quot;3307&quot;&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;3364&quot; data-start=&quot;3307&quot;&gt;✅ Custom implementation (in a custom repository class)&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3370&quot; data-start=&quot;3364&quot;&gt;Yes&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;3429&quot; data-start=&quot;3370&quot;&gt;You write the logic manually in an implementation class&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3521&quot; data-start=&quot;3430&quot;&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;3484&quot; data-start=&quot;3430&quot;&gt;❌ Arbitrary name without &lt;code data-end=&quot;3465&quot; data-start=&quot;3457&quot;&gt;@Query&lt;/code&gt; or implementation&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3489&quot; data-start=&quot;3484&quot;&gt;No&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;3521&quot; data-start=&quot;3489&quot;&gt;Spring won’t know what to do&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;3526&quot; data-start=&quot;3523&quot; /&gt;
&lt;h2 data-end=&quot;3581&quot; data-start=&quot;3528&quot;&gt;🧭 6. Example — Custom Repository with Both Styles&lt;/h2&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;3962&quot; data-start=&quot;3583&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;span class=&quot;hljs-meta&quot;&gt;@Repository&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;ProductRepository&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;JpaRepository&lt;/span&gt;&amp;lt;Product, String&amp;gt; {

    &lt;span class=&quot;hljs-comment&quot;&gt;// ✅ Auto-generated query by naming convention&lt;/span&gt;
    List&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;findByCategory&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(String category)&lt;/span&gt;;

    &lt;span class=&quot;hljs-comment&quot;&gt;// ✅ Custom name with manual query&lt;/span&gt;
    &lt;span class=&quot;hljs-meta&quot;&gt;@Query(&quot;SELECT p FROM Product p WHERE p.name LIKE %:keyword%&quot;)&lt;/span&gt;
    List&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;searchProducts&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(&lt;span class=&quot;hljs-meta&quot;&gt;@Param(&quot;keyword&quot;)&lt;/span&gt;&lt;/span&gt; String keyword);
}

&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;b&gt;An example of how &lt;span data-end=&quot;4046&quot; data-start=&quot;4017&quot;&gt;custom repository methods&lt;/span&gt; (with manual implementation class) work — for example, when you want a more complex query than &lt;code data-end=&quot;4150&quot; data-start=&quot;4142&quot;&gt;@Query&lt;/code&gt; allows?&lt;/b&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;p data-end=&quot;263&quot; data-start=&quot;0&quot;&gt;let’s go &lt;strong data-end=&quot;46&quot; data-start=&quot;30&quot;&gt;step by step&lt;/strong&gt; through how to create &lt;strong data-end=&quot;125&quot; data-start=&quot;69&quot;&gt;custom repository methods with manual implementation&lt;/strong&gt;, especially when your logic is &lt;strong data-end=&quot;185&quot; data-start=&quot;157&quot;&gt;too complex for &lt;code data-end=&quot;183&quot; data-start=&quot;175&quot;&gt;@Query&lt;/code&gt;&lt;/strong&gt; or you need &lt;strong data-end=&quot;228&quot; data-start=&quot;198&quot;&gt;custom database operations&lt;/strong&gt; (like dynamic filtering or joins).&lt;/p&gt;
&lt;hr data-end=&quot;268&quot; data-start=&quot;265&quot; /&gt;
&lt;h2 data-end=&quot;314&quot; data-start=&quot;270&quot;&gt;🧩 Step 1: The Usual Repository Interface&lt;/h2&gt;
&lt;p data-end=&quot;377&quot; data-start=&quot;315&quot;&gt;Let’s say you already have a basic repository for your entity:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;802&quot; data-start=&quot;379&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;package&lt;/span&gt; com.bej.products.repository;

&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.model.Product;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.jpa.repository.JpaRepository;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.stereotype.Repository;

&lt;span class=&quot;hljs-meta&quot;&gt;@Repository&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;ProductRepository&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;JpaRepository&lt;/span&gt;&amp;lt;Product, String&amp;gt;, CustomProductRepository {
    &lt;span class=&quot;hljs-comment&quot;&gt;// You can still keep your normal JPA methods here.&lt;/span&gt;
    List&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;findByCategory&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(String category)&lt;/span&gt;;
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;h3 data-end=&quot;818&quot; data-start=&quot;804&quot;&gt;👇 Notice:&lt;/h3&gt;
&lt;p data-end=&quot;875&quot; data-start=&quot;819&quot;&gt;We’ve added &lt;code data-end=&quot;856&quot; data-start=&quot;831&quot;&gt;CustomProductRepository&lt;/code&gt; to this interface:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;916&quot; data-start=&quot;876&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;..., CustomProductRepository
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1048&quot; data-start=&quot;918&quot;&gt;This means &lt;code data-end=&quot;948&quot; data-start=&quot;929&quot;&gt;ProductRepository&lt;/code&gt; now also includes &lt;strong data-end=&quot;985&quot; data-start=&quot;967&quot;&gt;custom methods&lt;/strong&gt; that you’ll define manually in a separate interface and class.&lt;/p&gt;
&lt;hr data-end=&quot;1053&quot; data-start=&quot;1050&quot; /&gt;
&lt;h2 data-end=&quot;1107&quot; data-start=&quot;1055&quot;&gt;🧩 Step 2: Create the Custom Repository Interface&lt;/h2&gt;
&lt;p data-end=&quot;1183&quot; data-start=&quot;1108&quot;&gt;Define a new interface where you declare your &lt;strong data-end=&quot;1182&quot; data-start=&quot;1154&quot;&gt;custom method signatures&lt;/strong&gt;.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1442&quot; data-start=&quot;1185&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;package&lt;/span&gt; com.bej.products.repository;

&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.model.Product;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; java.util.List;

&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;CustomProductRepository&lt;/span&gt; {
    List&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;findProductsWithDynamicFilter&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(String category, Double minPrice, Double maxPrice)&lt;/span&gt;;
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1579&quot; data-start=&quot;1444&quot;&gt;✅ Here, we’re saying:&lt;br data-end=&quot;1468&quot; data-start=&quot;1465&quot; /&gt;
“I want to create a method that finds products based on optional filters — category, min price, and max price.”&lt;/p&gt;
&lt;p data-end=&quot;1667&quot; data-start=&quot;1581&quot;&gt;But we’re not telling Spring &lt;strong data-end=&quot;1617&quot; data-start=&quot;1610&quot;&gt;how&lt;/strong&gt; to do it yet.&lt;br data-end=&quot;1634&quot; data-start=&quot;1631&quot; /&gt;
We’ll implement it manually next.&lt;/p&gt;
&lt;hr data-end=&quot;1672&quot; data-start=&quot;1669&quot; /&gt;
&lt;h2 data-end=&quot;1737&quot; data-start=&quot;1674&quot;&gt;🧩 Step 3: Create the Custom Repository Implementation Class&lt;/h2&gt;
&lt;p data-end=&quot;1801&quot; data-start=&quot;1739&quot;&gt;Now, we’ll &lt;strong data-end=&quot;1763&quot; data-start=&quot;1750&quot;&gt;implement&lt;/strong&gt; that interface with the actual logic.&lt;/p&gt;
&lt;p data-end=&quot;1864&quot; data-start=&quot;1803&quot;&gt;👉 &lt;strong data-end=&quot;1822&quot; data-start=&quot;1806&quot;&gt;Naming rule:&lt;/strong&gt;&lt;br data-end=&quot;1825&quot; data-start=&quot;1822&quot; /&gt;
The class &lt;strong data-end=&quot;1843&quot; data-start=&quot;1835&quot;&gt;must&lt;/strong&gt; follow this pattern:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1897&quot; data-start=&quot;1865&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre!&quot;&gt;&lt;span class=&quot;language-xml&quot;&gt;&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;MainRepositoryName&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;gt;Impl
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1919&quot; data-start=&quot;1898&quot;&gt;So here it should be:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1949&quot; data-start=&quot;1920&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre!&quot;&gt;&lt;span class=&quot;hljs-attribute&quot;&gt;ProductRepositoryImpl&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1966&quot; data-start=&quot;1951&quot;&gt;Let’s write it:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;3561&quot; data-start=&quot;1968&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;package&lt;/span&gt; com.bej.products.repository;

&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.model.Product;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; jakarta.persistence.EntityManager;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; jakarta.persistence.PersistenceContext;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; jakarta.persistence.TypedQuery;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.stereotype.Repository;

&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; java.util.List;

&lt;span class=&quot;hljs-meta&quot;&gt;@Repository&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;ProductRepositoryImpl&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;implements&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;CustomProductRepository&lt;/span&gt; {

    &lt;span class=&quot;hljs-meta&quot;&gt;@PersistenceContext&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; EntityManager entityManager;

    &lt;span class=&quot;hljs-meta&quot;&gt;@Override&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; List&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;findProductsWithDynamicFilter&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(String category, Double minPrice, Double maxPrice)&lt;/span&gt; {
        &lt;span class=&quot;hljs-comment&quot;&gt;// Build base JPQL query&lt;/span&gt;
        &lt;span class=&quot;hljs-type&quot;&gt;StringBuilder&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;jpql&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;StringBuilder&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&quot;SELECT p FROM Product p WHERE 1=1&quot;&lt;/span&gt;);

        &lt;span class=&quot;hljs-comment&quot;&gt;// Add conditions dynamically&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (category != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; !category.isEmpty()) {
            jpql.append(&lt;span class=&quot;hljs-string&quot;&gt;&quot; AND p.category = :category&quot;&lt;/span&gt;);
        }
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (minPrice != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) {
            jpql.append(&lt;span class=&quot;hljs-string&quot;&gt;&quot; AND p.price &amp;gt;= :minPrice&quot;&lt;/span&gt;);
        }
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (maxPrice != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) {
            jpql.append(&lt;span class=&quot;hljs-string&quot;&gt;&quot; AND p.price &amp;lt;= :maxPrice&quot;&lt;/span&gt;);
        }

        &lt;span class=&quot;hljs-comment&quot;&gt;// Create query&lt;/span&gt;
        TypedQuery&amp;lt;Product&amp;gt; query = entityManager.createQuery(jpql.toString(), Product.class);

        &lt;span class=&quot;hljs-comment&quot;&gt;// Set parameters only if present&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (category != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; !category.isEmpty()) {
            query.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;category&quot;&lt;/span&gt;, category);
        }
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (minPrice != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) {
            query.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;minPrice&quot;&lt;/span&gt;, minPrice);
        }
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (maxPrice != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) {
            query.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;maxPrice&quot;&lt;/span&gt;, maxPrice);
        }

        &lt;span class=&quot;hljs-comment&quot;&gt;// Execute and return results&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; query.getResultList();
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;3566&quot; data-start=&quot;3563&quot; /&gt;
&lt;h2 data-end=&quot;3604&quot; data-start=&quot;3568&quot;&gt;🧠 Step 4: What’s Happening Here?&lt;/h2&gt;
&lt;ul data-end=&quot;3937&quot; data-start=&quot;3606&quot;&gt;
&lt;li data-end=&quot;3695&quot; data-start=&quot;3606&quot;&gt;
&lt;p data-end=&quot;3695&quot; data-start=&quot;3608&quot;&gt;We used &lt;strong data-end=&quot;3635&quot; data-start=&quot;3616&quot;&gt;&lt;code data-end=&quot;3633&quot; data-start=&quot;3618&quot;&gt;EntityManager&lt;/code&gt;&lt;/strong&gt; (the low-level JPA interface) to build a &lt;strong data-end=&quot;3694&quot; data-start=&quot;3677&quot;&gt;dynamic query&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3846&quot; data-start=&quot;3696&quot;&gt;
&lt;p data-end=&quot;3773&quot; data-start=&quot;3698&quot;&gt;The method allows &lt;strong data-end=&quot;3739&quot; data-start=&quot;3716&quot;&gt;optional parameters&lt;/strong&gt; — meaning the user can search by:&lt;/p&gt;
&lt;ul data-end=&quot;3846&quot; data-start=&quot;3776&quot;&gt;
&lt;li data-end=&quot;3792&quot; data-start=&quot;3776&quot;&gt;
&lt;p data-end=&quot;3792&quot; data-start=&quot;3778&quot;&gt;only category,&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3817&quot; data-start=&quot;3795&quot;&gt;
&lt;p data-end=&quot;3817&quot; data-start=&quot;3797&quot;&gt;or only price range,&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3846&quot; data-start=&quot;3820&quot;&gt;
&lt;p data-end=&quot;3846&quot; data-start=&quot;3822&quot;&gt;or all of them together.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3937&quot; data-start=&quot;3847&quot;&gt;
&lt;p data-end=&quot;3937&quot; data-start=&quot;3849&quot;&gt;Spring will &lt;strong data-end=&quot;3883&quot; data-start=&quot;3861&quot;&gt;automatically wire&lt;/strong&gt; this implementation to your main &lt;code data-end=&quot;3936&quot; data-start=&quot;3917&quot;&gt;ProductRepository&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;4105&quot; data-start=&quot;3939&quot;&gt;You don’t need to manually connect them — as long as:&lt;br /&gt;
✅ Your custom class name matches the pattern&lt;br data-end=&quot;4040&quot; data-start=&quot;4037&quot; /&gt;
✅ It’s in the same package (or subpackage) as the main repository&lt;/p&gt;
&lt;hr data-end=&quot;4110&quot; data-start=&quot;4107&quot; /&gt;
&lt;h2 data-end=&quot;4154&quot; data-start=&quot;4112&quot;&gt;🧩 Step 5: Use It in Your Service Layer&lt;/h2&gt;
&lt;p data-end=&quot;4164&quot; data-start=&quot;4156&quot;&gt;Example:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;4792&quot; data-start=&quot;4166&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;package&lt;/span&gt; com.bej.products.service;

&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.model.Product;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.repository.ProductRepository;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.stereotype.Service;

&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; java.util.List;

&lt;span class=&quot;hljs-meta&quot;&gt;@Service&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;ProductService&lt;/span&gt; {

    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;final&lt;/span&gt; ProductRepository productRepository;

    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-title function_&quot;&gt;ProductService&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(ProductRepository productRepository)&lt;/span&gt; {
        &lt;span class=&quot;hljs-built_in&quot;&gt;this&lt;/span&gt;.productRepository = productRepository;
    }

    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; List&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;searchProducts&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(String category, Double minPrice, Double maxPrice)&lt;/span&gt; {
        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; productRepository.findProductsWithDynamicFilter(category, minPrice, maxPrice);
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;4797&quot; data-start=&quot;4794&quot; /&gt;
&lt;h2 data-end=&quot;4845&quot; data-start=&quot;4799&quot;&gt;🧩 Step 6: Example Usage (Controller Layer)&lt;/h2&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;5246&quot; data-start=&quot;4846&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;span class=&quot;hljs-meta&quot;&gt;@GetMapping(&quot;/products/search&quot;)&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; ResponseEntity&amp;lt;List&amp;lt;Product&amp;gt;&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;searchProducts&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(
        &lt;/span&gt;&lt;span class=&quot;hljs-meta&quot;&gt;@RequestParam(required = false)&lt;/span&gt; String category,
        &lt;span class=&quot;hljs-meta&quot;&gt;@RequestParam(required = false)&lt;/span&gt; Double minPrice,
        &lt;span class=&quot;hljs-meta&quot;&gt;@RequestParam(required = false)&lt;/span&gt; Double maxPrice) {

    List&amp;lt;Product&amp;gt; results = productService.searchProducts(category, minPrice, maxPrice);
    &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; ResponseEntity.ok(results);
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;5251&quot; data-start=&quot;5248&quot; /&gt;
&lt;h2 data-end=&quot;5271&quot; data-start=&quot;5253&quot;&gt;✅ Final Summary&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;5754&quot; data-start=&quot;5273&quot;&gt;&lt;thead data-end=&quot;5299&quot; data-start=&quot;5273&quot;&gt;&lt;tr data-end=&quot;5299&quot; data-start=&quot;5273&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;5281&quot; data-start=&quot;5273&quot;&gt;Layer&lt;/th&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;5288&quot; data-start=&quot;5281&quot;&gt;File&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;5299&quot; data-start=&quot;5288&quot;&gt;Purpose&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;5754&quot; data-start=&quot;5329&quot;&gt;&lt;tr data-end=&quot;5441&quot; data-start=&quot;5329&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5351&quot; data-start=&quot;5329&quot;&gt;&lt;code data-end=&quot;5350&quot; data-start=&quot;5331&quot;&gt;ProductRepository&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;5405&quot; data-start=&quot;5351&quot;&gt;Extends &lt;code data-end=&quot;5376&quot; data-start=&quot;5361&quot;&gt;JpaRepository&lt;/code&gt; + &lt;code data-end=&quot;5404&quot; data-start=&quot;5379&quot;&gt;CustomProductRepository&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5441&quot; data-start=&quot;5405&quot;&gt;Declares custom + normal methods&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5524&quot; data-start=&quot;5442&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5470&quot; data-start=&quot;5442&quot;&gt;&lt;code data-end=&quot;5469&quot; data-start=&quot;5444&quot;&gt;CustomProductRepository&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;5482&quot; data-start=&quot;5470&quot;&gt;Interface&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5524&quot; data-start=&quot;5482&quot;&gt;Declares signatures for custom methods&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5618&quot; data-start=&quot;5525&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5551&quot; data-start=&quot;5525&quot;&gt;&lt;code data-end=&quot;5550&quot; data-start=&quot;5527&quot;&gt;ProductRepositoryImpl&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;5574&quot; data-start=&quot;5551&quot;&gt;Implementation class&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5618&quot; data-start=&quot;5574&quot;&gt;Implements those custom methods manually&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5682&quot; data-start=&quot;5619&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5631&quot; data-start=&quot;5619&quot;&gt;&lt;code data-end=&quot;5630&quot; data-start=&quot;5621&quot;&gt;Service&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;5653&quot; data-start=&quot;5631&quot;&gt;Uses the repository&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5682&quot; data-start=&quot;5653&quot;&gt;Invokes the custom method&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5754&quot; data-start=&quot;5683&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5698&quot; data-start=&quot;5683&quot;&gt;&lt;code data-end=&quot;5697&quot; data-start=&quot;5685&quot;&gt;Controller&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;5717&quot; data-start=&quot;5698&quot;&gt;Exposes endpoint&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5754&quot; data-start=&quot;5717&quot;&gt;Lets user call the search feature&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;Would you like me to extend this example to show &lt;strong data-end=&quot;5824&quot; data-start=&quot;5810&quot;&gt;pagination&lt;/strong&gt; or &lt;strong data-end=&quot;5839&quot; data-start=&quot;5828&quot;&gt;sorting&lt;/strong&gt; with the same dynamic query (so that large datasets are handled efficiently)?&lt;/div&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;p data-end=&quot;188&quot; data-start=&quot;0&quot;&gt;now you’re diving into &lt;strong data-end=&quot;76&quot; data-start=&quot;44&quot;&gt;real-world repository design&lt;/strong&gt;.&lt;br data-end=&quot;80&quot; data-start=&quot;77&quot; /&gt;
Let’s extend the same &lt;strong data-end=&quot;131&quot; data-start=&quot;102&quot;&gt;custom repository example&lt;/strong&gt; to include &lt;strong data-end=&quot;157&quot; data-start=&quot;143&quot;&gt;pagination&lt;/strong&gt; and &lt;strong data-end=&quot;173&quot; data-start=&quot;162&quot;&gt;sorting&lt;/strong&gt;, step by step.&lt;/p&gt;
&lt;p data-end=&quot;312&quot; data-start=&quot;190&quot;&gt;This is a very common scenario when building production-grade APIs — for example, searching products in an e-commerce app.&lt;/p&gt;
&lt;hr data-end=&quot;317&quot; data-start=&quot;314&quot; /&gt;
&lt;h2 data-end=&quot;366&quot; data-start=&quot;319&quot;&gt;🧩 Step 1: Why Pagination and Sorting Matter&lt;/h2&gt;
&lt;p data-end=&quot;468&quot; data-start=&quot;368&quot;&gt;When your database table has &lt;strong data-end=&quot;433&quot; data-start=&quot;397&quot;&gt;hundreds or thousands of records&lt;/strong&gt;, returning all results at once is:&lt;/p&gt;
&lt;ul data-end=&quot;529&quot; data-start=&quot;469&quot;&gt;
&lt;li data-end=&quot;480&quot; data-start=&quot;469&quot;&gt;
&lt;p data-end=&quot;480&quot; data-start=&quot;471&quot;&gt;❌ slow,&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;500&quot; data-start=&quot;481&quot;&gt;
&lt;p data-end=&quot;500&quot; data-start=&quot;483&quot;&gt;❌ memory-heavy,&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;529&quot; data-start=&quot;501&quot;&gt;
&lt;p data-end=&quot;529&quot; data-start=&quot;503&quot;&gt;❌ and bad for performance.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;654&quot; data-start=&quot;531&quot;&gt;So we use &lt;strong data-end=&quot;555&quot; data-start=&quot;541&quot;&gt;pagination&lt;/strong&gt; (to fetch limited results per page) and &lt;strong data-end=&quot;607&quot; data-start=&quot;596&quot;&gt;sorting&lt;/strong&gt; (to order them by a field like price or name).&lt;/p&gt;
&lt;p data-end=&quot;690&quot; data-start=&quot;656&quot;&gt;Spring Data JPA provides this via:&lt;/p&gt;
&lt;ul data-end=&quot;783&quot; data-start=&quot;691&quot;&gt;
&lt;li data-end=&quot;730&quot; data-start=&quot;691&quot;&gt;
&lt;p data-end=&quot;730&quot; data-start=&quot;693&quot;&gt;&lt;code data-end=&quot;703&quot; data-start=&quot;693&quot;&gt;Pageable&lt;/code&gt; (for pagination + sorting)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;783&quot; data-start=&quot;731&quot;&gt;
&lt;p data-end=&quot;783&quot; data-start=&quot;733&quot;&gt;&lt;code data-end=&quot;742&quot; data-start=&quot;733&quot;&gt;Page&amp;lt;T&amp;gt;&lt;/code&gt; (for the returned results with metadata)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;788&quot; data-start=&quot;785&quot; /&gt;
&lt;h2 data-end=&quot;842&quot; data-start=&quot;790&quot;&gt;🧩 Step 2: Update the Custom Repository Interface&lt;/h2&gt;
&lt;p data-end=&quot;918&quot; data-start=&quot;844&quot;&gt;We now want our method to support &lt;code data-end=&quot;888&quot; data-start=&quot;878&quot;&gt;Pageable&lt;/code&gt; and return a &lt;code data-end=&quot;917&quot; data-start=&quot;902&quot;&gt;Page&amp;lt;Product&amp;gt;&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1267&quot; data-start=&quot;920&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;package&lt;/span&gt; com.bej.products.repository;

&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.model.Product;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Page;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Pageable;

&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;CustomProductRepository&lt;/span&gt; {
    Page&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;findProductsWithDynamicFilter&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(String category, Double minPrice, Double maxPrice, Pageable pageable)&lt;/span&gt;;
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;1272&quot; data-start=&quot;1269&quot; /&gt;
&lt;h2 data-end=&quot;1319&quot; data-start=&quot;1274&quot;&gt;🧩 Step 3: Update the Implementation Class&lt;/h2&gt;
&lt;p data-end=&quot;1390&quot; data-start=&quot;1321&quot;&gt;Now, modify &lt;code data-end=&quot;1356&quot; data-start=&quot;1333&quot;&gt;ProductRepositoryImpl&lt;/code&gt; to handle pagination and sorting.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;4167&quot; data-start=&quot;1392&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;package&lt;/span&gt; com.bej.products.repository;

&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.model.Product;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; jakarta.persistence.EntityManager;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; jakarta.persistence.PersistenceContext;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; jakarta.persistence.TypedQuery;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Page;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.PageImpl;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Pageable;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.stereotype.Repository;

&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; java.util.List;

&lt;span class=&quot;hljs-meta&quot;&gt;@Repository&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;ProductRepositoryImpl&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;implements&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;CustomProductRepository&lt;/span&gt; {

    &lt;span class=&quot;hljs-meta&quot;&gt;@PersistenceContext&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; EntityManager entityManager;

    &lt;span class=&quot;hljs-meta&quot;&gt;@Override&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; Page&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;findProductsWithDynamicFilter&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(String category, Double minPrice, Double maxPrice, Pageable pageable)&lt;/span&gt; {
        &lt;span class=&quot;hljs-type&quot;&gt;StringBuilder&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;jpql&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;StringBuilder&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&quot;SELECT p FROM Product p WHERE 1=1&quot;&lt;/span&gt;);

        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (category != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; !category.isEmpty()) {
            jpql.append(&lt;span class=&quot;hljs-string&quot;&gt;&quot; AND p.category = :category&quot;&lt;/span&gt;);
        }
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (minPrice != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) {
            jpql.append(&lt;span class=&quot;hljs-string&quot;&gt;&quot; AND p.price &amp;gt;= :minPrice&quot;&lt;/span&gt;);
        }
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (maxPrice != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) {
            jpql.append(&lt;span class=&quot;hljs-string&quot;&gt;&quot; AND p.price &amp;lt;= :maxPrice&quot;&lt;/span&gt;);
        }

        &lt;span class=&quot;hljs-comment&quot;&gt;// 🔹 Apply sorting&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (pageable.getSort().isSorted()) {
            jpql.append(&lt;span class=&quot;hljs-string&quot;&gt;&quot; ORDER BY &quot;&lt;/span&gt;);
            jpql.append(pageable.getSort().toString().replace(&lt;span class=&quot;hljs-string&quot;&gt;&quot;:&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;&quot;&lt;/span&gt;)); 
            &lt;span class=&quot;hljs-comment&quot;&gt;// Converts something like &quot;price: ASC&quot; → &quot;price ASC&quot;&lt;/span&gt;
        }

        TypedQuery&amp;lt;Product&amp;gt; query = entityManager.createQuery(jpql.toString(), Product.class);

        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (category != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; !category.isEmpty()) {
            query.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;category&quot;&lt;/span&gt;, category);
        }
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (minPrice != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) {
            query.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;minPrice&quot;&lt;/span&gt;, minPrice);
        }
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (maxPrice != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) {
            query.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;maxPrice&quot;&lt;/span&gt;, maxPrice);
        }

        &lt;span class=&quot;hljs-comment&quot;&gt;// 🔹 Pagination logic: set offset and limit&lt;/span&gt;
        query.setFirstResult((&lt;span class=&quot;hljs-type&quot;&gt;int&lt;/span&gt;) pageable.getOffset());
        query.setMaxResults(pageable.getPageSize());

        &lt;span class=&quot;hljs-comment&quot;&gt;// 🔹 Execute query&lt;/span&gt;
        List&amp;lt;Product&amp;gt; results = query.getResultList();

        &lt;span class=&quot;hljs-comment&quot;&gt;// 🔹 Count total records (for Page metadata)&lt;/span&gt;
        &lt;span class=&quot;hljs-type&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;countQueryStr&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; jpql.toString().replaceFirst(&lt;span class=&quot;hljs-string&quot;&gt;&quot;SELECT p FROM&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;SELECT COUNT(p) FROM&quot;&lt;/span&gt;);
        TypedQuery&amp;lt;Long&amp;gt; countQuery = entityManager.createQuery(countQueryStr, Long.class);

        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (category != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; !category.isEmpty()) {
            countQuery.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;category&quot;&lt;/span&gt;, category);
        }
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (minPrice != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) {
            countQuery.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;minPrice&quot;&lt;/span&gt;, minPrice);
        }
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (maxPrice != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) {
            countQuery.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;maxPrice&quot;&lt;/span&gt;, maxPrice);
        }

        &lt;span class=&quot;hljs-type&quot;&gt;Long&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;total&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; countQuery.getSingleResult();

        &lt;span class=&quot;hljs-comment&quot;&gt;// 🔹 Return as Page object&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;PageImpl&lt;/span&gt;&amp;lt;&amp;gt;(results, pageable, total);
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;4172&quot; data-start=&quot;4169&quot; /&gt;
&lt;h2 data-end=&quot;4213&quot; data-start=&quot;4174&quot;&gt;🧠 Step 4: How This Works Internally&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;4592&quot; data-start=&quot;4215&quot;&gt;&lt;thead data-end=&quot;4235&quot; data-start=&quot;4215&quot;&gt;&lt;tr data-end=&quot;4235&quot; data-start=&quot;4215&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;4222&quot; data-start=&quot;4215&quot;&gt;Step&lt;/th&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;4235&quot; data-start=&quot;4222&quot;&gt;Operation&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;4592&quot; data-start=&quot;4258&quot;&gt;&lt;tr data-end=&quot;4310&quot; data-start=&quot;4258&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4264&quot; data-start=&quot;4258&quot;&gt;1️⃣&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;4310&quot; data-start=&quot;4264&quot;&gt;Dynamically builds JPQL query with filters&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4359&quot; data-start=&quot;4311&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4317&quot; data-start=&quot;4311&quot;&gt;2️⃣&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;4359&quot; data-start=&quot;4317&quot;&gt;Adds &lt;code data-end=&quot;4334&quot; data-start=&quot;4324&quot;&gt;ORDER BY&lt;/code&gt; if sorting is provided&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4433&quot; data-start=&quot;4360&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4366&quot; data-start=&quot;4360&quot;&gt;3️⃣&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;4433&quot; data-start=&quot;4366&quot;&gt;Applies pagination via &lt;code data-end=&quot;4409&quot; data-start=&quot;4391&quot;&gt;setFirstResult()&lt;/code&gt; and &lt;code data-end=&quot;4431&quot; data-start=&quot;4414&quot;&gt;setMaxResults()&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4477&quot; data-start=&quot;4434&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4440&quot; data-start=&quot;4434&quot;&gt;4️⃣&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;4477&quot; data-start=&quot;4440&quot;&gt;Executes main query to fetch data&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4529&quot; data-start=&quot;4478&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4484&quot; data-start=&quot;4478&quot;&gt;5️⃣&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;4529&quot; data-start=&quot;4484&quot;&gt;Executes count query to get total records&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4592&quot; data-start=&quot;4530&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4536&quot; data-start=&quot;4530&quot;&gt;6️⃣&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;4592&quot; data-start=&quot;4536&quot;&gt;Wraps everything inside a &lt;code data-end=&quot;4583&quot; data-start=&quot;4564&quot;&gt;PageImpl&amp;lt;Product&amp;gt;&lt;/code&gt; object&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p data-end=&quot;4642&quot; data-start=&quot;4594&quot;&gt;So you get a proper Spring &lt;code data-end=&quot;4636&quot; data-start=&quot;4621&quot;&gt;Page&amp;lt;Product&amp;gt;&lt;/code&gt; with:&lt;/p&gt;
&lt;ul data-end=&quot;4718&quot; data-start=&quot;4643&quot;&gt;
&lt;li data-end=&quot;4666&quot; data-start=&quot;4643&quot;&gt;
&lt;p data-end=&quot;4666&quot; data-start=&quot;4645&quot;&gt;current page content,&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4691&quot; data-start=&quot;4667&quot;&gt;
&lt;p data-end=&quot;4691&quot; data-start=&quot;4669&quot;&gt;total number of items,&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4706&quot; data-start=&quot;4692&quot;&gt;
&lt;p data-end=&quot;4706&quot; data-start=&quot;4694&quot;&gt;total pages,&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4718&quot; data-start=&quot;4707&quot;&gt;
&lt;p data-end=&quot;4718&quot; data-start=&quot;4709&quot;&gt;and more.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;4723&quot; data-start=&quot;4720&quot; /&gt;
&lt;h2 data-end=&quot;4763&quot; data-start=&quot;4725&quot;&gt;🧩 Step 5: Modify the Service Layer&lt;/h2&gt;
&lt;p data-end=&quot;4833&quot; data-start=&quot;4765&quot;&gt;Now your service can directly use pagination and sorting parameters.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;5559&quot; data-start=&quot;4835&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;package&lt;/span&gt; com.bej.products.service;

&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.model.Product;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.repository.ProductRepository;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Page;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Pageable;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.stereotype.Service;

&lt;span class=&quot;hljs-meta&quot;&gt;@Service&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;ProductService&lt;/span&gt; {
    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;final&lt;/span&gt; ProductRepository productRepository;

    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-title function_&quot;&gt;ProductService&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(ProductRepository productRepository)&lt;/span&gt; {
        &lt;span class=&quot;hljs-built_in&quot;&gt;this&lt;/span&gt;.productRepository = productRepository;
    }

    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; Page&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;searchProducts&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(String category, Double minPrice, Double maxPrice, Pageable pageable)&lt;/span&gt; {
        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; productRepository.findProductsWithDynamicFilter(category, minPrice, maxPrice, pageable);
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;5564&quot; data-start=&quot;5561&quot; /&gt;
&lt;h2 data-end=&quot;5634&quot; data-start=&quot;5566&quot;&gt;🧩 Step 6: Update the Controller to Accept Pagination and Sorting&lt;/h2&gt;
&lt;p data-end=&quot;5743&quot; data-start=&quot;5636&quot;&gt;Spring makes it easy to handle pagination and sorting through query parameters like &lt;code data-end=&quot;5726&quot; data-start=&quot;5720&quot;&gt;page&lt;/code&gt;, &lt;code data-end=&quot;5734&quot; data-start=&quot;5728&quot;&gt;size&lt;/code&gt;, &lt;code data-end=&quot;5742&quot; data-start=&quot;5736&quot;&gt;sort&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;6882&quot; data-start=&quot;5745&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;package&lt;/span&gt; com.bej.products.controller;

&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.model.Product;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.service.ProductService;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Page;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Pageable;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.web.PageableDefault;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.http.ResponseEntity;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.web.bind.annotation.*;

&lt;span class=&quot;hljs-meta&quot;&gt;@RestController&lt;/span&gt;
&lt;span class=&quot;hljs-meta&quot;&gt;@RequestMapping(&quot;/products&quot;)&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;ProductController&lt;/span&gt; {

    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;final&lt;/span&gt; ProductService productService;
    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-title function_&quot;&gt;ProductController&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(ProductService productService)&lt;/span&gt; {
        &lt;span class=&quot;hljs-built_in&quot;&gt;this&lt;/span&gt;.productService = productService;
    }

    &lt;span class=&quot;hljs-meta&quot;&gt;@GetMapping(&quot;/search&quot;)&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; ResponseEntity&amp;lt;Page&amp;lt;Product&amp;gt;&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;searchProducts&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(
            &lt;/span&gt;&lt;span class=&quot;hljs-meta&quot;&gt;@RequestParam(required = false)&lt;/span&gt; String category,
            &lt;span class=&quot;hljs-meta&quot;&gt;@RequestParam(required = false)&lt;/span&gt; Double minPrice,
            &lt;span class=&quot;hljs-meta&quot;&gt;@RequestParam(required = false)&lt;/span&gt; Double maxPrice,
            &lt;span class=&quot;hljs-meta&quot;&gt;@PageableDefault(page = 0, size = 5, sort = &quot;price&quot;)&lt;/span&gt; Pageable pageable
    ) {
        Page&amp;lt;Product&amp;gt; results = productService.searchProducts(category, minPrice, maxPrice, pageable);
        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; ResponseEntity.ok(results);
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;6887&quot; data-start=&quot;6884&quot; /&gt;
&lt;h2 data-end=&quot;6920&quot; data-start=&quot;6889&quot;&gt;🧩 Step 7: Example API Calls&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;7272&quot; data-start=&quot;6922&quot;&gt;&lt;thead data-end=&quot;6955&quot; data-start=&quot;6922&quot;&gt;&lt;tr data-end=&quot;6955&quot; data-start=&quot;6922&quot;&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;6940&quot; data-start=&quot;6922&quot;&gt;Example Request&lt;/th&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;6955&quot; data-start=&quot;6940&quot;&gt;Description&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;7272&quot; data-start=&quot;6992&quot;&gt;&lt;tr data-end=&quot;7051&quot; data-start=&quot;6992&quot;&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;7027&quot; data-start=&quot;6992&quot;&gt;&lt;code data-end=&quot;7026&quot; data-start=&quot;6994&quot;&gt;/products/search?page=0&amp;amp;size=5&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;7051&quot; data-start=&quot;7027&quot;&gt;Get first 5 products&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;7149&quot; data-start=&quot;7052&quot;&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;7109&quot; data-start=&quot;7052&quot;&gt;&lt;code data-end=&quot;7108&quot; data-start=&quot;7054&quot;&gt;/products/search?category=Electronics&amp;amp;page=1&amp;amp;size=10&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;7149&quot; data-start=&quot;7109&quot;&gt;10 products from Electronics, page 2&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;7272&quot; data-start=&quot;7150&quot;&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;7214&quot; data-start=&quot;7150&quot;&gt;&lt;code data-end=&quot;7213&quot; data-start=&quot;7152&quot;&gt;/products/search?minPrice=500&amp;amp;maxPrice=2000&amp;amp;sort=price,desc&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;7272&quot; data-start=&quot;7214&quot;&gt;Products between ₹500–₹2000 sorted by descending price&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;7277&quot; data-start=&quot;7274&quot; /&gt;
&lt;h2 data-end=&quot;7314&quot; data-start=&quot;7279&quot;&gt;🧾 Step 8: Example JSON Response&lt;/h2&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;7722&quot; data-start=&quot;7316&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-json&quot;&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;content&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-punctuation&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;hljs-punctuation&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;P102&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;Smartphone&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;price&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;899.0&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;Electronics&quot;&lt;/span&gt;
    &lt;span class=&quot;hljs-punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;hljs-punctuation&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;P103&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;Bluetooth Speaker&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;price&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;750.0&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;Electronics&quot;&lt;/span&gt;
    &lt;span class=&quot;hljs-punctuation&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;hljs-punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;pageable&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;hljs-attr&quot;&gt;&quot;pageNumber&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;hljs-attr&quot;&gt;&quot;pageSize&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;hljs-attr&quot;&gt;&quot;offset&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;
  &lt;span class=&quot;hljs-punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;totalElements&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;totalPages&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;last&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;false&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;hljs-punctuation&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;7727&quot; data-start=&quot;7724&quot; /&gt;
&lt;h2 data-end=&quot;7787&quot; data-start=&quot;7729&quot;&gt;✅ Summary — Custom Repository with Pagination + Sorting&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;8146&quot; data-start=&quot;7789&quot;&gt;&lt;thead data-end=&quot;7817&quot; data-start=&quot;7789&quot;&gt;&lt;tr data-end=&quot;7817&quot; data-start=&quot;7789&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;7799&quot; data-start=&quot;7789&quot;&gt;Feature&lt;/th&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;7817&quot; data-start=&quot;7799&quot;&gt;Technique Used&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;8146&quot; data-start=&quot;7848&quot;&gt;&lt;tr data-end=&quot;7909&quot; data-start=&quot;7848&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;7866&quot; data-start=&quot;7848&quot;&gt;Dynamic filters&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;7909&quot; data-start=&quot;7866&quot;&gt;Custom JPQL query using &lt;code data-end=&quot;7907&quot; data-start=&quot;7892&quot;&gt;StringBuilder&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;7971&quot; data-start=&quot;7910&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;7923&quot; data-start=&quot;7910&quot;&gt;Pagination&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;7971&quot; data-start=&quot;7923&quot;&gt;&lt;code data-end=&quot;7949&quot; data-start=&quot;7925&quot;&gt;query.setFirstResult()&lt;/code&gt; + &lt;code data-end=&quot;7969&quot; data-start=&quot;7952&quot;&gt;setMaxResults()&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;8022&quot; data-start=&quot;7972&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;7982&quot; data-start=&quot;7972&quot;&gt;Sorting&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;8022&quot; data-start=&quot;7982&quot;&gt;&lt;code data-end=&quot;7994&quot; data-start=&quot;7984&quot;&gt;ORDER BY&lt;/code&gt; from &lt;code data-end=&quot;8020&quot; data-start=&quot;8000&quot;&gt;pageable.getSort()&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;8081&quot; data-start=&quot;8023&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;8039&quot; data-start=&quot;8023&quot;&gt;Page metadata&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;8081&quot; data-start=&quot;8039&quot;&gt;&lt;code data-end=&quot;8079&quot; data-start=&quot;8041&quot;&gt;PageImpl&amp;lt;&amp;gt;(results, pageable, total)&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;8146&quot; data-start=&quot;8082&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;8096&quot; data-start=&quot;8082&quot;&gt;Integration&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;8146&quot; data-start=&quot;8096&quot;&gt;Works seamlessly with Spring Data’s &lt;code data-end=&quot;8144&quot; data-start=&quot;8134&quot;&gt;Pageable&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;p data-end=&quot;241&quot; data-start=&quot;0&quot;&gt;you’re now moving into &lt;strong data-end=&quot;81&quot; data-start=&quot;44&quot;&gt;advanced repository customization&lt;/strong&gt;, where we’ll add &lt;strong data-end=&quot;129&quot; data-start=&quot;99&quot;&gt;multi-field keyword search&lt;/strong&gt; (like “search by name, category, or description”) — just like real-world e-commerce or article search features.&lt;/p&gt;
&lt;p data-end=&quot;297&quot; data-start=&quot;243&quot;&gt;Let’s go step-by-step again so it’s crystal clear 👇&lt;/p&gt;
&lt;hr data-end=&quot;302&quot; data-start=&quot;299&quot; /&gt;
&lt;h2 data-end=&quot;337&quot; data-start=&quot;304&quot;&gt;🧩 Step 1: What We’re Building&lt;/h2&gt;
&lt;p data-end=&quot;405&quot; data-start=&quot;339&quot;&gt;We want a method that allows &lt;strong data-end=&quot;404&quot; data-start=&quot;368&quot;&gt;flexible keyword-based searching&lt;/strong&gt;:&lt;/p&gt;
&lt;p data-end=&quot;427&quot; data-start=&quot;407&quot;&gt;👉 Example searches:&lt;/p&gt;
&lt;ul data-end=&quot;623&quot; data-start=&quot;428&quot;&gt;
&lt;li data-end=&quot;499&quot; data-start=&quot;428&quot;&gt;
&lt;p data-end=&quot;499&quot; data-start=&quot;430&quot;&gt;&lt;code data-end=&quot;439&quot; data-start=&quot;430&quot;&gt;&quot;phone&quot;&lt;/code&gt; → matches products with &lt;code data-end=&quot;473&quot; data-start=&quot;464&quot;&gt;&quot;phone&quot;&lt;/code&gt; in name or description.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;555&quot; data-start=&quot;500&quot;&gt;
&lt;p data-end=&quot;555&quot; data-start=&quot;502&quot;&gt;&lt;code data-end=&quot;517&quot; data-start=&quot;502&quot;&gt;&quot;electronics&quot;&lt;/code&gt; → matches category &lt;code data-end=&quot;552&quot; data-start=&quot;537&quot;&gt;&quot;Electronics&quot;&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;623&quot; data-start=&quot;556&quot;&gt;
&lt;p data-end=&quot;623&quot; data-start=&quot;558&quot;&gt;&lt;code data-end=&quot;569&quot; data-start=&quot;558&quot;&gt;&quot;speaker&quot;&lt;/code&gt; → matches &lt;code data-end=&quot;601&quot; data-start=&quot;580&quot;&gt;&quot;Bluetooth Speaker&quot;&lt;/code&gt; even if only in part.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;736&quot; data-start=&quot;625&quot;&gt;We’ll combine this with our &lt;strong data-end=&quot;672&quot; data-start=&quot;653&quot;&gt;dynamic filters&lt;/strong&gt;, &lt;strong data-end=&quot;688&quot; data-start=&quot;674&quot;&gt;pagination&lt;/strong&gt;, and &lt;strong data-end=&quot;705&quot; data-start=&quot;694&quot;&gt;sorting&lt;/strong&gt; — all in one powerful query.&lt;/p&gt;
&lt;hr data-end=&quot;741&quot; data-start=&quot;738&quot; /&gt;
&lt;h2 data-end=&quot;795&quot; data-start=&quot;743&quot;&gt;🧩 Step 2: Update the Custom Repository Interface&lt;/h2&gt;
&lt;p data-end=&quot;843&quot; data-start=&quot;797&quot;&gt;Add a new method for &lt;strong data-end=&quot;842&quot; data-start=&quot;818&quot;&gt;keyword-based search&lt;/strong&gt;:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1306&quot; data-start=&quot;845&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;package&lt;/span&gt; com.bej.products.repository;

&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.model.Product;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Page;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Pageable;

&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;CustomProductRepository&lt;/span&gt; {
    Page&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;findProductsWithDynamicFilter&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(String category, Double minPrice, Double maxPrice, Pageable pageable)&lt;/span&gt;;

    &lt;span class=&quot;hljs-comment&quot;&gt;// 🔹 New keyword-based search&lt;/span&gt;
    Page&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;searchProductsByKeyword&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(String keyword, Pageable pageable)&lt;/span&gt;;
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;1311&quot; data-start=&quot;1308&quot; /&gt;
&lt;h2 data-end=&quot;1373&quot; data-start=&quot;1313&quot;&gt;🧩 Step 3: Implement the Keyword Search in the Impl Class&lt;/h2&gt;
&lt;p data-end=&quot;1435&quot; data-start=&quot;1375&quot;&gt;Now, implement it inside your &lt;code data-end=&quot;1428&quot; data-start=&quot;1405&quot;&gt;ProductRepositoryImpl&lt;/code&gt; class.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;5209&quot; data-start=&quot;1437&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;package&lt;/span&gt; com.bej.products.repository;

&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.model.Product;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; jakarta.persistence.EntityManager;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; jakarta.persistence.PersistenceContext;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; jakarta.persistence.TypedQuery;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Page;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.PageImpl;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Pageable;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.stereotype.Repository;

&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; java.util.List;

&lt;span class=&quot;hljs-meta&quot;&gt;@Repository&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;ProductRepositoryImpl&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;implements&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;CustomProductRepository&lt;/span&gt; {

    &lt;span class=&quot;hljs-meta&quot;&gt;@PersistenceContext&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; EntityManager entityManager;

    &lt;span class=&quot;hljs-comment&quot;&gt;// Existing method&lt;/span&gt;
    &lt;span class=&quot;hljs-meta&quot;&gt;@Override&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; Page&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;findProductsWithDynamicFilter&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(String category, Double minPrice, Double maxPrice, Pageable pageable)&lt;/span&gt; {
        &lt;span class=&quot;hljs-type&quot;&gt;StringBuilder&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;jpql&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;StringBuilder&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&quot;SELECT p FROM Product p WHERE 1=1&quot;&lt;/span&gt;);

        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (category != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; !category.isEmpty()) {
            jpql.append(&lt;span class=&quot;hljs-string&quot;&gt;&quot; AND p.category = :category&quot;&lt;/span&gt;);
        }
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (minPrice != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) {
            jpql.append(&lt;span class=&quot;hljs-string&quot;&gt;&quot; AND p.price &amp;gt;= :minPrice&quot;&lt;/span&gt;);
        }
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (maxPrice != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) {
            jpql.append(&lt;span class=&quot;hljs-string&quot;&gt;&quot; AND p.price &amp;lt;= :maxPrice&quot;&lt;/span&gt;);
        }

        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (pageable.getSort().isSorted()) {
            jpql.append(&lt;span class=&quot;hljs-string&quot;&gt;&quot; ORDER BY &quot;&lt;/span&gt;).append(pageable.getSort().toString().replace(&lt;span class=&quot;hljs-string&quot;&gt;&quot;:&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;&quot;&lt;/span&gt;));
        }

        TypedQuery&amp;lt;Product&amp;gt; query = entityManager.createQuery(jpql.toString(), Product.class);

        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (category != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; !category.isEmpty()) query.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;category&quot;&lt;/span&gt;, category);
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (minPrice != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) query.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;minPrice&quot;&lt;/span&gt;, minPrice);
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (maxPrice != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) query.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;maxPrice&quot;&lt;/span&gt;, maxPrice);

        query.setFirstResult((&lt;span class=&quot;hljs-type&quot;&gt;int&lt;/span&gt;) pageable.getOffset());
        query.setMaxResults(pageable.getPageSize());

        List&amp;lt;Product&amp;gt; results = query.getResultList();

        &lt;span class=&quot;hljs-type&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;countQueryStr&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; jpql.toString().replaceFirst(&lt;span class=&quot;hljs-string&quot;&gt;&quot;SELECT p FROM&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;SELECT COUNT(p) FROM&quot;&lt;/span&gt;);
        TypedQuery&amp;lt;Long&amp;gt; countQuery = entityManager.createQuery(countQueryStr, Long.class);

        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (category != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; !category.isEmpty()) countQuery.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;category&quot;&lt;/span&gt;, category);
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (minPrice != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) countQuery.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;minPrice&quot;&lt;/span&gt;, minPrice);
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (maxPrice != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) countQuery.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;maxPrice&quot;&lt;/span&gt;, maxPrice);

        &lt;span class=&quot;hljs-type&quot;&gt;Long&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;total&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; countQuery.getSingleResult();
        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;PageImpl&lt;/span&gt;&amp;lt;&amp;gt;(results, pageable, total);
    }

    &lt;span class=&quot;hljs-comment&quot;&gt;// 🔹 New: Multi-field keyword search&lt;/span&gt;
    &lt;span class=&quot;hljs-meta&quot;&gt;@Override&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; Page&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;searchProductsByKeyword&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(String keyword, Pageable pageable)&lt;/span&gt; {
        &lt;span class=&quot;hljs-type&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;jpql&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;&quot;&quot;
                SELECT p FROM Product p 
                WHERE LOWER(p.name) LIKE LOWER(CONCAT(&#39;%&#39;, :keyword, &#39;%&#39;))
                   OR LOWER(p.category) LIKE LOWER(CONCAT(&#39;%&#39;, :keyword, &#39;%&#39;))
                   OR LOWER(p.description) LIKE LOWER(CONCAT(&#39;%&#39;, :keyword, &#39;%&#39;))
                &quot;&quot;&quot;&lt;/span&gt;;

        TypedQuery&amp;lt;Product&amp;gt; query = entityManager.createQuery(jpql, Product.class);
        query.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;keyword&quot;&lt;/span&gt;, keyword);

        query.setFirstResult((&lt;span class=&quot;hljs-type&quot;&gt;int&lt;/span&gt;) pageable.getOffset());
        query.setMaxResults(pageable.getPageSize());

        List&amp;lt;Product&amp;gt; results = query.getResultList();

        &lt;span class=&quot;hljs-comment&quot;&gt;// 🔹 Count query for pagination&lt;/span&gt;
        &lt;span class=&quot;hljs-type&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;countJpql&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;&quot;&quot;
                SELECT COUNT(p) FROM Product p
                WHERE LOWER(p.name) LIKE LOWER(CONCAT(&#39;%&#39;, :keyword, &#39;%&#39;))
                   OR LOWER(p.category) LIKE LOWER(CONCAT(&#39;%&#39;, :keyword, &#39;%&#39;))
                   OR LOWER(p.description) LIKE LOWER(CONCAT(&#39;%&#39;, :keyword, &#39;%&#39;))
                &quot;&quot;&quot;&lt;/span&gt;;

        TypedQuery&amp;lt;Long&amp;gt; countQuery = entityManager.createQuery(countJpql, Long.class);
        countQuery.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;keyword&quot;&lt;/span&gt;, keyword);

        &lt;span class=&quot;hljs-type&quot;&gt;Long&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;total&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; countQuery.getSingleResult();

        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;PageImpl&lt;/span&gt;&amp;lt;&amp;gt;(results, pageable, total);
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;5214&quot; data-start=&quot;5211&quot; /&gt;
&lt;h2 data-end=&quot;5258&quot; data-start=&quot;5216&quot;&gt;🧠 Step 4: How the Keyword Search Works&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;5618&quot; data-start=&quot;5260&quot;&gt;&lt;thead data-end=&quot;5285&quot; data-start=&quot;5260&quot;&gt;&lt;tr data-end=&quot;5285&quot; data-start=&quot;5260&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;5270&quot; data-start=&quot;5260&quot;&gt;Feature&lt;/th&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;5285&quot; data-start=&quot;5270&quot;&gt;Explanation&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;5618&quot; data-start=&quot;5313&quot;&gt;&lt;tr data-end=&quot;5362&quot; data-start=&quot;5313&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5325&quot; data-start=&quot;5313&quot;&gt;&lt;code data-end=&quot;5324&quot; data-start=&quot;5315&quot;&gt;LOWER()&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;5362&quot; data-start=&quot;5325&quot;&gt;Makes the search case-insensitive&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5435&quot; data-start=&quot;5363&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5399&quot; data-start=&quot;5363&quot;&gt;&lt;code data-end=&quot;5398&quot; data-start=&quot;5365&quot;&gt;LIKE CONCAT(&#39;%&#39;, :keyword, &#39;%&#39;)&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;5435&quot; data-start=&quot;5399&quot;&gt;Matches anywhere inside the text&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5501&quot; data-start=&quot;5436&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5450&quot; data-start=&quot;5436&quot;&gt;Multi-field&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;5501&quot; data-start=&quot;5450&quot;&gt;Searches across name, category, and description&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5555&quot; data-start=&quot;5502&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5515&quot; data-start=&quot;5502&quot;&gt;Pagination&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;5555&quot; data-start=&quot;5515&quot;&gt;Uses offset and limit via &lt;code data-end=&quot;5553&quot; data-start=&quot;5543&quot;&gt;Pageable&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5618&quot; data-start=&quot;5556&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5570&quot; data-start=&quot;5556&quot;&gt;Count query&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;5618&quot; data-start=&quot;5570&quot;&gt;Ensures total count for proper &lt;code data-end=&quot;5609&quot; data-start=&quot;5603&quot;&gt;Page&lt;/code&gt; object&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p data-end=&quot;5660&quot; data-start=&quot;5620&quot;&gt;So, if you search &lt;code data-end=&quot;5647&quot; data-start=&quot;5638&quot;&gt;&quot;phone&quot;&lt;/code&gt;, it matches:&lt;/p&gt;
&lt;ul data-end=&quot;5764&quot; data-start=&quot;5661&quot;&gt;
&lt;li data-end=&quot;5684&quot; data-start=&quot;5661&quot;&gt;
&lt;p data-end=&quot;5684&quot; data-start=&quot;5663&quot;&gt;&lt;code data-end=&quot;5677&quot; data-start=&quot;5663&quot;&gt;&quot;Smartphone&quot;&lt;/code&gt; (name)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5715&quot; data-start=&quot;5685&quot;&gt;
&lt;p data-end=&quot;5715&quot; data-start=&quot;5687&quot;&gt;&lt;code data-end=&quot;5704&quot; data-start=&quot;5687&quot;&gt;&quot;Mobile Phones&quot;&lt;/code&gt; (category)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5764&quot; data-start=&quot;5716&quot;&gt;
&lt;p data-end=&quot;5764&quot; data-start=&quot;5718&quot;&gt;&lt;code data-end=&quot;5750&quot; data-start=&quot;5718&quot;&gt;&quot;This phone has a 64MP camera&quot;&lt;/code&gt; (description)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;5769&quot; data-start=&quot;5766&quot; /&gt;
&lt;h2 data-end=&quot;5798&quot; data-start=&quot;5771&quot;&gt;🧩 Step 5: Service Layer&lt;/h2&gt;
&lt;p data-end=&quot;5832&quot; data-start=&quot;5800&quot;&gt;Add a method for keyword search.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;6505&quot; data-start=&quot;5834&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;package&lt;/span&gt; com.bej.products.service;

&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.model.Product;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.repository.ProductRepository;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Page;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Pageable;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.stereotype.Service;

&lt;span class=&quot;hljs-meta&quot;&gt;@Service&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;ProductService&lt;/span&gt; {
    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;final&lt;/span&gt; ProductRepository productRepository;

    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-title function_&quot;&gt;ProductService&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(ProductRepository productRepository)&lt;/span&gt; {
        &lt;span class=&quot;hljs-built_in&quot;&gt;this&lt;/span&gt;.productRepository = productRepository;
    }

    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; Page&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;searchProductsByKeyword&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(String keyword, Pageable pageable)&lt;/span&gt; {
        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; productRepository.searchProductsByKeyword(keyword, pageable);
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;6510&quot; data-start=&quot;6507&quot; /&gt;
&lt;h2 data-end=&quot;6542&quot; data-start=&quot;6512&quot;&gt;🧩 Step 6: Controller Layer&lt;/h2&gt;
&lt;p data-end=&quot;6585&quot; data-start=&quot;6544&quot;&gt;Expose a new endpoint for keyword search:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;7579&quot; data-start=&quot;6587&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;package&lt;/span&gt; com.bej.products.controller;

&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.model.Product;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.service.ProductService;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Page;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Pageable;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.web.PageableDefault;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.http.ResponseEntity;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.web.bind.annotation.*;

&lt;span class=&quot;hljs-meta&quot;&gt;@RestController&lt;/span&gt;
&lt;span class=&quot;hljs-meta&quot;&gt;@RequestMapping(&quot;/products&quot;)&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;ProductController&lt;/span&gt; {

    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;final&lt;/span&gt; ProductService productService;
    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-title function_&quot;&gt;ProductController&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(ProductService productService)&lt;/span&gt; {
        &lt;span class=&quot;hljs-built_in&quot;&gt;this&lt;/span&gt;.productService = productService;
    }

    &lt;span class=&quot;hljs-meta&quot;&gt;@GetMapping(&quot;/keyword-search&quot;)&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; ResponseEntity&amp;lt;Page&amp;lt;Product&amp;gt;&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;searchByKeyword&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(
            &lt;/span&gt;&lt;span class=&quot;hljs-meta&quot;&gt;@RequestParam&lt;/span&gt; String keyword,
            &lt;span class=&quot;hljs-meta&quot;&gt;@PageableDefault(page = 0, size = 5, sort = &quot;name&quot;)&lt;/span&gt; Pageable pageable
    ) {
        Page&amp;lt;Product&amp;gt; results = productService.searchProductsByKeyword(keyword, pageable);
        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; ResponseEntity.ok(results);
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;7584&quot; data-start=&quot;7581&quot; /&gt;
&lt;h2 data-end=&quot;7617&quot; data-start=&quot;7586&quot;&gt;🧩 Step 7: Example API Calls&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;7937&quot; data-start=&quot;7619&quot;&gt;&lt;thead data-end=&quot;7644&quot; data-start=&quot;7619&quot;&gt;&lt;tr data-end=&quot;7644&quot; data-start=&quot;7619&quot;&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;7629&quot; data-start=&quot;7619&quot;&gt;Example&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;7644&quot; data-start=&quot;7629&quot;&gt;Description&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;7937&quot; data-start=&quot;7673&quot;&gt;&lt;tr data-end=&quot;7759&quot; data-start=&quot;7673&quot;&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;7716&quot; data-start=&quot;7673&quot;&gt;&lt;code data-end=&quot;7715&quot; data-start=&quot;7675&quot;&gt;/products/keyword-search?keyword=phone&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;7759&quot; data-start=&quot;7716&quot;&gt;Search across name/category/description&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;7838&quot; data-start=&quot;7760&quot;&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;7818&quot; data-start=&quot;7760&quot;&gt;&lt;code data-end=&quot;7817&quot; data-start=&quot;7762&quot;&gt;/products/keyword-search?keyword=mobile&amp;amp;page=1&amp;amp;size=5&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;7838&quot; data-start=&quot;7818&quot;&gt;Paginated search&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;7937&quot; data-start=&quot;7839&quot;&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;7900&quot; data-start=&quot;7839&quot;&gt;&lt;code data-end=&quot;7899&quot; data-start=&quot;7841&quot;&gt;/products/keyword-search?keyword=speaker&amp;amp;sort=price,desc&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;7937&quot; data-start=&quot;7900&quot;&gt;Search + sort by descending price&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;7942&quot; data-start=&quot;7939&quot; /&gt;
&lt;h2 data-end=&quot;7969&quot; data-start=&quot;7944&quot;&gt;🧾 Example JSON Output&lt;/h2&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;8500&quot; data-start=&quot;7971&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-json&quot;&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;content&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-punctuation&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;hljs-punctuation&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;P105&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;Bluetooth Speaker&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;Electronics&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;price&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;750.0&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;description&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;Portable speaker with deep bass and clear sound&quot;&lt;/span&gt;
    &lt;span class=&quot;hljs-punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;hljs-punctuation&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;P102&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;Smartphone&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;Electronics&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;price&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;999.0&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;description&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;High-performance smartphone with 64MP camera&quot;&lt;/span&gt;
    &lt;span class=&quot;hljs-punctuation&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;hljs-punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;pageable&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;hljs-attr&quot;&gt;&quot;pageNumber&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;hljs-attr&quot;&gt;&quot;pageSize&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;hljs-attr&quot;&gt;&quot;offset&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;
  &lt;span class=&quot;hljs-punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;totalElements&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;totalPages&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;hljs-punctuation&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;8505&quot; data-start=&quot;8502&quot; /&gt;
&lt;h2 data-end=&quot;8528&quot; data-start=&quot;8507&quot;&gt;🧭 Step 8: Summary&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;8916&quot; data-start=&quot;8530&quot;&gt;&lt;thead data-end=&quot;8555&quot; data-start=&quot;8530&quot;&gt;&lt;tr data-end=&quot;8555&quot; data-start=&quot;8530&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;8540&quot; data-start=&quot;8530&quot;&gt;Feature&lt;/th&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;8555&quot; data-start=&quot;8540&quot;&gt;Description&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;8916&quot; data-start=&quot;8584&quot;&gt;&lt;tr data-end=&quot;8669&quot; data-start=&quot;8584&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;8601&quot; data-start=&quot;8584&quot;&gt;Keyword Search&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;8669&quot; data-start=&quot;8601&quot;&gt;Works across multiple fields (&lt;code data-end=&quot;8639&quot; data-start=&quot;8633&quot;&gt;name&lt;/code&gt;, &lt;code data-end=&quot;8651&quot; data-start=&quot;8641&quot;&gt;category&lt;/code&gt;, &lt;code data-end=&quot;8666&quot; data-start=&quot;8653&quot;&gt;description&lt;/code&gt;)&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;8707&quot; data-start=&quot;8670&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;8689&quot; data-start=&quot;8670&quot;&gt;Case-Insensitive&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;8707&quot; data-start=&quot;8689&quot;&gt;Uses &lt;code data-end=&quot;8705&quot; data-start=&quot;8696&quot;&gt;LOWER()&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;8740&quot; data-start=&quot;8708&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;8721&quot; data-start=&quot;8708&quot;&gt;Pagination&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;8740&quot; data-start=&quot;8721&quot;&gt;Uses &lt;code data-end=&quot;8738&quot; data-start=&quot;8728&quot;&gt;Pageable&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;8801&quot; data-start=&quot;8741&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;8751&quot; data-start=&quot;8741&quot;&gt;Sorting&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;8801&quot; data-start=&quot;8751&quot;&gt;Can sort by any field (e.g. &lt;code data-end=&quot;8798&quot; data-start=&quot;8781&quot;&gt;sort=price,desc&lt;/code&gt;)&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;8856&quot; data-start=&quot;8802&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;8814&quot; data-start=&quot;8802&quot;&gt;Efficient&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;8856&quot; data-start=&quot;8814&quot;&gt;Executes count query for total results&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;8916&quot; data-start=&quot;8857&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;8868&quot; data-start=&quot;8857&quot;&gt;Flexible&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;8916&quot; data-start=&quot;8868&quot;&gt;Can combine with filters in future if needed&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;Would you like me to show you how to &lt;strong data-end=&quot;9027&quot; data-start=&quot;8960&quot;&gt;combine keyword search + filters (category, minPrice, maxPrice)&lt;/strong&gt; into one &lt;strong data-end=&quot;9070&quot; data-start=&quot;9037&quot;&gt;single flexible search method&lt;/strong&gt; (so the API supports both keyword and filters in one call)?&lt;br data-end=&quot;9133&quot; data-start=&quot;9130&quot; /&gt;
That’s the ultimate version — like Amazon-style search filtering.&lt;/div&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;b&gt;Would you like me to show you how to &lt;span data-end=&quot;9027&quot; data-start=&quot;8960&quot;&gt;combine keyword search + filters (category, minPrice, maxPrice)&lt;/span&gt; into one &lt;span data-end=&quot;9070&quot; data-start=&quot;9037&quot;&gt;single flexible search method&lt;/span&gt; (so the API supports both keyword and filters in one call)?&lt;br data-end=&quot;9133&quot; data-start=&quot;9130&quot; /&gt;
That’s the ultimate version — like Amazon-style search filtering.&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;p data-end=&quot;174&quot; data-start=&quot;0&quot;&gt;now you’re about to learn the &lt;strong data-end=&quot;73&quot; data-start=&quot;53&quot;&gt;ultimate version&lt;/strong&gt; of a custom repository search system — the &lt;strong data-end=&quot;148&quot; data-start=&quot;117&quot;&gt;Amazon-style dynamic search&lt;/strong&gt;, where you can combine:&lt;/p&gt;
&lt;ul data-end=&quot;288&quot; data-start=&quot;176&quot;&gt;
&lt;li data-end=&quot;210&quot; data-start=&quot;176&quot;&gt;
&lt;p data-end=&quot;210&quot; data-start=&quot;178&quot;&gt;✅ keyword search (multi-field)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;232&quot; data-start=&quot;211&quot;&gt;
&lt;p data-end=&quot;232&quot; data-start=&quot;213&quot;&gt;✅ category filter&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;257&quot; data-start=&quot;233&quot;&gt;
&lt;p data-end=&quot;257&quot; data-start=&quot;235&quot;&gt;✅ price range filter&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;274&quot; data-start=&quot;258&quot;&gt;
&lt;p data-end=&quot;274&quot; data-start=&quot;260&quot;&gt;✅ pagination&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;288&quot; data-start=&quot;275&quot;&gt;
&lt;p data-end=&quot;288&quot; data-start=&quot;277&quot;&gt;✅ sorting&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;397&quot; data-start=&quot;290&quot;&gt;All &lt;strong data-end=&quot;319&quot; data-start=&quot;294&quot;&gt;in one flexible query&lt;/strong&gt;, so users can search &lt;em data-end=&quot;351&quot; data-start=&quot;341&quot;&gt;anything&lt;/em&gt;, filter it, and get fast paginated results.&lt;/p&gt;
&lt;p data-end=&quot;435&quot; data-start=&quot;399&quot;&gt;Let’s build it &lt;strong data-end=&quot;430&quot; data-start=&quot;414&quot;&gt;step by step&lt;/strong&gt; 👇&lt;/p&gt;
&lt;hr data-end=&quot;440&quot; data-start=&quot;437&quot; /&gt;
&lt;h2 data-end=&quot;486&quot; data-start=&quot;442&quot;&gt;🧩 Step 1: Final Goal — Example Use Cases&lt;/h2&gt;
&lt;p data-end=&quot;559&quot; data-start=&quot;488&quot;&gt;Your final search API will handle all these cases in a single endpoint:&lt;/p&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;989&quot; data-start=&quot;561&quot;&gt;&lt;thead data-end=&quot;595&quot; data-start=&quot;561&quot;&gt;&lt;tr data-end=&quot;595&quot; data-start=&quot;561&quot;&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;579&quot; data-start=&quot;561&quot;&gt;Example Request&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;595&quot; data-start=&quot;579&quot;&gt;What It Does&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;989&quot; data-start=&quot;632&quot;&gt;&lt;tr data-end=&quot;694&quot; data-start=&quot;632&quot;&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;676&quot; data-start=&quot;632&quot;&gt;&lt;code data-end=&quot;675&quot; data-start=&quot;634&quot;&gt;/products/advanced-search?keyword=phone&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;694&quot; data-start=&quot;676&quot;&gt;Keyword search&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;792&quot; data-start=&quot;695&quot;&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;773&quot; data-start=&quot;695&quot;&gt;&lt;code data-end=&quot;772&quot; data-start=&quot;697&quot;&gt;/products/advanced-search?category=Electronics&amp;amp;minPrice=500&amp;amp;maxPrice=2000&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;792&quot; data-start=&quot;773&quot;&gt;Filtered search&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;905&quot; data-start=&quot;793&quot;&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;871&quot; data-start=&quot;793&quot;&gt;&lt;code data-end=&quot;870&quot; data-start=&quot;795&quot;&gt;/products/advanced-search?keyword=bluetooth&amp;amp;page=1&amp;amp;size=5&amp;amp;sort=price,desc&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;905&quot; data-start=&quot;871&quot;&gt;Keyword + Pagination + Sorting&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;989&quot; data-start=&quot;906&quot;&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;967&quot; data-start=&quot;906&quot;&gt;&lt;code data-end=&quot;966&quot; data-start=&quot;908&quot;&gt;/products/advanced-search?keyword=smart&amp;amp;category=Mobiles&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;989&quot; data-start=&quot;967&quot;&gt;Keyword + Category&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;994&quot; data-start=&quot;991&quot; /&gt;
&lt;h2 data-end=&quot;1048&quot; data-start=&quot;996&quot;&gt;🧩 Step 2: Update the Custom Repository Interface&lt;/h2&gt;
&lt;p data-end=&quot;1087&quot; data-start=&quot;1050&quot;&gt;Add a new &lt;strong data-end=&quot;1079&quot; data-start=&quot;1060&quot;&gt;advanced search&lt;/strong&gt; method:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1673&quot; data-start=&quot;1089&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;package&lt;/span&gt; com.bej.products.repository;

&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.model.Product;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Page;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Pageable;

&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;CustomProductRepository&lt;/span&gt; {

    Page&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;findProductsWithDynamicFilter&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(String category, Double minPrice, Double maxPrice, Pageable pageable)&lt;/span&gt;;

    Page&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;searchProductsByKeyword&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(String keyword, Pageable pageable)&lt;/span&gt;;

    &lt;span class=&quot;hljs-comment&quot;&gt;// 🔹 New unified search method&lt;/span&gt;
    Page&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;advancedSearch&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(String keyword, String category, Double minPrice, Double maxPrice, Pageable pageable)&lt;/span&gt;;
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;1678&quot; data-start=&quot;1675&quot; /&gt;
&lt;h2 data-end=&quot;1733&quot; data-start=&quot;1680&quot;&gt;🧩 Step 3: Implement the &lt;code data-end=&quot;1726&quot; data-start=&quot;1708&quot;&gt;advancedSearch()&lt;/code&gt; Method&lt;/h2&gt;
&lt;p data-end=&quot;1881&quot; data-start=&quot;1735&quot;&gt;Now, inside your &lt;code data-end=&quot;1775&quot; data-start=&quot;1752&quot;&gt;ProductRepositoryImpl&lt;/code&gt; class, we’ll create a &lt;strong data-end=&quot;1822&quot; data-start=&quot;1798&quot;&gt;dynamic JPQL builder&lt;/strong&gt; that combines keyword and filter conditions intelligently.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;5154&quot; data-start=&quot;1883&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;package&lt;/span&gt; com.bej.products.repository;

&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.model.Product;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; jakarta.persistence.EntityManager;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; jakarta.persistence.PersistenceContext;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; jakarta.persistence.TypedQuery;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Page;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.PageImpl;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Pageable;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.stereotype.Repository;

&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; java.util.List;

&lt;span class=&quot;hljs-meta&quot;&gt;@Repository&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;ProductRepositoryImpl&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;implements&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;CustomProductRepository&lt;/span&gt; {

    &lt;span class=&quot;hljs-meta&quot;&gt;@PersistenceContext&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; EntityManager entityManager;

    &lt;span class=&quot;hljs-meta&quot;&gt;@Override&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; Page&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;advancedSearch&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(String keyword, String category, Double minPrice, Double maxPrice, Pageable pageable)&lt;/span&gt; {
        &lt;span class=&quot;hljs-type&quot;&gt;StringBuilder&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;jpql&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;StringBuilder&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&quot;SELECT p FROM Product p WHERE 1=1&quot;&lt;/span&gt;);

        &lt;span class=&quot;hljs-comment&quot;&gt;// 🔹 Keyword-based search across multiple fields&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (keyword != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; !keyword.isEmpty()) {
            jpql.append(&lt;span class=&quot;hljs-string&quot;&gt;&quot; AND (LOWER(p.name) LIKE LOWER(CONCAT(&#39;%&#39;, :keyword, &#39;%&#39;))&quot;&lt;/span&gt;);
            jpql.append(&lt;span class=&quot;hljs-string&quot;&gt;&quot; OR LOWER(p.category) LIKE LOWER(CONCAT(&#39;%&#39;, :keyword, &#39;%&#39;))&quot;&lt;/span&gt;);
            jpql.append(&lt;span class=&quot;hljs-string&quot;&gt;&quot; OR LOWER(p.description) LIKE LOWER(CONCAT(&#39;%&#39;, :keyword, &#39;%&#39;)))&quot;&lt;/span&gt;);
        }

        &lt;span class=&quot;hljs-comment&quot;&gt;// 🔹 Category filter&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (category != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; !category.isEmpty()) {
            jpql.append(&lt;span class=&quot;hljs-string&quot;&gt;&quot; AND p.category = :category&quot;&lt;/span&gt;);
        }

        &lt;span class=&quot;hljs-comment&quot;&gt;// 🔹 Price filters&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (minPrice != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) {
            jpql.append(&lt;span class=&quot;hljs-string&quot;&gt;&quot; AND p.price &amp;gt;= :minPrice&quot;&lt;/span&gt;);
        }
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (maxPrice != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) {
            jpql.append(&lt;span class=&quot;hljs-string&quot;&gt;&quot; AND p.price &amp;lt;= :maxPrice&quot;&lt;/span&gt;);
        }

        &lt;span class=&quot;hljs-comment&quot;&gt;// 🔹 Sorting&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (pageable.getSort().isSorted()) {
            jpql.append(&lt;span class=&quot;hljs-string&quot;&gt;&quot; ORDER BY &quot;&lt;/span&gt;);
            jpql.append(pageable.getSort().toString().replace(&lt;span class=&quot;hljs-string&quot;&gt;&quot;:&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;&quot;&lt;/span&gt;));
        }

        &lt;span class=&quot;hljs-comment&quot;&gt;// ✅ Create query&lt;/span&gt;
        TypedQuery&amp;lt;Product&amp;gt; query = entityManager.createQuery(jpql.toString(), Product.class);

        &lt;span class=&quot;hljs-comment&quot;&gt;// 🔹 Set parameters dynamically&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (keyword != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; !keyword.isEmpty()) query.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;keyword&quot;&lt;/span&gt;, keyword);
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (category != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; !category.isEmpty()) query.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;category&quot;&lt;/span&gt;, category);
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (minPrice != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) query.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;minPrice&quot;&lt;/span&gt;, minPrice);
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (maxPrice != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) query.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;maxPrice&quot;&lt;/span&gt;, maxPrice);

        &lt;span class=&quot;hljs-comment&quot;&gt;// 🔹 Pagination&lt;/span&gt;
        query.setFirstResult((&lt;span class=&quot;hljs-type&quot;&gt;int&lt;/span&gt;) pageable.getOffset());
        query.setMaxResults(pageable.getPageSize());

        &lt;span class=&quot;hljs-comment&quot;&gt;// 🔹 Execute query&lt;/span&gt;
        List&amp;lt;Product&amp;gt; results = query.getResultList();

        &lt;span class=&quot;hljs-comment&quot;&gt;// 🔹 Count query for total records&lt;/span&gt;
        &lt;span class=&quot;hljs-type&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;countJpql&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; jpql.toString().replaceFirst(&lt;span class=&quot;hljs-string&quot;&gt;&quot;SELECT p FROM&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;SELECT COUNT(p) FROM&quot;&lt;/span&gt;);
        TypedQuery&amp;lt;Long&amp;gt; countQuery = entityManager.createQuery(countJpql, Long.class);

        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (keyword != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; !keyword.isEmpty()) countQuery.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;keyword&quot;&lt;/span&gt;, keyword);
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (category != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; !category.isEmpty()) countQuery.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;category&quot;&lt;/span&gt;, category);
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (minPrice != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) countQuery.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;minPrice&quot;&lt;/span&gt;, minPrice);
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (maxPrice != &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;) countQuery.setParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;maxPrice&quot;&lt;/span&gt;, maxPrice);

        &lt;span class=&quot;hljs-type&quot;&gt;Long&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;total&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; countQuery.getSingleResult();

        &lt;span class=&quot;hljs-comment&quot;&gt;// ✅ Return paginated result&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;PageImpl&lt;/span&gt;&amp;lt;&amp;gt;(results, pageable, total);
    }

    &lt;span class=&quot;hljs-comment&quot;&gt;// (keep your previous methods too if you want)&lt;/span&gt;
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;5159&quot; data-start=&quot;5156&quot; /&gt;
&lt;h2 data-end=&quot;5200&quot; data-start=&quot;5161&quot;&gt;🧠 Step 4: How This Works Internally&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;5675&quot; data-start=&quot;5202&quot;&gt;&lt;thead data-end=&quot;5227&quot; data-start=&quot;5202&quot;&gt;&lt;tr data-end=&quot;5227&quot; data-start=&quot;5202&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;5212&quot; data-start=&quot;5202&quot;&gt;Feature&lt;/th&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;5227&quot; data-start=&quot;5212&quot;&gt;Explanation&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;5675&quot; data-start=&quot;5256&quot;&gt;&lt;tr data-end=&quot;5310&quot; data-start=&quot;5256&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5264&quot; data-start=&quot;5256&quot;&gt;&lt;code data-end=&quot;5263&quot; data-start=&quot;5258&quot;&gt;1=1&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;5310&quot; data-start=&quot;5264&quot;&gt;Makes adding conditions easier dynamically&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5364&quot; data-start=&quot;5311&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5323&quot; data-start=&quot;5311&quot;&gt;&lt;code data-end=&quot;5322&quot; data-start=&quot;5313&quot;&gt;LOWER()&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;5364&quot; data-start=&quot;5323&quot;&gt;Makes keyword search case-insensitive&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5423&quot; data-start=&quot;5365&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5396&quot; data-start=&quot;5365&quot;&gt;&lt;code data-end=&quot;5395&quot; data-start=&quot;5367&quot;&gt;CONCAT(&#39;%&#39;, :keyword, &#39;%&#39;)&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;5423&quot; data-start=&quot;5396&quot;&gt;Allows partial matching&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5485&quot; data-start=&quot;5424&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5445&quot; data-start=&quot;5424&quot;&gt;Dynamic parameters&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;5485&quot; data-start=&quot;5445&quot;&gt;Only set values if they are non-null&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5545&quot; data-start=&quot;5486&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5496&quot; data-start=&quot;5486&quot;&gt;Sorting&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;5545&quot; data-start=&quot;5496&quot;&gt;Automatically handled by &lt;code data-end=&quot;5543&quot; data-start=&quot;5523&quot;&gt;pageable.getSort()&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5612&quot; data-start=&quot;5546&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5559&quot; data-start=&quot;5546&quot;&gt;Pagination&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;5612&quot; data-start=&quot;5559&quot;&gt;Uses &lt;code data-end=&quot;5588&quot; data-start=&quot;5566&quot;&gt;pageable.getOffset()&lt;/code&gt; and &lt;code data-end=&quot;5610&quot; data-start=&quot;5593&quot;&gt;setMaxResults()&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;5675&quot; data-start=&quot;5613&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;5624&quot; data-start=&quot;5613&quot;&gt;Counting&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;5675&quot; data-start=&quot;5624&quot;&gt;Builds a separate count query for total results&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;5680&quot; data-start=&quot;5677&quot; /&gt;
&lt;h2 data-end=&quot;5709&quot; data-start=&quot;5682&quot;&gt;🧩 Step 5: Service Layer&lt;/h2&gt;
&lt;p data-end=&quot;5767&quot; data-start=&quot;5711&quot;&gt;Call this &lt;code data-end=&quot;5739&quot; data-start=&quot;5721&quot;&gt;advancedSearch()&lt;/code&gt; from your &lt;code data-end=&quot;5766&quot; data-start=&quot;5750&quot;&gt;ProductService&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;6503&quot; data-start=&quot;5769&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;package&lt;/span&gt; com.bej.products.service;

&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.model.Product;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.repository.ProductRepository;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Page;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Pageable;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.stereotype.Service;

&lt;span class=&quot;hljs-meta&quot;&gt;@Service&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;ProductService&lt;/span&gt; {
    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;final&lt;/span&gt; ProductRepository productRepository;

    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-title function_&quot;&gt;ProductService&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(ProductRepository productRepository)&lt;/span&gt; {
        &lt;span class=&quot;hljs-built_in&quot;&gt;this&lt;/span&gt;.productRepository = productRepository;
    }

    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; Page&amp;lt;Product&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;advancedSearch&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(String keyword, String category, Double minPrice, Double maxPrice, Pageable pageable)&lt;/span&gt; {
        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; productRepository.advancedSearch(keyword, category, minPrice, maxPrice, pageable);
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;6508&quot; data-start=&quot;6505&quot; /&gt;
&lt;h2 data-end=&quot;6540&quot; data-start=&quot;6510&quot;&gt;🧩 Step 6: Controller Layer&lt;/h2&gt;
&lt;p data-end=&quot;6596&quot; data-start=&quot;6542&quot;&gt;Expose a single powerful endpoint for advanced search:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;7812&quot; data-start=&quot;6598&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-java&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;package&lt;/span&gt; com.bej.products.controller;

&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.model.Product;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; com.bej.products.service.ProductService;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Page;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.domain.Pageable;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.data.web.PageableDefault;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.http.ResponseEntity;
&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; org.springframework.web.bind.annotation.*;

&lt;span class=&quot;hljs-meta&quot;&gt;@RestController&lt;/span&gt;
&lt;span class=&quot;hljs-meta&quot;&gt;@RequestMapping(&quot;/products&quot;)&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;ProductController&lt;/span&gt; {

    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;final&lt;/span&gt; ProductService productService;
    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-title function_&quot;&gt;ProductController&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(ProductService productService)&lt;/span&gt; {
        &lt;span class=&quot;hljs-built_in&quot;&gt;this&lt;/span&gt;.productService = productService;
    }

    &lt;span class=&quot;hljs-meta&quot;&gt;@GetMapping(&quot;/advanced-search&quot;)&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; ResponseEntity&amp;lt;Page&amp;lt;Product&amp;gt;&amp;gt; &lt;span class=&quot;hljs-title function_&quot;&gt;advancedSearch&lt;/span&gt;&lt;span class=&quot;hljs-params&quot;&gt;(
            &lt;/span&gt;&lt;span class=&quot;hljs-meta&quot;&gt;@RequestParam(required = false)&lt;/span&gt; String keyword,
            &lt;span class=&quot;hljs-meta&quot;&gt;@RequestParam(required = false)&lt;/span&gt; String category,
            &lt;span class=&quot;hljs-meta&quot;&gt;@RequestParam(required = false)&lt;/span&gt; Double minPrice,
            &lt;span class=&quot;hljs-meta&quot;&gt;@RequestParam(required = false)&lt;/span&gt; Double maxPrice,
            &lt;span class=&quot;hljs-meta&quot;&gt;@PageableDefault(page = 0, size = 5, sort = &quot;name&quot;)&lt;/span&gt; Pageable pageable
    ) {
        Page&amp;lt;Product&amp;gt; results = productService.advancedSearch(keyword, category, minPrice, maxPrice, pageable);
        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; ResponseEntity.ok(results);
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;7817&quot; data-start=&quot;7814&quot; /&gt;
&lt;h2 data-end=&quot;7863&quot; data-start=&quot;7819&quot;&gt;🧩 Step 7: Example API Calls and Behavior&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;8316&quot; data-start=&quot;7865&quot;&gt;&lt;thead data-end=&quot;7890&quot; data-start=&quot;7865&quot;&gt;&lt;tr data-end=&quot;7890&quot; data-start=&quot;7865&quot;&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;7875&quot; data-start=&quot;7865&quot;&gt;Request&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;7890&quot; data-start=&quot;7875&quot;&gt;Description&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;8316&quot; data-start=&quot;7919&quot;&gt;&lt;tr data-end=&quot;8007&quot; data-start=&quot;7919&quot;&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;7964&quot; data-start=&quot;7919&quot;&gt;&lt;code data-end=&quot;7963&quot; data-start=&quot;7921&quot;&gt;/products/advanced-search?keyword=laptop&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;8007&quot; data-start=&quot;7964&quot;&gt;Search all products related to “laptop”&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;8124&quot; data-start=&quot;8008&quot;&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;8088&quot; data-start=&quot;8008&quot;&gt;&lt;code data-end=&quot;8087&quot; data-start=&quot;8010&quot;&gt;/products/advanced-search?category=Electronics&amp;amp;minPrice=5000&amp;amp;maxPrice=50000&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;8124&quot; data-start=&quot;8088&quot;&gt;Filter by category + price range&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;8234&quot; data-start=&quot;8125&quot;&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;8202&quot; data-start=&quot;8125&quot;&gt;&lt;code data-end=&quot;8201&quot; data-start=&quot;8127&quot;&gt;/products/advanced-search?keyword=phone&amp;amp;category=Mobiles&amp;amp;sort=price,desc&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;8234&quot; data-start=&quot;8202&quot;&gt;Keyword + Category + Sorting&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;8316&quot; data-start=&quot;8235&quot;&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;8296&quot; data-start=&quot;8235&quot;&gt;&lt;code data-end=&quot;8295&quot; data-start=&quot;8237&quot;&gt;/products/advanced-search?keyword=wireless&amp;amp;page=1&amp;amp;size=3&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;8316&quot; data-start=&quot;8296&quot;&gt;Paginated search&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;8321&quot; data-start=&quot;8318&quot; /&gt;
&lt;h2 data-end=&quot;8350&quot; data-start=&quot;8323&quot;&gt;🧾 Example JSON Response&lt;/h2&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;8982&quot; data-start=&quot;8352&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-json&quot;&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;content&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-punctuation&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;hljs-punctuation&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;P107&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;Wireless Headphones&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;Electronics&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;price&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;1500.0&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;description&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;High-quality wireless headphones with noise cancellation&quot;&lt;/span&gt;
    &lt;span class=&quot;hljs-punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;hljs-punctuation&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;P110&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;Bluetooth Speaker&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;Electronics&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;price&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;1200.0&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;description&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;Portable speaker with deep bass and clear sound&quot;&lt;/span&gt;
    &lt;span class=&quot;hljs-punctuation&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;hljs-punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;pageable&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;hljs-attr&quot;&gt;&quot;pageNumber&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;hljs-attr&quot;&gt;&quot;pageSize&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;hljs-attr&quot;&gt;&quot;sort&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-punctuation&quot;&gt;[&lt;/span&gt;
      &lt;span class=&quot;hljs-punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;hljs-attr&quot;&gt;&quot;property&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;price&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;hljs-attr&quot;&gt;&quot;direction&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;DESC&quot;&lt;/span&gt;
      &lt;span class=&quot;hljs-punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;hljs-punctuation&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;hljs-punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;totalElements&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;totalPages&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;hljs-punctuation&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;8987&quot; data-start=&quot;8984&quot; /&gt;
&lt;h2 data-end=&quot;9045&quot; data-start=&quot;8989&quot;&gt;🧭 Step 8: Summary — Full Amazon-style Search Feature&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;9493&quot; data-start=&quot;9047&quot;&gt;&lt;thead data-end=&quot;9084&quot; data-start=&quot;9047&quot;&gt;&lt;tr data-end=&quot;9084&quot; data-start=&quot;9047&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;9057&quot; data-start=&quot;9047&quot;&gt;Feature&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;9069&quot; data-start=&quot;9057&quot;&gt;Supported&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;9084&quot; data-start=&quot;9069&quot;&gt;Explanation&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;9493&quot; data-start=&quot;9126&quot;&gt;&lt;tr data-end=&quot;9194&quot; data-start=&quot;9126&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;9145&quot; data-start=&quot;9126&quot;&gt;✅ Keyword search&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;9149&quot; data-start=&quot;9145&quot;&gt;✔&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;9194&quot; data-start=&quot;9149&quot;&gt;Matches &lt;code data-end=&quot;9165&quot; data-start=&quot;9159&quot;&gt;name&lt;/code&gt;, &lt;code data-end=&quot;9177&quot; data-start=&quot;9167&quot;&gt;category&lt;/code&gt;, &lt;code data-end=&quot;9192&quot; data-start=&quot;9179&quot;&gt;description&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;9243&quot; data-start=&quot;9195&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;9215&quot; data-start=&quot;9195&quot;&gt;✅ Category filter&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;9219&quot; data-start=&quot;9215&quot;&gt;✔&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;9243&quot; data-start=&quot;9219&quot;&gt;Exact category match&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;9289&quot; data-start=&quot;9244&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;9260&quot; data-start=&quot;9244&quot;&gt;✅ Price range&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;9264&quot; data-start=&quot;9260&quot;&gt;✔&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;9289&quot; data-start=&quot;9264&quot;&gt;&lt;code data-end=&quot;9274&quot; data-start=&quot;9266&quot;&gt;&amp;gt;= min&lt;/code&gt; and &lt;code data-end=&quot;9287&quot; data-start=&quot;9279&quot;&gt;&amp;lt;= max&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;9333&quot; data-start=&quot;9290&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;9311&quot; data-start=&quot;9290&quot;&gt;✅ Case-insensitive&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;9315&quot; data-start=&quot;9311&quot;&gt;✔&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;9333&quot; data-start=&quot;9315&quot;&gt;Uses &lt;code data-end=&quot;9331&quot; data-start=&quot;9322&quot;&gt;LOWER()&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;9389&quot; data-start=&quot;9334&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;9349&quot; data-start=&quot;9334&quot;&gt;✅ Pagination&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;9353&quot; data-start=&quot;9349&quot;&gt;✔&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;9389&quot; data-start=&quot;9353&quot;&gt;Controlled via &lt;code data-end=&quot;9376&quot; data-start=&quot;9370&quot;&gt;page&lt;/code&gt; and &lt;code data-end=&quot;9387&quot; data-start=&quot;9381&quot;&gt;size&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;9441&quot; data-start=&quot;9390&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;9402&quot; data-start=&quot;9390&quot;&gt;✅ Sorting&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;9406&quot; data-start=&quot;9402&quot;&gt;✔&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;9441&quot; data-start=&quot;9406&quot;&gt;Controlled via &lt;code data-end=&quot;9429&quot; data-start=&quot;9423&quot;&gt;sort&lt;/code&gt; parameter&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;9493&quot; data-start=&quot;9442&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;9456&quot; data-start=&quot;9442&quot;&gt;✅ Efficient&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;9460&quot; data-start=&quot;9456&quot;&gt;✔&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;9493&quot; data-start=&quot;9460&quot;&gt;Uses &lt;code data-end=&quot;9477&quot; data-start=&quot;9467&quot;&gt;PageImpl&lt;/code&gt; + count query&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;9498&quot; data-start=&quot;9495&quot; /&gt;
&lt;h3 data-end=&quot;9511&quot; data-start=&quot;9500&quot;&gt;🧠 Tip:&lt;/h3&gt;
&lt;p data-end=&quot;9566&quot; data-start=&quot;9512&quot;&gt;If your data grows large, you can optimize further by:&lt;/p&gt;
&lt;ul data-end=&quot;9789&quot; data-start=&quot;9567&quot;&gt;
&lt;li data-end=&quot;9643&quot; data-start=&quot;9567&quot;&gt;
&lt;p data-end=&quot;9643&quot; data-start=&quot;9569&quot;&gt;Using &lt;strong data-end=&quot;9620&quot; data-start=&quot;9575&quot;&gt;Spring Data Specifications (Criteria API)&lt;/strong&gt; for dynamic queries.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;9720&quot; data-start=&quot;9644&quot;&gt;
&lt;p data-end=&quot;9720&quot; data-start=&quot;9646&quot;&gt;Adding &lt;strong data-end=&quot;9673&quot; data-start=&quot;9653&quot;&gt;database indexes&lt;/strong&gt; on columns like &lt;code data-end=&quot;9696&quot; data-start=&quot;9690&quot;&gt;name&lt;/code&gt;, &lt;code data-end=&quot;9708&quot; data-start=&quot;9698&quot;&gt;category&lt;/code&gt;, &lt;code data-end=&quot;9717&quot; data-start=&quot;9710&quot;&gt;price&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;9789&quot; data-start=&quot;9721&quot;&gt;
&lt;p data-end=&quot;9789&quot; data-start=&quot;9723&quot;&gt;Using &lt;strong data-end=&quot;9746&quot; data-start=&quot;9729&quot;&gt;Elasticsearch&lt;/strong&gt; for full-text search if scaling is needed.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;https://chatgpt.com/share/6911d84b-87b4-8011-a001-9cd1139ab648
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;</description><link>https://value2read.blogspot.com/2025/11/the-key-concept-in-understanding-how.html</link><author>noreply@blogger.com (Online Shopping)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-6181293925731062460</guid><pubDate>Sun, 02 Nov 2025 17:17:31 +0000</pubDate><atom:updated>2025-11-02T09:17:45.781-08:00</atom:updated><title>🌐 How Web Applications Worked Before REST APIs: A Journey Through Servlets, JSP, and CGI</title><description>&lt;p&gt;Before the world was introduced to &lt;strong data-end=&quot;219&quot; data-start=&quot;206&quot;&gt;REST APIs&lt;/strong&gt;, web applications followed a very different approach for handling client requests and generating responses. Let’s take a short trip back in time to understand how things worked in the early days of web development — with technologies like &lt;strong data-end=&quot;474&quot; data-start=&quot;459&quot;&gt;CGI scripts&lt;/strong&gt;, &lt;strong data-end=&quot;493&quot; data-start=&quot;476&quot;&gt;Java Servlets&lt;/strong&gt;, and &lt;strong data-end=&quot;525&quot; data-start=&quot;499&quot;&gt;JSP (JavaServer Pages)&lt;/strong&gt; leading the way.&lt;/p&gt;
&lt;hr data-end=&quot;547&quot; data-start=&quot;544&quot; /&gt;
&lt;h3 data-end=&quot;582&quot; data-start=&quot;549&quot;&gt;🧩 The Early Era: CGI Scripts&lt;/h3&gt;
&lt;p data-end=&quot;868&quot; data-start=&quot;584&quot;&gt;Before Java and REST APIs became mainstream, developers used &lt;strong data-end=&quot;679&quot; data-start=&quot;645&quot;&gt;Common Gateway Interface (CGI)&lt;/strong&gt; scripts to process requests.&lt;br data-end=&quot;711&quot; data-start=&quot;708&quot; /&gt;
CGI scripts were simple programs written in languages such as &lt;strong data-end=&quot;781&quot; data-start=&quot;773&quot;&gt;Perl&lt;/strong&gt;, &lt;strong data-end=&quot;793&quot; data-start=&quot;783&quot;&gt;Python&lt;/strong&gt;, or &lt;strong data-end=&quot;803&quot; data-start=&quot;798&quot;&gt;C&lt;/strong&gt;, which ran on the web server every time a user sent a request.&lt;/p&gt;
&lt;p data-end=&quot;888&quot; data-start=&quot;870&quot;&gt;&lt;strong data-end=&quot;888&quot; data-start=&quot;870&quot;&gt;How it worked:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;1121&quot; data-start=&quot;889&quot;&gt;
&lt;li data-end=&quot;969&quot; data-start=&quot;889&quot;&gt;
&lt;p data-end=&quot;969&quot; data-start=&quot;891&quot;&gt;The web server received a request (for example, when a user submitted a form).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1027&quot; data-start=&quot;970&quot;&gt;
&lt;p data-end=&quot;1027&quot; data-start=&quot;972&quot;&gt;The server executed a CGI script as a separate process.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1121&quot; data-start=&quot;1028&quot;&gt;
&lt;p data-end=&quot;1121&quot; data-start=&quot;1030&quot;&gt;The script generated a response (usually in HTML) and sent it back to the client’s browser.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1146&quot; data-start=&quot;1123&quot;&gt;&lt;strong data-end=&quot;1146&quot; data-start=&quot;1123&quot;&gt;Limitations of CGI:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;1346&quot; data-start=&quot;1147&quot;&gt;
&lt;li data-end=&quot;1222&quot; data-start=&quot;1147&quot;&gt;
&lt;p data-end=&quot;1222&quot; data-start=&quot;1149&quot;&gt;Every request started a new process — which consumed more memory and CPU.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1267&quot; data-start=&quot;1223&quot;&gt;
&lt;p data-end=&quot;1267&quot; data-start=&quot;1225&quot;&gt;Handling concurrent users was inefficient.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1346&quot; data-start=&quot;1268&quot;&gt;
&lt;p data-end=&quot;1346&quot; data-start=&quot;1270&quot;&gt;It lacked reusability and was hard to maintain as applications grew complex.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1435&quot; data-start=&quot;1348&quot;&gt;These drawbacks eventually led developers to look for a better, more scalable solution.&lt;/p&gt;
&lt;hr data-end=&quot;1440&quot; data-start=&quot;1437&quot; /&gt;
&lt;h3 data-end=&quot;1473&quot; data-start=&quot;1442&quot;&gt;☕ The Rise of Java Servlets&lt;/h3&gt;
&lt;p data-end=&quot;1725&quot; data-start=&quot;1475&quot;&gt;When Java entered the web development world, it brought &lt;strong data-end=&quot;1543&quot; data-start=&quot;1531&quot;&gt;Servlets&lt;/strong&gt;, which revolutionized server-side programming.&lt;br data-end=&quot;1593&quot; data-start=&quot;1590&quot; /&gt;
A &lt;strong data-end=&quot;1606&quot; data-start=&quot;1595&quot;&gt;Servlet&lt;/strong&gt; is a Java class that runs inside a &lt;strong data-end=&quot;1663&quot; data-start=&quot;1642&quot;&gt;Servlet container&lt;/strong&gt; (like Apache Tomcat) and handles HTTP requests and responses.&lt;/p&gt;
&lt;p data-end=&quot;1769&quot; data-start=&quot;1727&quot;&gt;&lt;strong data-end=&quot;1769&quot; data-start=&quot;1727&quot;&gt;How Servlets improved web development:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;2081&quot; data-start=&quot;1770&quot;&gt;
&lt;li data-end=&quot;1921&quot; data-start=&quot;1770&quot;&gt;
&lt;p data-end=&quot;1921&quot; data-start=&quot;1772&quot;&gt;Instead of starting a new process for each request, Servlets used &lt;strong data-end=&quot;1881&quot; data-start=&quot;1838&quot;&gt;a single instance with multiple threads&lt;/strong&gt;, making them faster and more efficient.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2006&quot; data-start=&quot;1922&quot;&gt;
&lt;p data-end=&quot;2006&quot; data-start=&quot;1924&quot;&gt;Servlets could maintain &lt;strong data-end=&quot;1960&quot; data-start=&quot;1948&quot;&gt;sessions&lt;/strong&gt;, allowing personalized experiences for users.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2081&quot; data-start=&quot;2007&quot;&gt;
&lt;p data-end=&quot;2081&quot; data-start=&quot;2009&quot;&gt;They supported reusable and modular code, which made maintenance easier.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2108&quot; data-start=&quot;2083&quot;&gt;&lt;strong data-end=&quot;2108&quot; data-start=&quot;2083&quot;&gt;Typical Servlet Flow:&lt;/strong&gt;&lt;/p&gt;
&lt;ol data-end=&quot;2401&quot; data-start=&quot;2109&quot;&gt;
&lt;li data-end=&quot;2143&quot; data-start=&quot;2109&quot;&gt;
&lt;p data-end=&quot;2143&quot; data-start=&quot;2112&quot;&gt;A client sends an HTTP request.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2199&quot; data-start=&quot;2144&quot;&gt;
&lt;p data-end=&quot;2199&quot; data-start=&quot;2147&quot;&gt;The web server forwards it to the Servlet container.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2249&quot; data-start=&quot;2200&quot;&gt;
&lt;p data-end=&quot;2249&quot; data-start=&quot;2203&quot;&gt;The container invokes the appropriate Servlet.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2326&quot; data-start=&quot;2250&quot;&gt;
&lt;p data-end=&quot;2326&quot; data-start=&quot;2253&quot;&gt;The Servlet processes the request (for example, by accessing a database).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2401&quot; data-start=&quot;2327&quot;&gt;
&lt;p data-end=&quot;2401&quot; data-start=&quot;2330&quot;&gt;It generates an HTTP response (usually HTML or JSON) and sends it back.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr data-end=&quot;2406&quot; data-start=&quot;2403&quot; /&gt;
&lt;h3 data-end=&quot;2460&quot; data-start=&quot;2408&quot;&gt;💻 Dynamic Web Pages with JSP (JavaServer Pages)&lt;/h3&gt;
&lt;p data-end=&quot;2698&quot; data-start=&quot;2462&quot;&gt;While Servlets handled logic efficiently, writing HTML inside Java code quickly became messy.&lt;br data-end=&quot;2558&quot; data-start=&quot;2555&quot; /&gt;
To solve this, &lt;strong data-end=&quot;2599&quot; data-start=&quot;2573&quot;&gt;JSP (JavaServer Pages)&lt;/strong&gt; was introduced — a technology that allowed developers to embed &lt;strong data-end=&quot;2697&quot; data-start=&quot;2663&quot;&gt;Java code directly inside HTML&lt;/strong&gt;.&lt;/p&gt;
&lt;p data-end=&quot;2739&quot; data-start=&quot;2700&quot;&gt;&lt;strong data-end=&quot;2739&quot; data-start=&quot;2700&quot;&gt;JSP made web development easier by:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;3008&quot; data-start=&quot;2740&quot;&gt;
&lt;li data-end=&quot;2836&quot; data-start=&quot;2740&quot;&gt;
&lt;p data-end=&quot;2836&quot; data-start=&quot;2742&quot;&gt;Allowing separation of business logic (handled by Servlets) and presentation (handled by JSP).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2910&quot; data-start=&quot;2837&quot;&gt;
&lt;p data-end=&quot;2910&quot; data-start=&quot;2839&quot;&gt;Supporting tag libraries and Expression Language (EL) for cleaner code.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3008&quot; data-start=&quot;2911&quot;&gt;
&lt;p data-end=&quot;3008&quot; data-start=&quot;2913&quot;&gt;Making it easy to create &lt;strong data-end=&quot;2957&quot; data-start=&quot;2938&quot;&gt;dynamic content&lt;/strong&gt; (like user-specific dashboards or form responses).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3170&quot; data-start=&quot;3010&quot;&gt;Essentially, JSP worked as a &lt;strong data-end=&quot;3058&quot; data-start=&quot;3039&quot;&gt;front-end layer&lt;/strong&gt;, while Servlets acted as the &lt;strong data-end=&quot;3111&quot; data-start=&quot;3088&quot;&gt;back-end controller&lt;/strong&gt; — a pattern that still influences modern frameworks today.&lt;/p&gt;
&lt;hr data-end=&quot;3175&quot; data-start=&quot;3172&quot; /&gt;
&lt;h3 data-end=&quot;3218&quot; data-start=&quot;3177&quot;&gt;⚙️ From Servlets and JSP to REST APIs&lt;/h3&gt;
&lt;p data-end=&quot;3425&quot; data-start=&quot;3220&quot;&gt;Over time, web applications became more complex, and the need for &lt;strong data-end=&quot;3342&quot; data-start=&quot;3286&quot;&gt;standardized communication between client and server&lt;/strong&gt; increased.&lt;br data-end=&quot;3356&quot; data-start=&quot;3353&quot; /&gt;
That’s where &lt;strong data-end=&quot;3411&quot; data-start=&quot;3369&quot;&gt;REST (Representational State Transfer)&lt;/strong&gt; APIs came in.&lt;/p&gt;
&lt;p data-end=&quot;3464&quot; data-start=&quot;3427&quot;&gt;&lt;strong data-end=&quot;3464&quot; data-start=&quot;3427&quot;&gt;How REST APIs changed everything:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;3774&quot; data-start=&quot;3465&quot;&gt;
&lt;li data-end=&quot;3545&quot; data-start=&quot;3465&quot;&gt;
&lt;p data-end=&quot;3545&quot; data-start=&quot;3467&quot;&gt;They use &lt;strong data-end=&quot;3492&quot; data-start=&quot;3476&quot;&gt;HTTP methods&lt;/strong&gt; (GET, POST, PUT, DELETE) for predictable operations.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3625&quot; data-start=&quot;3546&quot;&gt;
&lt;p data-end=&quot;3625&quot; data-start=&quot;3548&quot;&gt;Responses are often in &lt;strong data-end=&quot;3579&quot; data-start=&quot;3571&quot;&gt;JSON&lt;/strong&gt;, making them lightweight and easy to consume.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3774&quot; data-start=&quot;3626&quot;&gt;
&lt;p data-end=&quot;3774&quot; data-start=&quot;3628&quot;&gt;REST allows &lt;strong data-end=&quot;3675&quot; data-start=&quot;3640&quot;&gt;frontend and backend separation&lt;/strong&gt;, enabling frameworks like React, Angular, and Vue to communicate seamlessly with backend services.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3927&quot; data-start=&quot;3776&quot;&gt;In short, REST APIs made it possible for any client — mobile app, web app, or even IoT device — to interact with servers in a consistent, scalable way.&lt;/p&gt;
&lt;hr data-end=&quot;3932&quot; data-start=&quot;3929&quot; /&gt;
&lt;h3 data-end=&quot;3962&quot; data-start=&quot;3934&quot;&gt;🔁 Summary: Then vs. Now&lt;/h3&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;4547&quot; data-start=&quot;3964&quot;&gt;&lt;thead data-end=&quot;4037&quot; data-start=&quot;3964&quot;&gt;&lt;tr data-end=&quot;4037&quot; data-start=&quot;3964&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;3974&quot; data-start=&quot;3964&quot;&gt;Feature&lt;/th&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;4009&quot; data-start=&quot;3974&quot;&gt;Before REST (CGI, Servlets, JSP)&lt;/th&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;4037&quot; data-start=&quot;4009&quot;&gt;After REST (Modern APIs)&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;4547&quot; data-start=&quot;4114&quot;&gt;&lt;tr data-end=&quot;4182&quot; data-start=&quot;4114&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4130&quot; data-start=&quot;4114&quot;&gt;Communication&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;4160&quot; data-start=&quot;4130&quot;&gt;Server-generated HTML pages&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;4182&quot; data-start=&quot;4160&quot;&gt;JSON/XML responses&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4290&quot; data-start=&quot;4183&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4198&quot; data-start=&quot;4183&quot;&gt;Architecture&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;4242&quot; data-start=&quot;4198&quot;&gt;Tight coupling between frontend &amp;amp; backend&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;4290&quot; data-start=&quot;4242&quot;&gt;Loose coupling (frontend-backend separation)&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4372&quot; data-start=&quot;4291&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4305&quot; data-start=&quot;4291&quot;&gt;Scalability&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;4340&quot; data-start=&quot;4305&quot;&gt;Limited by server-side rendering&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;4372&quot; data-start=&quot;4340&quot;&gt;Highly scalable and reusable&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4466&quot; data-start=&quot;4373&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4387&quot; data-start=&quot;4373&quot;&gt;Performance&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;4426&quot; data-start=&quot;4387&quot;&gt;Multiple processes per request (CGI)&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;4466&quot; data-start=&quot;4426&quot;&gt;Multi-threaded or stateless services&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4547&quot; data-start=&quot;4467&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4481&quot; data-start=&quot;4467&quot;&gt;Reusability&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;4506&quot; data-start=&quot;4481&quot;&gt;Hard to reuse UI logic&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;4547&quot; data-start=&quot;4506&quot;&gt;Reusable across devices and platforms&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;4552&quot; data-start=&quot;4549&quot; /&gt;
&lt;h3 data-end=&quot;4575&quot; data-start=&quot;4554&quot;&gt;🚀 Final Thoughts&lt;/h3&gt;
&lt;p data-end=&quot;4856&quot; data-start=&quot;4577&quot;&gt;Technologies like &lt;strong data-end=&quot;4610&quot; data-start=&quot;4595&quot;&gt;CGI scripts&lt;/strong&gt;, &lt;strong data-end=&quot;4624&quot; data-start=&quot;4612&quot;&gt;Servlets&lt;/strong&gt;, and &lt;strong data-end=&quot;4637&quot; data-start=&quot;4630&quot;&gt;JSP&lt;/strong&gt; paved the way for today’s modern web architecture. They taught developers how to manage requests, build dynamic pages, and handle user sessions — laying the foundation for RESTful APIs and the frameworks that followed.&lt;/p&gt;
&lt;p data-end=&quot;5064&quot; data-start=&quot;4858&quot;&gt;While REST APIs dominate modern development, understanding their origins helps us appreciate how far web technology has evolved — from simple CGI scripts to the dynamic, data-driven web we experience today.&lt;/p&gt;</description><link>https://value2read.blogspot.com/2025/11/how-web-applications-worked-before-rest.html</link><author>noreply@blogger.com (Online Shopping)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-3099853177335405289</guid><pubDate>Sun, 02 Nov 2025 17:17:01 +0000</pubDate><atom:updated>2025-11-02T09:17:17.272-08:00</atom:updated><title>Before REST APIs: How Developers Handled HTTP Requests and Responses</title><description>&lt;p&gt;In today’s web development world, REST APIs are the foundation of modern communication between client and server. But have you ever wondered how things worked &lt;em data-end=&quot;422&quot; data-start=&quot;414&quot;&gt;before&lt;/em&gt; REST APIs became the standard? Let’s take a quick journey back in time to understand the earlier methods developers used to handle HTTP requests and responses — and how we arrived at the simplicity of REST.&lt;/p&gt;
&lt;hr data-end=&quot;634&quot; data-start=&quot;631&quot; /&gt;
&lt;h2 data-end=&quot;677&quot; data-start=&quot;636&quot;&gt;🌐 The Early Days of Web Communication&lt;/h2&gt;
&lt;p data-end=&quot;942&quot; data-start=&quot;679&quot;&gt;Before REST APIs came into the picture, handling HTTP requests and generating responses was a more manual and complex process. Developers had to write code that directly interacted with the server, managed connections, and generated responses in specific formats.&lt;/p&gt;
&lt;p data-end=&quot;1136&quot; data-start=&quot;944&quot;&gt;Two of the most common technologies used during that time were &lt;strong data-end=&quot;1022&quot; data-start=&quot;1007&quot;&gt;CGI scripts&lt;/strong&gt; and &lt;strong data-end=&quot;1044&quot; data-start=&quot;1027&quot;&gt;Java Servlets&lt;/strong&gt; — and later, &lt;strong data-end=&quot;1084&quot; data-start=&quot;1058&quot;&gt;JSP (JavaServer Pages)&lt;/strong&gt; joined the scene to make things a bit more dynamic.&lt;/p&gt;
&lt;hr data-end=&quot;1141&quot; data-start=&quot;1138&quot; /&gt;
&lt;h2 data-end=&quot;1180&quot; data-start=&quot;1143&quot;&gt;⚙️ CGI Scripts: The Starting Point&lt;/h2&gt;
&lt;p data-end=&quot;1400&quot; data-start=&quot;1182&quot;&gt;&lt;strong data-end=&quot;1216&quot; data-start=&quot;1182&quot;&gt;CGI (Common Gateway Interface)&lt;/strong&gt; was one of the first methods used to make web pages dynamic. It allowed web servers to execute external programs (like Perl, C, or Python scripts) to generate web content dynamically.&lt;/p&gt;
&lt;p data-end=&quot;1615&quot; data-start=&quot;1402&quot;&gt;However, CGI had a major drawback — each request started a new process on the server. This made it inefficient and slow when handling multiple requests simultaneously. As websites grew, CGI became harder to scale.&lt;/p&gt;
&lt;p data-end=&quot;1638&quot; data-start=&quot;1617&quot;&gt;&lt;strong data-end=&quot;1638&quot; data-start=&quot;1617&quot;&gt;Example workflow:&lt;/strong&gt;&lt;/p&gt;
&lt;ol data-end=&quot;1792&quot; data-start=&quot;1639&quot;&gt;
&lt;li data-end=&quot;1664&quot; data-start=&quot;1639&quot;&gt;
&lt;p data-end=&quot;1664&quot; data-start=&quot;1642&quot;&gt;A user submits a form.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1705&quot; data-start=&quot;1665&quot;&gt;
&lt;p data-end=&quot;1705&quot; data-start=&quot;1668&quot;&gt;The web server triggers a CGI script.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1792&quot; data-start=&quot;1706&quot;&gt;
&lt;p data-end=&quot;1792&quot; data-start=&quot;1709&quot;&gt;The script runs independently, processes the data, and sends back an HTML response.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p data-end=&quot;1860&quot; data-start=&quot;1794&quot;&gt;It worked — but it wasn’t ideal for high-traffic web applications.&lt;/p&gt;
&lt;hr data-end=&quot;1865&quot; data-start=&quot;1862&quot; /&gt;
&lt;h2 data-end=&quot;1897&quot; data-start=&quot;1867&quot;&gt;☕ The Rise of Java Servlets&lt;/h2&gt;
&lt;p data-end=&quot;2120&quot; data-start=&quot;1899&quot;&gt;To overcome the limitations of CGI, Java introduced &lt;strong data-end=&quot;1963&quot; data-start=&quot;1951&quot;&gt;Servlets&lt;/strong&gt;. Servlets are Java classes that run inside a web server and handle HTTP requests and responses efficiently without creating a new process for every request.&lt;/p&gt;
&lt;p data-end=&quot;2144&quot; data-start=&quot;2122&quot;&gt;&lt;strong data-end=&quot;2144&quot; data-start=&quot;2122&quot;&gt;How Servlets Work:&lt;/strong&gt;&lt;/p&gt;
&lt;ol data-end=&quot;2352&quot; data-start=&quot;2145&quot;&gt;
&lt;li data-end=&quot;2196&quot; data-start=&quot;2145&quot;&gt;
&lt;p data-end=&quot;2196&quot; data-start=&quot;2148&quot;&gt;A client (like a browser) sends an HTTP request.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2270&quot; data-start=&quot;2197&quot;&gt;
&lt;p data-end=&quot;2270&quot; data-start=&quot;2200&quot;&gt;The request is received by the Servlet container (like Apache Tomcat).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2352&quot; data-start=&quot;2271&quot;&gt;
&lt;p data-end=&quot;2352&quot; data-start=&quot;2274&quot;&gt;The Servlet processes the request and returns a response — often HTML or JSON.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p data-end=&quot;2369&quot; data-start=&quot;2354&quot;&gt;&lt;strong data-end=&quot;2369&quot; data-start=&quot;2354&quot;&gt;Advantages:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;2503&quot; data-start=&quot;2370&quot;&gt;
&lt;li data-end=&quot;2416&quot; data-start=&quot;2370&quot;&gt;
&lt;p data-end=&quot;2416&quot; data-start=&quot;2372&quot;&gt;Faster than CGI (no new process per request)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2452&quot; data-start=&quot;2417&quot;&gt;
&lt;p data-end=&quot;2452&quot; data-start=&quot;2419&quot;&gt;Can maintain sessions and cookies&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2503&quot; data-start=&quot;2453&quot;&gt;
&lt;p data-end=&quot;2503&quot; data-start=&quot;2455&quot;&gt;Integrates well with Java-based web applications&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2577&quot; data-start=&quot;2505&quot;&gt;This was a huge step forward in building reliable, scalable web systems.&lt;/p&gt;
&lt;hr data-end=&quot;2582&quot; data-start=&quot;2579&quot; /&gt;
&lt;h2 data-end=&quot;2638&quot; data-start=&quot;2584&quot;&gt;🧩 JSP (JavaServer Pages): Making Web Pages Dynamic&lt;/h2&gt;
&lt;p data-end=&quot;2855&quot; data-start=&quot;2640&quot;&gt;While Servlets were powerful, they required a lot of Java code to output HTML. To simplify this, &lt;strong data-end=&quot;2763&quot; data-start=&quot;2737&quot;&gt;JSP (JavaServer Pages)&lt;/strong&gt; was introduced. It allowed developers to mix HTML with Java code directly in the same file.&lt;/p&gt;
&lt;p data-end=&quot;2902&quot; data-start=&quot;2857&quot;&gt;For example, a JSP page could look like this:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;3007&quot; data-start=&quot;2904&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-jsp&quot;&gt;&amp;lt;html&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;h1&amp;gt;Welcome, &amp;lt;%= request.getParameter(&lt;span class=&quot;hljs-string&quot;&gt;&quot;username&quot;&lt;/span&gt;) %&amp;gt;!&amp;lt;/h1&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;3137&quot; data-start=&quot;3009&quot;&gt;This made it easier for developers to build dynamic, data-driven web pages without writing full-fledged Servlets for every task.&lt;/p&gt;
&lt;p data-end=&quot;3164&quot; data-start=&quot;3139&quot;&gt;&lt;strong data-end=&quot;3164&quot; data-start=&quot;3139&quot;&gt;JSP + Servlets Combo:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;3273&quot; data-start=&quot;3165&quot;&gt;
&lt;li data-end=&quot;3216&quot; data-start=&quot;3165&quot;&gt;
&lt;p data-end=&quot;3216&quot; data-start=&quot;3167&quot;&gt;JSP handled the &lt;strong data-end=&quot;3199&quot; data-start=&quot;3183&quot;&gt;presentation&lt;/strong&gt; (front-end part)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3273&quot; data-start=&quot;3217&quot;&gt;
&lt;p data-end=&quot;3273&quot; data-start=&quot;3219&quot;&gt;Servlets handled the &lt;strong data-end=&quot;3258&quot; data-start=&quot;3240&quot;&gt;business logic&lt;/strong&gt; (backend part)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3347&quot; data-start=&quot;3275&quot;&gt;Together, they formed the backbone of early Java-based web applications.&lt;/p&gt;
&lt;hr data-end=&quot;3352&quot; data-start=&quot;3349&quot; /&gt;
&lt;h2 data-end=&quot;3379&quot; data-start=&quot;3354&quot;&gt;🚀 Then Came REST APIs&lt;/h2&gt;
&lt;p data-end=&quot;3557&quot; data-start=&quot;3381&quot;&gt;With time, web applications became more complex, and the need for standardized, lightweight communication grew. That’s where &lt;strong data-end=&quot;3548&quot; data-start=&quot;3506&quot;&gt;REST (Representational State Transfer)&lt;/strong&gt; came in.&lt;/p&gt;
&lt;p data-end=&quot;3862&quot; data-start=&quot;3559&quot;&gt;REST APIs allowed developers to send and receive data in structured formats like &lt;strong data-end=&quot;3648&quot; data-start=&quot;3640&quot;&gt;JSON&lt;/strong&gt;, using simple &lt;strong data-end=&quot;3679&quot; data-start=&quot;3663&quot;&gt;HTTP methods&lt;/strong&gt; like &lt;code data-end=&quot;3690&quot; data-start=&quot;3685&quot;&gt;GET&lt;/code&gt;, &lt;code data-end=&quot;3698&quot; data-start=&quot;3692&quot;&gt;POST&lt;/code&gt;, &lt;code data-end=&quot;3705&quot; data-start=&quot;3700&quot;&gt;PUT&lt;/code&gt;, and &lt;code data-end=&quot;3719&quot; data-start=&quot;3711&quot;&gt;DELETE&lt;/code&gt;.&lt;br data-end=&quot;3723&quot; data-start=&quot;3720&quot; /&gt;
They made it possible for front-end applications (like React, Angular, or mobile apps) to talk to back-end servers cleanly and efficiently.&lt;/p&gt;
&lt;p data-end=&quot;3890&quot; data-start=&quot;3864&quot;&gt;&lt;strong data-end=&quot;3890&quot; data-start=&quot;3864&quot;&gt;Benefits of REST APIs:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;4019&quot; data-start=&quot;3891&quot;&gt;
&lt;li data-end=&quot;3913&quot; data-start=&quot;3891&quot;&gt;
&lt;p data-end=&quot;3913&quot; data-start=&quot;3893&quot;&gt;Platform-independent&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3966&quot; data-start=&quot;3914&quot;&gt;
&lt;p data-end=&quot;3966&quot; data-start=&quot;3916&quot;&gt;Easy to integrate with modern front-end frameworks&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3991&quot; data-start=&quot;3967&quot;&gt;
&lt;p data-end=&quot;3991&quot; data-start=&quot;3969&quot;&gt;Stateless and scalable&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4019&quot; data-start=&quot;3992&quot;&gt;
&lt;p data-end=&quot;4019&quot; data-start=&quot;3994&quot;&gt;Reusable and maintainable&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;4024&quot; data-start=&quot;4021&quot; /&gt;
&lt;h2 data-end=&quot;4070&quot; data-start=&quot;4026&quot;&gt;🧠 Summary: From Complexity to Simplicity&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;4502&quot; data-start=&quot;4072&quot;&gt;&lt;thead data-end=&quot;4106&quot; data-start=&quot;4072&quot;&gt;&lt;tr data-end=&quot;4106&quot; data-start=&quot;4072&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;4078&quot; data-start=&quot;4072&quot;&gt;Era&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;4091&quot; data-start=&quot;4078&quot;&gt;Technology&lt;/th&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;4106&quot; data-start=&quot;4091&quot;&gt;Description&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;4502&quot; data-start=&quot;4144&quot;&gt;&lt;tr data-end=&quot;4243&quot; data-start=&quot;4144&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4156&quot; data-start=&quot;4144&quot;&gt;Early Web&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4170&quot; data-start=&quot;4156&quot;&gt;CGI Scripts&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;4243&quot; data-start=&quot;4170&quot;&gt;Executed external programs for each request; slow and resource-heavy.&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4333&quot; data-start=&quot;4244&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4255&quot; data-start=&quot;4244&quot;&gt;Java Era&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4266&quot; data-start=&quot;4255&quot;&gt;Servlets&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;4333&quot; data-start=&quot;4266&quot;&gt;Java-based server-side processing; more efficient and scalable.&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4408&quot; data-start=&quot;4334&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4352&quot; data-start=&quot;4334&quot;&gt;Dynamic Content&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4358&quot; data-start=&quot;4352&quot;&gt;JSP&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;4408&quot; data-start=&quot;4358&quot;&gt;Combined HTML and Java code for dynamic pages.&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4502&quot; data-start=&quot;4409&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4422&quot; data-start=&quot;4409&quot;&gt;Modern Web&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4434&quot; data-start=&quot;4422&quot;&gt;REST APIs&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;4502&quot; data-start=&quot;4434&quot;&gt;Lightweight, standardized, and framework-friendly communication.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;4507&quot; data-start=&quot;4504&quot; /&gt;
&lt;h2 data-end=&quot;4529&quot; data-start=&quot;4509&quot;&gt;💬 Final Thoughts&lt;/h2&gt;
&lt;p data-end=&quot;4811&quot; data-start=&quot;4531&quot;&gt;Before REST APIs simplified everything, developers had to manually handle how servers talked to browsers. From CGI scripts that spawned new processes for every request to the robust Servlets and JSPs that powered dynamic web pages — each phase shaped the modern web we know today.&lt;/p&gt;
&lt;p data-end=&quot;5014&quot; data-start=&quot;4813&quot;&gt;REST didn’t replace these technologies overnight, but it refined the idea of server-client interaction into a clean, scalable, and universal standard that changed the way we build applications forever.&lt;/p&gt;
&lt;hr data-end=&quot;5019&quot; data-start=&quot;5016&quot; /&gt;
&lt;h3 data-end=&quot;5052&quot; data-start=&quot;5021&quot;&gt;🧩 Bonus Tip for Developers&lt;/h3&gt;
&lt;p data-end=&quot;5109&quot; data-start=&quot;5053&quot;&gt;If you’re learning web development today, try exploring:&lt;/p&gt;
&lt;ul data-end=&quot;5244&quot; data-start=&quot;5110&quot;&gt;
&lt;li data-end=&quot;5149&quot; data-start=&quot;5110&quot;&gt;
&lt;p data-end=&quot;5149&quot; data-start=&quot;5112&quot;&gt;How a &lt;strong data-end=&quot;5129&quot; data-start=&quot;5118&quot;&gt;Servlet&lt;/strong&gt; processes a request&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5186&quot; data-start=&quot;5150&quot;&gt;
&lt;p data-end=&quot;5186&quot; data-start=&quot;5152&quot;&gt;How &lt;strong data-end=&quot;5163&quot; data-start=&quot;5156&quot;&gt;JSP&lt;/strong&gt; renders a dynamic page&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5244&quot; data-start=&quot;5187&quot;&gt;
&lt;p data-end=&quot;5244&quot; data-start=&quot;5189&quot;&gt;How &lt;strong data-end=&quot;5206&quot; data-start=&quot;5193&quot;&gt;REST APIs&lt;/strong&gt; communicate with front-end frameworks&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;5332&quot; data-start=&quot;5246&quot;&gt;Understanding these foundations will make you a stronger and more versatile developer.&lt;/p&gt;
&lt;hr data-end=&quot;5337&quot; data-start=&quot;5334&quot; /&gt;
&lt;p data-end=&quot;5360&quot; data-start=&quot;5339&quot;&gt;Would you like me to:&lt;/p&gt;
&lt;ol data-end=&quot;5599&quot; data-start=&quot;5361&quot;&gt;
&lt;li data-end=&quot;5495&quot; data-start=&quot;5361&quot;&gt;
&lt;p data-end=&quot;5495&quot; data-start=&quot;5364&quot;&gt;Optimize this post for &lt;strong data-end=&quot;5403&quot; data-start=&quot;5387&quot;&gt;SEO keywords&lt;/strong&gt; (e.g., “before REST API”, “how HTTP requests worked before REST”, “Servlets vs REST”), or&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5599&quot; data-start=&quot;5496&quot;&gt;
&lt;p data-end=&quot;5599&quot; data-start=&quot;5499&quot;&gt;Format it for &lt;strong data-end=&quot;5534&quot; data-start=&quot;5513&quot;&gt;Medium/Vocal blog&lt;/strong&gt; style with headings, bold emphasis, and call-to-action sections?&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p data-end=&quot;5657&quot; data-is-last-node=&quot;&quot; data-is-only-node=&quot;&quot; data-start=&quot;5601&quot;&gt;That way, I can tailor it for your next platform upload.&lt;/p&gt;</description><link>https://value2read.blogspot.com/2025/11/before-rest-apis-how-developers-handled.html</link><author>noreply@blogger.com (Online Shopping)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1900114228369772729.post-832560901682486117</guid><pubDate>Thu, 23 Oct 2025 06:40:00 +0000</pubDate><atom:updated>2025-10-22T23:41:00.765-07:00</atom:updated><title>Get Paid for Surveys and Micro-Tasks!</title><description>&lt;p style=&quot;text-align: left;&quot;&gt;The world of online micro-tasks is booming, offering anyone a simple, flexible way to earn real cash from home. Whether you&#39;re looking to save for something special or just pad your bank account, platforms that pay you for completing surveys, offers, and small tasks are a fantastic starting point. We&#39;ve compiled details on two great options—one featured in a recent video, and another popular website with an incredibly low payout threshold—so you can double your potential for passive income!&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;h3&gt;Fast Payouts for Simple Tasks&lt;/h3&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;As highlighted in the recent video, &lt;i&gt;“Make MONEY Online? Watch this! - Min $1 PayPal Withdrawal,”&lt;/i&gt; there&#39;s a user-friendly platform that makes getting paid for your opinions quick and simple.&lt;/p&gt;&lt;p&gt;This site offers a variety of ways to earn, including &lt;b&gt;taking surveys, completing offers, and performing other micro-tasks&lt;/b&gt;. While each task earns a small amount, these earnings accumulate quickly. Best of all:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Global Access:&lt;/b&gt; The platform is available to members from any country in the world.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Easy Payments:&lt;/b&gt; All payments are processed reliably via &lt;b&gt;PayPal&lt;/b&gt;.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Low Threshold:&lt;/b&gt; You only need a minimum of &lt;b&gt;$1&lt;/b&gt; in your account to request a payment, meaning you can cash out quickly and frequently.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;h3&gt;The Ultra-Low Minimum Payout&lt;/h3&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Another powerful name in the online earning space is this website, a platform known for its accessibility and wide variety of tasks. This platform has established itself as an excellent opportunity for people across the globe.&lt;/p&gt;&lt;p&gt;Here is what makes this website stand out:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Multiple Earning Streams:&lt;/b&gt; You can earn money by &lt;b&gt;taking paid online surveys, completing offers, and even playing games&lt;/b&gt;.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;High Survey Payouts:&lt;/b&gt; On average, this platform pays between &lt;b&gt;$0.5 and $15&lt;/b&gt; for every completed survey.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Flexible Withdrawal Options:&lt;/b&gt; Payments are processed via &lt;b&gt;PayPal, Skrill, Payeer, or BTC (Bitcoin)&lt;/b&gt;.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Incredibly Low Payout:&lt;/b&gt; This website&#39;s minimum payment amount is an astounding &lt;b&gt;$0.01&lt;/b&gt;. This means you can start testing the platform and withdrawing your earnings almost instantly!&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Ready to start earning? Dive into these opportunities today!&lt;/p&gt;&lt;p&gt;&lt;b&gt;Watch the video for the first platform:&lt;/b&gt; &lt;response-element ng-version=&quot;0.0.0-PLACEHOLDER&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;link-block _nghost-ng-c4009459016=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;&lt;!----&gt;&lt;!----&gt;&lt;a _ngcontent-ng-c4009459016=&quot;&quot; _nghost-ng-c2323178962=&quot;&quot; class=&quot;ng-star-inserted&quot; data-hveid=&quot;0&quot; data-ved=&quot;0CAAQ_4QMahgKEwj8rYDu17mQAxUAAAAAHQAAAAAQrAE&quot; decode-data-ved=&quot;1&quot; externallink=&quot;&quot; href=&quot;http://www.youtube.com/watch?v=N2JjRh1emKc&quot; jslog=&quot;197247;track:generic_click,impression,attention;BardVeMetadataKey:[[&amp;quot;r_bd1da93a9d49d2b4&amp;quot;,&amp;quot;c_6a036223333f09c3&amp;quot;,null,&amp;quot;rc_7acf2d187d7752d2&amp;quot;,null,null,&amp;quot;en&amp;quot;,null,1,null,null,1,0]]&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;http://www.youtube.com/watch?v=N2JjRh1emKc&lt;/a&gt;&lt;!----&gt;&lt;/link-block&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;/response-element&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;a href=&quot;https://www.awin1.com/awclick.php?gid=577420&amp;amp;mid=82935&amp;amp;awinaffid=2547047&amp;amp;linkid=4467432&amp;amp;clickref=&quot; target=&quot;_blank&quot;&gt;Check out this website directly here&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;</description><link>https://value2read.blogspot.com/2025/10/get-paid-for-surveys-and-micro-tasks.html</link><author>noreply@blogger.com (Online Shopping)</author><thr:total>0</thr:total></item></channel></rss>