<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Java and other Java Framework - Medium]]></title>
        <description><![CDATA[Explore Java Native, Micronaut, Spring Boot, Grails, JSP, Retrofit, Kotlin, Groovy, JRuby, and Java 4–25. Tutorials &amp; tips by Bobby Akyong, Java dev with 8+ yrs exp. Follow at medium.com/@akyong! #java #micronaut #springboot #kotlin #groovy - Medium]]></description>
        <link>https://medium.com/java-and-other-java-framework?source=rss----c42f7186e1ce---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Java and other Java Framework - Medium</title>
            <link>https://medium.com/java-and-other-java-framework?source=rss----c42f7186e1ce---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 03:40:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/java-and-other-java-framework" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ Building a Simple Follow System Using Spring Boot 3 and PostgreSQL]]></title>
            <link>https://medium.com/java-and-other-java-framework/building-a-simple-follow-system-using-spring-boot-3-and-postgresql-58045257744d?source=rss----c42f7186e1ce---4</link>
            <guid isPermaLink="false">https://medium.com/p/58045257744d</guid>
            <category><![CDATA[java25]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[spring-data-jpa]]></category>
            <category><![CDATA[java-spring-boot]]></category>
            <dc:creator><![CDATA[Bobby Akyong]]></dc:creator>
            <pubDate>Sun, 02 Nov 2025 15:00:29 GMT</pubDate>
            <atom:updated>2025-11-02T15:00:28.303Z</atom:updated>
            <content:encoded><![CDATA[<p>When you open social media platforms like Instagram or Twitter, the <strong>“Follow”</strong> feature is one of the most fundamental parts — it connects users and builds a network.</p><p>In this article, I’ll walk you through how I built a <strong>simple “User &amp; Follower” REST API</strong> using <strong>Spring Boot 3.5</strong>, <strong>Spring Data JPA</strong>, and <strong>PostgreSQL</strong> — without using Lombok.<br> This project is part of my portfolio and demonstrates clean architecture, proper separation of concerns, and practical use of JPA relationships.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5P-VkEjeXvYd42ea6L0r7Q.png" /><figcaption>Java 25</figcaption></figure><h3>🧱 Tech Stack</h3><ul><li><strong>Java 25</strong></li><li><strong>Spring Boot 3.5.7</strong></li><li><strong>Gradle 9</strong></li><li><strong>Spring Data JPA</strong></li><li><strong>PostgreSQL</strong></li></ul><h3>🧩 Project Overview</h3><p>The goal is simple:</p><blockquote><em>Allow users to </em><strong><em>follow</em></strong><em> or </em><strong><em>unfollow</em></strong><em> each other, similar to social platforms.</em></blockquote><p>Here’s the project structure:</p><pre>src/main/java/com/example/springdatajpa/<br>├── controller/<br>│   └── UserController.java<br>├── entity/<br>│   └── User.java<br>├── repository/<br>│   └── UserRepository.java<br>├── service/<br>│   └── UserService.java<br>└── seeder/<br>    └── DataSeeder.java</pre><h3>⚙️ Setting Up the Project</h3><h4>1. Create Database</h4><p>Create a PostgreSQL database named userdb.</p><p>2. Configure application.properties</p><pre>spring.datasource.url=jdbc:postgresql://localhost:5432/userdb<br>spring.datasource.username=postgres<br>spring.datasource.password=yourpassword<br>spring.jpa.hibernate.ddl-auto=update<br>spring.jpa.show-sql=true</pre><p>3. Run The application with <strong>./gradlew bootRun </strong>then the server will start at localhost:8080</p><h3>🔗 REST API Endpoints</h3><h3>👤 User Management</h3><p>POST/api/usersCreate new userGET/api/usersGet all users</p><pre>+--------+------------+-----------------+<br>| Method |  Endpoint  |   Description   |<br>+--------+------------+-----------------+<br>| POST   | /api/users | Create new User |<br>| GET    | /api/users | Get All Users   |<br>+--------+------------+-----------------+</pre><h3>🤝 Follow / Unfollow</h3><pre>+--------+------------------------------------------------+---------------------+<br>| Method |                    Endpoint                    |     Description     |<br>+--------+------------------------------------------------+---------------------+<br>| POST   | /api/users/{followerId}/follow/{followingId}   | Follow another user |<br>| GET    | /api/users/{followerId}/unfollow/{followingId} | Unfollow a user     |<br>+--------+------------------------------------------------+---------------------+</pre><h4>🧪 Example Usage</h4><h4>➕ Create a New User</h4><pre>POST /api/users<br>Content-Type: application/json<br><br>{<br>  &quot;username&quot;: &quot;bobby&quot;,<br>  &quot;email&quot;: &quot;bobby@example.com&quot;<br>}</pre><p>🔔 Follow Another User</p><pre>POST /api/users/1/follow/2</pre><p>🚫 Unfollow a User</p><pre>POST /api/users/1/unfollow/2</pre><p>Get All Users</p><pre>GET /api/users</pre><h3>🌱 Database Seeder</h3><p>To make testing easier, I created a simple seeder using CommandLineRunner that inserts a few dummy users on startup if the table is empty.<br> That way, you can test the follow and unfollow API instantly after running the project.</p><h3>🧠 What I Learned</h3><p>While building this project, I focused on:</p><ul><li>Understanding <strong>JPA Many-to-Many</strong> relationships between users.</li><li>Practicing <strong>constructor-based dependency injection</strong> (instead of Lombok’s @RequiredArgsConstructor).</li><li>Creating a <strong>REST API</strong> that follows clean architecture.</li><li>Automating sample data setup with a <strong>DataSeeder</strong> class.</li></ul><h3>🧾 Conclusion</h3><p>This small project is a great foundation for anyone learning backend development using <strong>Spring Boot</strong> and <strong>PostgreSQL</strong>.<br> You can extend it further by adding:</p><ul><li>Authentication (Spring Security + JWT)</li><li>Pagination for user lists</li><li>GraphQL API layer</li><li>Frontend integration (React or Vue)</li></ul><h3>👨‍💻 About Me</h3><p>I’m <strong>Bobby Akyong</strong>, a software engineer passionate about backend architecture, distributed systems, and applied AI.<br> I love building things that scale — and sharing what I learn along the way.</p><p>🔗 <a href="https://github.com/akyong/SpringDataJpa">GitHub</a> • <a href="https://linkedin.com/in/bobbyakyong">LinkedIn</a></p><blockquote><em>💡 </em>If you found this project interesting, consider giving it a ⭐ on GitHub and sharing it with your friends who are learning Spring Boot!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58045257744d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/java-and-other-java-framework/building-a-simple-follow-system-using-spring-boot-3-and-postgresql-58045257744d">🚀 Building a Simple Follow System Using Spring Boot 3 and PostgreSQL</a> was originally published in <a href="https://medium.com/java-and-other-java-framework">Java and other Java Framework</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Simple Spring Boot “Hello World” REST API: My Journey]]></title>
            <link>https://medium.com/java-and-other-java-framework/building-a-simple-spring-boot-hello-world-rest-api-my-journey-482350125684?source=rss----c42f7186e1ce---4</link>
            <guid isPermaLink="false">https://medium.com/p/482350125684</guid>
            <category><![CDATA[jpa]]></category>
            <category><![CDATA[java-jpa]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[spring-boot-project]]></category>
            <dc:creator><![CDATA[Bobby Akyong]]></dc:creator>
            <pubDate>Thu, 03 Jul 2025 11:15:49 GMT</pubDate>
            <atom:updated>2025-07-03T11:15:49.168Z</atom:updated>
            <content:encoded><![CDATA[<p>As a Javaa enthusiast with over 8 years of experience, I’m always excited to dive into frameworks like Spring Boot and Micronaut. In this post, I’ll share how I built a simple Spring Boot application with a “Hello World” REST endpoint, using Gradle and Java 17 on my MacBook. This is part of my exploration for my blog, <em>Jaava and Other Java Framework</em>, where I document my adventures in Java development. Let’s get started!</p><h3>Why Spring Boot?</h3><p>Spring Boot is a powerhouse for building robust applications, especially for enterprise and web development. Its vast ecosystem and auto-configuration make it a go-to choice, though it’s heavier than Micronaut for microservices (a topic I’ll explore in future posts). For this project, I chose Spring Boot 3.5.3 to create a simple REST API, leveraging my experience with frameworks like Spring Boot and Grails at PT Vast Palaso Cyberindo.</p><h3>Setting Up the Project</h3><p>I used <strong>Spring Initializr</strong> to bootstrap my project, as Spring Boot doesn’t have a CLI command like Micronaut’s mn create-app. Here’s how I set it up:</p><p><strong>Generate the Project:</strong></p><p>Visited start.spring.io.</p><p>Configured:</p><p>Project: Gradle — Groovy</p><p>Language: Java</p><p>Spring Boot: 3.5.3</p><p>Java: 17</p><p>Dependencies: Spring Web, Spring Boot DevTools</p><p>Group: com.bobbyakyong</p><p>Artifact: demo-app</p><p>Downloaded and unzipped to ~/programming/java/springboot/demo-app.</p><p><strong>Move and Organize</strong>: To keep things tidy, I created a folder and moved the ZIP:</p><pre>mkdir -p ~/programming/java/springboot &amp;&amp; mv ~/Downloads/demo-app.zip ~/programming/java/springboot/<br>cd ~/programming/java/springboot<br>unzip demo-app.zip<br>cd demo-app</pre><p><strong>Run the App</strong>:</p><pre>./gradlew bootRun</pre><h3>The “Hello World” Endpoint</h3><p>I created a simple REST controller to return a greeting:</p><pre>package com.akyong.demoapp;<br><br>import org.springframework.web.bind.annotation.GetMapping;<br>import org.springframework.web.bind.annotation.RestController;<br><br>@RestController<br>public class MyController {<br>    @GetMapping(&quot;/hello&quot;)<br>    public String sayHello() {<br>        return &quot;Hello, Bobby! Spring Boot with Java 17 is ready!&quot;;<br>    }<br>}</pre><p>Testing it was straightforward:</p><p>Output: Hello, Bobby! Spring Boot with Java 17 is ready!</p><h3>The JPA and PostgreSQL Hiccup</h3><p>I initially added <strong>Spring Data JPA</strong> and <strong>PostgreSQL</strong> dependencies to explore database integration, given my experience with PostgreSQL at Qeong.com. However, I hit an error:</p><pre>Failed to configure a DataSource: &#39;url&#39; attribute is not specified and no embedded datasource could be configured.</pre><p>This happened because Spring Boot’s auto-configuration expects a database connection when JPA is included, even if I hadn’t used it yet. Since I hadn’t set up a PostgreSQL database, the app failed to start. The fix? I could either:</p><ul><li>Configure PostgreSQL in application.properties:</li><li>spring.datasource.url=jdbc:postgresql://localhost:5432/demo spring.datasource.username=postgres spring.datasource.password= spring.datasource.driver-class-name=org.postgresql.Driver spring.jpa.hibernate.ddl-auto=update</li><li>Or remove JPA dependencies from build.gradle if I didn’t need them yet.</li></ul><p>For now, I kept the dependencies but left them inactive, focusing on the “Hello World” endpoint. I’ll enable JPA later when I’m ready to add database features, like managing user data for an e-commerce platform like Qeong.com.</p><h3>Lessons Learned</h3><ul><li>Spring Boot’s auto-configuration is powerful but assumes you’ve set up dependencies like JPA correctly.</li><li>Unlike Micronaut’s mn create-app, Spring Boot relies on Initializr or CLI tools, which are still user-friendly.</li><li>Organizing projects in ~/programming/java/springboot keeps my workspace clean, especially for multiple projects.</li></ul><h3>What’s Next?</h3><p>I plan to:</p><ul><li>Add JPA with PostgreSQL for data persistence, inspired by my work on Qeong.com.</li><li>Compare this setup with Micronaut for my next blog post.</li><li>Deploy to AWS, leveraging my cloud experience from Indonesia Ocean Link.</li></ul><h3>About Me</h3><p>I’m Bobby Akyong, a Java developer and entrepreneur with 8+ years of experience, founder of Qeong.com (e-commerce for mobile accessories) and Indonesia Ocean Link (seafood exports). Follow me on Medium, LinkedIn, or GitHub for more Java insights. Got a project or job inquiry? Reach out at bobby@qeong.com!</p><p>What’s your experience with Spring Boot? Let me know in the comments!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=482350125684" width="1" height="1" alt=""><hr><p><a href="https://medium.com/java-and-other-java-framework/building-a-simple-spring-boot-hello-world-rest-api-my-journey-482350125684">Building a Simple Spring Boot “Hello World” REST API: My Journey</a> was originally published in <a href="https://medium.com/java-and-other-java-framework">Java and other Java Framework</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Micronaut VS SpringBoot: A Comparison for Java Developers]]></title>
            <link>https://medium.com/java-and-other-java-framework/micronaut-vs-springboot-a-comparson-for-java-developers-23f6bc1e97d8?source=rss----c42f7186e1ce---4</link>
            <guid isPermaLink="false">https://medium.com/p/23f6bc1e97d8</guid>
            <category><![CDATA[java-developer]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[micronaut]]></category>
            <category><![CDATA[micronaut-framework]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Bobby Akyong]]></dc:creator>
            <pubDate>Thu, 03 Jul 2025 09:19:53 GMT</pubDate>
            <atom:updated>2025-07-03T09:40:32.191Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*Leu9ax8PW9cMoH3JUvs23Q.png" /><figcaption>Micronaut vs SpringBoot</figcaption></figure><p>When building Java applications, two frameworks often come up: <strong>Spring Boot</strong> and <strong>Micronaut</strong>. Both are powerful, support Dependency Injection (DI), and simplify building web applications or microservices. But are they the same? Not quite. In this article, we’ll dive into their key differences, show code examples, and share an opinion on when to choose one over the other.</p><h3>Dependency Injection: Runtime vs. Compile-Time</h3><h3>Spring Boot</h3><p>Spring Boot uses <strong>runtime reflection</strong> for DI. It scans and resolves dependencies at runtime, leveraging annotations like <strong>@Autowired</strong>. This approach is flexible but can slow down startup and increase memory usage due to reflection overhead.</p><h3>Micronaut</h3><p>Micronaut takes a <strong>compile-time</strong> approach to DI. It processes dependencies during compilation using an annotation processor, avoiding runtime reflection. This results in faster startup and lower memory usage, ideal for microservices and serverless applications. Micronaut supports constructor, field, and method injection via <strong>jakarta.inject.Inject</strong>, with constructor injection being the recommended approach for safer, testable code.</p><p><strong>Code Example: Dependency Injection</strong></p><p>Here’s how DI looks in both frameworks for a simple controller-service setup.</p><p><strong>Spring Boot (Constructor Injection)</strong>:</p><pre>import org.springframework.stereotype.Controller;<br>import org.springframework.beans.factory.annotation.Autowired;<br><br>@Controller<br>public class MyController {<br>    private final MyService myService;<br><br>    @Autowired<br>    public MyController(MyService myService) {<br>        this.myService = myService;<br>    }<br><br>    // Example endpoint<br>    public String getData() {<br>        return myService.fetchData();<br>    }<br>}</pre><p><strong>Micronaut (Constructor Injection)</strong>:</p><pre>import io.micronaut.http.annotation.Controller;<br>import jakarta.inject.Inject;<br><br>@Controller<br>public class MyController {<br>    private final MyService myService;<br><br>    @Inject<br>    public MyController(MyService myService) {<br>        this.myService = myService;<br>    }<br><br>    // Example endpoint<br>    public String getData() {<br>        return myService.fetchData();<br>    }<br>}</pre><blockquote>Notice the similarity in syntax, but Micronaut uses jakarta.inject.Inject, adhering to JSR-330 standards, while Spring has its own annotations.</blockquote><h3>Performance and Startup Time</h3><ul><li><strong>Spring Boot</strong>: Known for slower startup times due to runtime reflection and bean processing. It’s great for monolithic or enterprise applications but less optimal for microservices needing rapid scaling. Spring Native (using GraalVM) mitigates this, but it’s not as mature as Micronaut’s native compilation support.</li><li><strong>Micronaut</strong>: Designed for fast startup and low memory footprint. Its Ahead-of-Time (AOT) compilation processes dependencies, routing, and configuration at compile time, making it a top choice for microservices and serverless environments. For example, Micronaut can use up to 50% less memory than Spring Boot for similar applications.</li></ul><h3>Ecosystem and Community</h3><ul><li><strong>Spring Boot</strong>: Boasts a mature ecosystem with modules like Spring Data, Spring Security, and Spring Cloud. With over 120,000 questions on StackOverflow, it’s a go-to for enterprise developers. Its vast library support makes it ideal for complex projects with third-party integrations.</li><li><strong>Micronaut</strong>: A newer player with a growing ecosystem (8,000+ StackOverflow questions). It focuses on cloud-native and microservices, with native support for GraalVM and tools like LangChain4j. While not as extensive as Spring’s, its compatibility with JSR-330 annotations allows some code reuse from Spring projects.</li></ul><h3>Bean Management</h3><ul><li><strong>Spring Boot</strong>: Manages beans by name and load order (using @AutoConfigureBefore/@AutoConfigureAfter). This flexibility can lead to debugging challenges if bean names conflict or load orders change.</li><li><strong>Micronaut</strong>: Avoids bean names and load order, relying on types and qualifiers. This reduces conflicts and simplifies debugging but may feel less flexible for dynamic bean overrides.</li></ul><h3>Use Cases</h3><ul><li><strong>Spring Boot</strong>: Best for large-scale enterprise applications, monoliths, or projects needing deep integration with Spring’s ecosystem (e.g., Spring Data JPA, Spring Security). It’s a safe bet for teams familiar with Spring or projects requiring extensive third-party libraries.</li><li><strong>Micronaut</strong>: Excels in microservices, serverless, and cloud-native applications where fast startup and low memory usage are critical. Its GraalVM compatibility makes it a strong choice for native image deployments.</li></ul><h3>Opinion: Which Should You Choose?</h3><p>Both frameworks are excellent, but your choice depends on your project’s needs. <strong>Spring Boot</strong> is the industry standard for enterprise applications. Its vast ecosystem, community support, and flexibility make it ideal for complex, long-running projects where startup time isn’t a priority. However, its heavier resource usage can be a drawback for lightweight, scalable systems.</p><p><strong>Micronaut</strong>, on the other hand, is a modern, lightweight alternative tailored for the cloud era. Its compile-time DI and fast startup make it perfect for microservices and serverless applications. If you’re building a new project with a focus on performance or deploying to environments like AWS Lambda, Micronaut is hard to beat. However, its younger ecosystem means you might need to roll your own solutions for some integrations.</p><p>For developers familiar with Spring, Micronaut’s learning curve is minimal due to similar syntax and concepts. If you’re starting fresh or prioritizing efficiency, I’d lean toward Micronaut for microservices. For enterprise-grade projects with legacy systems or heavy library dependencies, Spring Boot remains the safer, more established choice.</p><h3>Conclusion</h3><p>Spring Boot and Micronaut share similarities like DI and REST API support, but their differences in performance, DI approach, and target use cases set them apart. Spring Boot is the heavyweight champion for enterprise needs, while Micronaut is the agile contender for cloud-native microservices. Evaluate your project’s requirements — performance, ecosystem, or familiarity — and choose the framework that aligns best.</p><p>What’s your take? Have you used either framework, and which do you prefer? Share your thoughts in the comments!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23f6bc1e97d8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/java-and-other-java-framework/micronaut-vs-springboot-a-comparson-for-java-developers-23f6bc1e97d8">Micronaut VS SpringBoot: A Comparison for Java Developers</a> was originally published in <a href="https://medium.com/java-and-other-java-framework">Java and other Java Framework</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unknown Micronaut import?]]></title>
            <link>https://medium.com/java-and-other-java-framework/unknown-micronaut-import-5ed6e448dc36?source=rss----c42f7186e1ce---4</link>
            <guid isPermaLink="false">https://medium.com/p/5ed6e448dc36</guid>
            <category><![CDATA[micronaut-framework]]></category>
            <category><![CDATA[java8]]></category>
            <category><![CDATA[micronaut]]></category>
            <dc:creator><![CDATA[Bobby Akyong]]></dc:creator>
            <pubDate>Mon, 16 Sep 2019 05:27:13 GMT</pubDate>
            <atom:updated>2019-09-16T05:24:05.935Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bkAdOM-mi60riCbTApsDvQ.jpeg" /><figcaption>Belitung’s Island</figcaption></figure><p>Kali ini saya akan sharing pengalaman ditempat saya bekerja, seperti judul, ketika kita sudah lama sekali tidak membuka project yang sudah kita buat dulu, namun saat ini ingin melanjutkan kerjaan yang dulu belum selesai, tapi setelah buka projectnya dan mencoba menjalankan aplikasinya, ternyata error dengan bunyi error Unknown Micronaut ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*p45N7VT1SEwd5FByOuX0NA.png" /><figcaption>unknown io.micronaut.*</figcaption></figure><p>Kenapa hal ini terjadi? biasanya hal ini terjadi saat kita sudah memakai micronaut versi lain, dimana versi yang terbaru ini memiliki struktur pembacaan path yang berbeda. Misalnya dengan versi 1.1.0 membacanya di folder “A” sedangkan versi yang terbaru seperti versi 1.2.0 membacanya di versi “B”. Hal seperti ini mungkin saja terjadi, meskipun jarang.</p><p>Nah terus bagaimana cara mengatasinya? sebenarnya tidak susah kita tinggal memperbarui atau mendownload ulang saja, tentunya tergantung versi micronaut yang anda pakai. Dalam kasus yang saya hadapi, saya mendownloadnya dengan cara :</p><blockquote>./gradlew compileJava</blockquote><p>atau</p><blockquote>gradle compileJava</blockquote><p>Setelah menjalankan perintah diatas, maka secara otomatis akan download file-file yang dibutuhkan sesuai versi micronaut anda pada project anda.</p><p>Ops, semua dependencies akan dijalan ulang semua lho. artinya semua yang anda pakai itu akan download semua.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*OhZZLVFW2iSaCYEOfQWGdw.jpeg" /><figcaption>belitung’s island</figcaption></figure><blockquote>Terima kasih</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ed6e448dc36" width="1" height="1" alt=""><hr><p><a href="https://medium.com/java-and-other-java-framework/unknown-micronaut-import-5ed6e448dc36">Unknown Micronaut import?</a> was originally published in <a href="https://medium.com/java-and-other-java-framework">Java and other Java Framework</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Micronaut with Sentry.io]]></title>
            <link>https://medium.com/java-and-other-java-framework/micronaut-with-sentry-io-85c4db13e6c?source=rss----c42f7186e1ce---4</link>
            <guid isPermaLink="false">https://medium.com/p/85c4db13e6c</guid>
            <category><![CDATA[java8]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[micronaut]]></category>
            <dc:creator><![CDATA[Bobby Akyong]]></dc:creator>
            <pubDate>Mon, 12 Aug 2019 08:14:05 GMT</pubDate>
            <atom:updated>2019-08-12T08:13:02.836Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FSZcUw_Jm_xKKWegt6UK_w.jpeg" /><figcaption>Tangkuban Perahu (Bandung)</figcaption></figure><p>Kali ini saya akan membahas tentang Sentry, fungsinya untuk memberitahu kita ketika service yang kita jalanin ada error atau tidak berjalan sesuai dengan yang kita inginkan, kita mendapat pemberitahuan lewat E-Mail kita. Dalam artikel ini saya akan memakai sentry atau bisa kunjungi situsnya secara langsung di <a href="https://sentry.io/">https://sentry.io</a> .</p><p>Oke Langsung to the point, <strong>pertanyaannya adalah bagaimana cara kerjanya</strong>? Dalam kasus menangani error sebenarnya ada banyak sekali caranya, namun biasanya yang paling sering dipakai oleh kalangan programmer adalah menggunakan <strong>try catch</strong>, setiap codingan yang error yang kita tulis yang terdapat dalam try maka akan dilanjutkan ke catch, saat inilah kita menanggil sentry.</p><p>Untul logging, kita akan menambahkan codingan seperti berikut pada logback.xml yang terdapat pada folder resources .</p><pre>&lt;appender name=&quot;Sentry&quot; class=&quot;io.sentry.logback.SentryAppender&quot;&gt;<br>    &lt;filter class=&quot;ch.qos.logback.classic.filter.ThresholdFilter&quot;&gt;<br>        &lt;level&gt;WARN&lt;/level&gt;<br>    &lt;/filter&gt;<br>&lt;/appender&gt;</pre><pre>&lt;root level=&quot;info&quot;&gt;<br>    &lt;appender-ref ref=&quot;STDOUT&quot; /&gt;<br>    &lt;appender-ref ref=&quot;Sentry&quot; /&gt;<br>&lt;/root&gt;</pre><p>dari codingan diatas atau settingan diatas artinya kita melakukan monitoring pada log sehingga pada log yang keluar akan ada <strong>WARN</strong> seperti berikut:</p><blockquote>[pool-1-thread-1] WARN io.sentry.DefaultSentryClientFactory</blockquote><p>Kemudian langkah selanjutnya adalah kita mengambil Client Key yang terdapat pada akun Sentry.io.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nKKaax5EncZQQ9apU6aiow.png" /><figcaption>Client Key (DSN)</figcaption></figure><p>Selanjutnya adalah cara mengimplementasikannya, dalam postingan saya kali ini, saya akan memakai codingan default dari Sentry.io. Seperti berikut:</p><pre>void logWithStaticAPI() {<br><br>    Sentry.<em>init</em>(&quot;https://8dd8b8ccf4904fd9a606f73c1e1f0322@sentry.io/1527843&quot;);<br><br>    /*<br>     Record a breadcrumb in the current context which will be sent<br>     with the next event(s). By default the last 100 breadcrumbs are kept.<br>     */<br>    Sentry.<em>getContext</em>().recordBreadcrumb(<br>            new BreadcrumbBuilder().setMessage(&quot;User made an action&quot;).build()<br>    );<br><br>    // Set the user in the current context.<br>    Sentry.<em>getContext</em>().setUser(<br>            new UserBuilder().setEmail(email).build()<br>    );<br><br>    /*<br>     This sends a simple event to Sentry using the statically stored instance<br>     that was created in the ``main`` method.<br>     */<br>    Sentry.<em>capture</em>(&quot;ERROR - TEST SEDERHANA&quot;);<br><br>    try {<br>        unsafeMethod();<br>    } catch (Exception e) {<br>        // This sends an exception event to Sentry using the statically stored instance<br>        // that was created in the ``main`` method.<br>        Sentry.<em>capture</em>(e);<br>    }<br>}</pre><pre>void unsafeMethod() {<br>    throw new UnsupportedOperationException(&quot;You shouldn&#39;t call this!&quot;);<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*bcka6eD1cYsY5zQOfOdlYA.png" /><figcaption>Contoh</figcaption></figure><p>Ketika berhasil, maka kita akan mendapat email dari sentry, tentunya dengan log detail, keterangan errornya dikarenakan apa.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vaYEMcLVkeL9Sul9fEhsrg.png" /><figcaption>Email from Sentry.io</figcaption></figure><p>Sebagai tambahan, contoh codingan atau sample projectnya bisa dilihat di <a href="https://github.com/akyong/micronaut-sentry">https://github.com/akyong/micronaut-sentry</a></p><p>Terima kasih sudah membaca.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85c4db13e6c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/java-and-other-java-framework/micronaut-with-sentry-io-85c4db13e6c">Micronaut with Sentry.io</a> was originally published in <a href="https://medium.com/java-and-other-java-framework">Java and other Java Framework</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cara menggunakan MappedBy pada relationship entity]]></title>
            <link>https://medium.com/java-and-other-java-framework/cara-menggunakan-mappedby-pada-relationship-entity-60a86dc25a10?source=rss----c42f7186e1ce---4</link>
            <guid isPermaLink="false">https://medium.com/p/60a86dc25a10</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[hibernate-jpa]]></category>
            <category><![CDATA[jpa]]></category>
            <category><![CDATA[hibernate]]></category>
            <dc:creator><![CDATA[Bobby Akyong]]></dc:creator>
            <pubDate>Tue, 07 May 2019 04:39:09 GMT</pubDate>
            <atom:updated>2019-05-07T04:37:59.472Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*Mablbz_Uff7nacSBTs6bHw.jpeg" /><figcaption>Candi Borobudur — Akyong</figcaption></figure><p>Sesuai judul, kali ini saya akan membahas tentang bagaimana cara menggunakan mappedBy ketika kita menggunakan relasi diantara kedua table, tentunya OneToMany atau ManyToOne.</p><p>MappedBy ini digunakan untuk mapping kepada suatu entity pada classs tertentu. Misalnya pada Class KelompokMahasiswa dan ClassMahasiswa .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/351/1*TxRK848i_1YgDrDXZofhXA.png" /><figcaption>Contoh Relasi Table</figcaption></figure><p>Jika kita mengimplementasikan kedua Class diatas maka pada kode program kita akan seperti berikut :</p><pre>@Entity<br>public class KelompokMahasiswa {<br>    @OneToMany(fetch = FetchType.<em>LAZY</em>, mappedBy = &quot;kelompokMahasiswa&quot;)<br>    private List&lt;Mahasiswa&gt; mahasiswaList;</pre><pre>    ...</pre><pre>}<br><br>@Entity<br>public class Mahasiswa {<br>    @ManyToOne(fetch = FetchType.<em>LAZY</em>)<br>    @JoinColumn(name = &quot;kelompok_mahasiswa_id&quot;)<br>    private KelompokMahasiswa kelompokMahasiswa;<br>    <br>    ...</pre><pre>}</pre><p>Pada Class KelompokMahasiswa, kita bisa mendapatkan Mahasiswa yang terdapat pada kelompok tertentu sedangkan pada Class Mahasiswa , kita bisa tahu bahwa mahasiwa tersebut termasuk pada kelompok yang mana.</p><p>Terima Kasih, sekian penjelasan dari saya, bila ada pertanyaan silakan tanya pada kolom komentar.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60a86dc25a10" width="1" height="1" alt=""><hr><p><a href="https://medium.com/java-and-other-java-framework/cara-menggunakan-mappedby-pada-relationship-entity-60a86dc25a10">Cara menggunakan MappedBy pada relationship entity</a> was originally published in <a href="https://medium.com/java-and-other-java-framework">Java and other Java Framework</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java Put Variable inside a String]]></title>
            <link>https://medium.com/java-and-other-java-framework/java-put-variable-inside-a-string-2791ff73c3c9?source=rss----c42f7186e1ce---4</link>
            <guid isPermaLink="false">https://medium.com/p/2791ff73c3c9</guid>
            <category><![CDATA[java-7]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[java8]]></category>
            <dc:creator><![CDATA[Bobby Akyong]]></dc:creator>
            <pubDate>Fri, 05 Apr 2019 11:02:22 GMT</pubDate>
            <atom:updated>2019-04-05T11:01:33.142Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*EKb_TBzZxROIXmAss2t-sg.png" /></figure><p>Kali ini saya akan membahas tentang format String pada Java.</p><p>Biasanya kita mendeklarasikan sebuah variable string seperti berikut:</p><pre>String variable = &quot;Saya suka kamu&quot;;</pre><p>tapi bagaimana jika saya ingin membuat kamu menjadi sebuah variable yang dimana saya bisa mengubah kata kamu sesuai kebutuhan?</p><p>Dalam Java terdapat beberapa cara, contohnya menggunakan Regex/ regular expression, replace juga merupakan salah satu cara, akan tetapi diluar kedua cara ini masih ada banyak cara. Diartikel kali ini saya akan membahas 2 cara yaitu:</p><ol><li>String.format();</li><li>MessageFormat.forma();</li></ol><p>Lalu bagaimana cara menggunakannya?</p><p>Saya akan membuat sebuah contoh :</p><p><strong>String.format();</strong></p><pre>String kalimat = &quot;Saya suka %s&quot;;<br>String hasil = String.<em>format</em>(kalimat,&quot;Akyong&quot;);<br>// hasilnya menjadi &quot;Saya suka Akyong&quot;</pre><p>variable ini kita menggunakan %s lalu bagaimana jika variablenya lebih dari 1? jika menggunakan variable lebih dari satu maka harus menggunakan %1$s yang sama dengan variable String pertama, %2$s variable string kedua, dan seterusnya, jika Integer maka menggunakan %d atau %1$d jika multiple variable.</p><p>Sedangkan <strong>MessageFormat.format();</strong></p><pre>String kalimat = &quot;Saya suka {0}&quot;;<br>String hasil = MessageFormat.<em>format</em>(kalimat,&quot;Akyong&quot;);<br>// hasilnya menjadi &quot;Saya suka Akyong&quot;</pre><p>Dengan cara ini lebih mudah, kita tinggal membuatnya menjadi {0} untuk variable pertama, untuk variable kedua maka {1} dan seterusnya.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IpCKnQF9E7PD-a9hAAsZAg.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2791ff73c3c9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/java-and-other-java-framework/java-put-variable-inside-a-string-2791ff73c3c9">Java Put Variable inside a String</a> was originally published in <a href="https://medium.com/java-and-other-java-framework">Java and other Java Framework</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ForEach dengan Multiple List]]></title>
            <link>https://medium.com/java-and-other-java-framework/foreach-dengan-multiple-list-e15c5c95f19?source=rss----c42f7186e1ce---4</link>
            <guid isPermaLink="false">https://medium.com/p/e15c5c95f19</guid>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[java8]]></category>
            <dc:creator><![CDATA[Bobby Akyong]]></dc:creator>
            <pubDate>Mon, 11 Mar 2019 07:26:39 GMT</pubDate>
            <atom:updated>2019-03-08T09:15:28.176Z</atom:updated>
            <content:encoded><![CDATA[<p>Sebelumnya kita sudah membahas tentang cara menggunkana ForEach pada Java 8, tapi bagaimana kalau kondisinya kita ingin melakukan pengulangan berdasarkan 2 List?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*9oqe-Ki9xMD5Rjx-Dt297w.jpeg" /><figcaption>ForEach</figcaption></figure><p>sebenarnya ada banyak cara tapi kita akan membahas tentang foreach, sekaligus saya akan membandingkannya dengan beberapa cara lain.</p><p>Cara 1 :</p><pre>List&lt;String&gt; namaMahasiswa = new ArrayList&lt;&gt;();<br>        namaMahasiswa.add(&quot;Akyong&quot;);<br>        namaMahasiswa.add(&quot;Bobby&quot;);<br>        namaMahasiswa.add(&quot;Jeni&quot;);<br>        namaMahasiswa.add(&quot;Johan&quot;);<br>        <br>        List&lt;Integer&gt; usiaMahasiswa = new ArrayList&lt;&gt;();<br>        usiaMahasiswa.add(20);<br>        usiaMahasiswa.add(22);<br>        usiaMahasiswa.add(27);<br>        usiaMahasiswa.add(30);<br>        <br>        for(int a=0;a&lt;namaMahasiswa.size();a++){<br>            System.out.println(&quot;Nama Mahasiswa: &quot;+namaMahasiswa.get(a)+&quot;, Usia:&quot;+usiaMahasiswa.get(a));<br>        }</pre><p>cara ini sudah tidak asing lagi bagi kita semua, namun cara ini sudah ada sejak lama.</p><p>Cara 2 :</p><pre>int index = 0;<br>        for(String nama: namaMahasiswa){<br>            System.out.println(&quot;Nama Mahasiswa: &quot;+nama+&quot;, Usia: &quot;+usiaMahasiswa.get(index));<br>            index++;<br>        }</pre><p>Cara 3 :</p><pre>IntStream.range(0, namaMahasiswa.size()).forEach(idx-&gt;{<br>            System.out.println(&quot;Nama Mahasiswa: &quot;+namaMahasiswa.get(idx)+&quot;, Usia: &quot;+usiaMahasiswa.get(idx));<br>        });</pre><p>Ketiga cara diatas sama-sama bisa digunakan untuk multiple list namun jika anda menggunakan <strong>Java 8 kebawah maka anda tidak bisa menggunakan cara ketiga. </strong>Cara ini saya menggunakan <strong><em>IntStream </em></strong>dengan range dari 0~ukuran namaMahasiswa .</p><p>Download/lihat projectnya di <a href="https://github.com/akyong/ForEach---Mulitiple-List">https://github.com/akyong/ForEach---Mulitiple-List</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e15c5c95f19" width="1" height="1" alt=""><hr><p><a href="https://medium.com/java-and-other-java-framework/foreach-dengan-multiple-list-e15c5c95f19">ForEach dengan Multiple List</a> was originally published in <a href="https://medium.com/java-and-other-java-framework">Java and other Java Framework</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tipe Data pada Bahasa Pemrograman JAVA]]></title>
            <link>https://medium.com/java-and-other-java-framework/tipe-data-pada-bahasa-pemrograman-java-99ef92706c95?source=rss----c42f7186e1ce---4</link>
            <guid isPermaLink="false">https://medium.com/p/99ef92706c95</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[tipe-data]]></category>
            <dc:creator><![CDATA[Bobby Akyong]]></dc:creator>
            <pubDate>Mon, 11 Mar 2019 07:26:28 GMT</pubDate>
            <atom:updated>2019-03-06T03:59:31.934Z</atom:updated>
            <content:encoded><![CDATA[<p>Belajar bahasa pemrograman harus mengenal tipe data terlebih dahulu? ya pasti! Dalam artikel ini saya akan membahas tipe data yang harus diketahui jika ingin menjadi programmer java. Jadi ada apa saja tipe data yang ada pada java?</p><p>Dalam Bahasa pemrograman Java, terbagi atas 2 jenis tipe data yakni :</p><ol><li>Tipe Data Primitif</li><li>Tipe Data Reference/referensi</li></ol><p>Tipe Data Primitif adalah tipe data yang hanya dapat menampung sebuah nilai, sedangkan tipe data referensi dapat menampung sebuah object, seperti Class, String dan Array.</p><p>Tipe Data Primitif meliputi :</p><ol><li>Byte → Hanya menampung Angka</li><li>Short → Hanya menampung Angka</li><li>Int → Hanya menampung Angka</li><li>Long → Hanya menampung Angka</li><li>Float →Menampung angka dengan pecahan desimal, misalnya 1,2</li><li>Double →Mirip seperti Float namun jangkauannya lebih luas</li><li>Char →Hanya menampung karakter/huruf</li><li>Boolean →hanya menampung nilai true dan false</li></ol><p>Tipe Data Reference/referensi meliputi :</p><ol><li>String → manampung list of character</li><li>Interface → hanya menampung deklarasi dan struktur method</li><li>Array → nampung list data</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99ef92706c95" width="1" height="1" alt=""><hr><p><a href="https://medium.com/java-and-other-java-framework/tipe-data-pada-bahasa-pemrograman-java-99ef92706c95">Tipe Data pada Bahasa Pemrograman JAVA</a> was originally published in <a href="https://medium.com/java-and-other-java-framework">Java and other Java Framework</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integer vs int]]></title>
            <link>https://medium.com/java-and-other-java-framework/integer-vs-int-9898c07f39f7?source=rss----c42f7186e1ce---4</link>
            <guid isPermaLink="false">https://medium.com/p/9898c07f39f7</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[tipe-data-java]]></category>
            <category><![CDATA[tipe-data]]></category>
            <dc:creator><![CDATA[Bobby Akyong]]></dc:creator>
            <pubDate>Mon, 11 Mar 2019 07:26:18 GMT</pubDate>
            <atom:updated>2019-02-27T07:18:50.720Z</atom:updated>
            <content:encoded><![CDATA[<p>Integer dan int, sering kali kita beranggapan bahwa kedua ini adalah sama, sebenarnya berbeda. Kali ini saya akan membahas tipe data-tipe data yang ada pada java terlebih dahulu.</p><p>Di Java sendiri terdapat 11 tipe data yang terbagi dalam tipe data <strong>sederhana</strong> dan tipe data <strong>referensi/komposif.</strong></p><p>Tipe data sederhana meliputi :</p><ol><li>Byte</li><li>Short</li><li><strong>Int</strong></li><li>Long</li><li>Char</li><li>Float</li><li>Boolean</li><li>Double</li></ol><p>Tipe data referensi/komposif :</p><ol><li>Class</li><li>Array</li><li>Interface</li></ol><p>Jadi kita akan membahas Integer, Integer dan int sama-sama menampung nilai yang berupa bilangan bulat, tapi apa bedanya?</p><p>Sebenarnya <strong>Integer</strong> itu sendiri ada anaknya yaitu <strong>Byte</strong>, <strong>Short</strong>, <strong>int</strong> dan <strong>Long. </strong>Berikut ukurannya.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*p5aMpvPSBYShaHR7uFZKag.jpeg" /><figcaption>range of tipe data Byte, short, int dan long</figcaption></figure><p>nah sudah sedikit jelaskan? lalu apa bedanya? kapan kita pakai <strong>int </strong>dan kapan kita pakai <strong>Integer?</strong></p><p>Perbedaannya adalah di <strong>Min</strong> dan <strong>Max </strong>value yang dapat ditampung. <strong>Integer</strong> biasanya dipakai untul low values karena range <strong>Integer</strong> dari <strong>-128 ~ 127</strong> , sedangkan <strong>int</strong> nilai yang dapat ditampung seperti foto yang tertera diatas yaitu <strong>-2147483648 ~ 2147483647.</strong></p><p>Selain dari sisi ini, int tidak bisa menampung nilai null sedangkan Integer bisa menampung nilai null. Jadi kesimpulannya adalah ketika ada kemungkinan null maka kita harus pakai Integer, “<em>Consider using Integer when you need to represent the absence of the value null</em>”.</p><p>Sedikit tambahan, ketika ingin ada kemungkinan value null maka codingan harus seperti ini Integer.valueOf(int) . Sekali lagi, <strong>Integer</strong> bisa menampung value <strong>null</strong> sedangkan <strong>int</strong> tidak bisa menampung value <strong>null.</strong></p><p>Sekian dan terima kasih. Jika artikel ini membantu wawasan jangan lupa like dan share ya, saya akan terus menulis untuk berbagi ilmu yang saya pelajari dilapangan kerja.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9898c07f39f7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/java-and-other-java-framework/integer-vs-int-9898c07f39f7">Integer vs int</a> was originally published in <a href="https://medium.com/java-and-other-java-framework">Java and other Java Framework</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>