Excited to share Querier, our new open-source Java project for type-safe SQL building. If you work with Java and SQL, you know how quickly queries can become hard to read, hard to maintain, and even harder to refactor safely. Querier is designed to make that experience cleaner by helping you build SQL in a way that is more expressive, safer, and easier to evolve. Query execution agnostic, Querier can be used with most Java DB frameworks such as: Spring JDBC, Hibernate native query, jOOQ, R2DBC, Vert.x SQL... We built this project to make SQL feel more natural in Java while keeping type safety front and center. Check it out on GitHub: https://lnkd.in/duBA-X3x Project page: https://lnkd.in/dkNFKnsm #Java #OpenSource #SQL #SoftwareEngineering #BackendDevelopment #GitHub
Querier: Type-Safe Java SQL Building
More Relevant Posts
-
Was working on a Spring Boot REST API the other day. Everything looked fine entity class, repository, controller all set up. But two fields, createdAt and updatedAt, were coming back null in every response. Spent time checking the constructor, the DTO mapping, the database config. Turns out I just needed two annotations: @CreationTimestamp → auto-sets the time when record is created @UpdateTimestamp → auto-updates the time on every save Two lines. That's it. Hibernate handles everything behind the scenes you don't set these manually. One more thing I'd missed without @JsonFormat, Java's Timestamp serializes weirdly in JSON. Add this and it formats cleanly: @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") Small things. But they'll silently break your API if you miss them. #Java #SpringBoot #Backend #LearningInPublic #HibernateJPA
To view or add a comment, sign in
-
-
🚀 Day 3 of My Advanced Java Journey — Going Deeper into JDBC! Continuing my journey in Advanced Java, today I explored some powerful JDBC concepts that are widely used in real-world applications. 📚 What I Learned Today: 🔹 CallableStatement Learned how to call stored procedures from Java, making database operations more efficient and reusable. 🔹 ResultSet & Its Types Understood how data is retrieved and processed using ResultSet. Explored different types like: 👉 Forward Only 👉 Scrollable (Insensitive & Sensitive) 🔹 Types of JDBC Drivers Learned about different driver types and how they work: 1️⃣ JDBC-ODBC Bridge 2️⃣ Native API Driver 3️⃣ Network Protocol Driver 4️⃣ Thin Driver (Pure Java) 💡 Key Takeaway: Understanding how JDBC works internally (drivers, result handling, stored procedures) helps in writing efficient, scalable, and production-ready backend code. 🎯 Goal: To master Advanced Java and build strong backend systems with optimized database interactions. 📅 Continuing my Daily Advanced Java Learning Series Stay tuned for Day 4 🔥 #Java #AdvancedJava #JDBC #CallableStatement #ResultSet #JDBCDrivers #LearningInPublic #100DaysOfCode #BackendDevelopment #JavaDeveloper #StudentDeveloper #CareerGrowth
To view or add a comment, sign in
-
-
🚀 Day 7/45 – Backend Engineering (JPA & Hibernate) Most performance issues in backend apps don’t come from logic — they come from how data is fetched from the database. Today I focused on one of the most common JPA pitfalls: ❗ The N+1 Query Problem 💡 What happens: You fetch a list of entities (1 query) For each entity, JPA triggers another query for related data Result → 1 + N queries 👉 This can silently kill performance in production. 🔍 Example: Fetching a list of users and their orders: 1 query for users N queries for orders ❌ 🔧 Fix: Use JOIN FETCH Use Entity Graphs Choose fetch type wisely (LAZY vs EAGER) 🛠 Practical: Tested API behavior with lazy loading and saw how queries multiplied without optimization. 📌 Real-world impact: Ignoring this leads to: Slow APIs High DB load Poor scalability 🔥 Takeaway: ORMs don’t guarantee performance. You must understand what queries are actually being executed. Currently building a production-ready backend system — sharing real backend lessons daily. https://lnkd.in/gJqEuQQs #Java #SpringBoot #Hibernate #BackendDevelopment #Performance #LearningInPublic
To view or add a comment, sign in
-
Is FetchType.EAGER silently killing your performance? 🚨 One mistake I’ve seen repeatedly in Spring Boot applications is overusing EAGER fetching. Looks harmless… until it hits production. The problem 👇 Every time you fetch a parent entity, Hibernate also loads the entire child collection. Now imagine: → A user with 5,000 orders → A department with 50,000 employees Your “simple query” just became a massive memory load. This doesn’t just slow things down… it stresses your entire JVM. What I follow instead 👇 ✔ Default to LAZY ✔ Use JOIN FETCH when needed ✔ Use @EntityGraph for controlled fetching Your entity design is not just structure. It’s a performance decision. Better to write 1 extra query… than load 10,000 unnecessary records. Curious to hear from other devs 👇 Do you treat FetchType.EAGER as a bad practice? Or still use it in some cases? #Java #SpringBoot #JPA #Hibernate #BackendDevelopment #SoftwareEngineering #Performance #TechDiscussion
To view or add a comment, sign in
-
-
Spring Boot's OSIV default turns your JSON serializer into a hidden query engine I'm building a personal finance platform with Spring Boot 3.5 + Java 21. The first thing I disabled was Open Session in View. Spring Boot ships with spring.jpa.open-in-view=true. That means Hibernate keeps a database connection open through the entire HTTP request - including JSON serialization. When Jackson walks your entity graph to build a response, every uninitialized lazy relationship triggers a database query. Your serializer is now executing SQL. In a load test with HikariCP's default pool of 10 connections and around 150 concurrent requests, this is where things break. Each request holds a connection for the full request lifecycle instead of just the service layer. The pool exhausts, threads queue up, and response times spike. The tricky part is that it works fine in dev when you're the only user. Disabling OSIV forces you to think about what data you actually need. You fetch it explicitly in the service layer with JOIN FETCH or projections, map it to a DTO, and the connection goes back to the pool before serialization even starts. It's more code upfront but the data flow becomes visible instead of hidden behind proxy magic. The second thing I changed was ddl-auto. Hibernate's update mode can generate schema changes automatically, but it can't rename columns, drop unused indexes, or migrate data. It produces a schema that looks right but drifts from what you intended. I use validate with Flyway migrations instead - every schema change is an explicit, versioned SQL file. If the code and the database disagree, the app refuses to start rather than silently diverging. These two defaults share the same problem. They hide complexity that surfaces as production issues. OSIV hides query execution. ddl-auto update hides schema drift. In both cases, making the behavior explicit costs more effort early but removes an entire class of debugging later. #SpringBoot #Java #BuildInPublic #BackendDevelopment
To view or add a comment, sign in
-
Day 3 – Tech Stack Tech Stack used in my project: Java Spring Boot Spring Data JPA MySQL REST APIs Focused on building a scalable backend system. #TechStack #Backend
To view or add a comment, sign in
-
🚀 Evolution of Database Interaction in Java (🔧➡️⚙️➡️🚀) It’s fascinating how the “most natural way” to work with databases has evolved over time 👇 🔹 JDBC You write everything manually—queries, connections, result parsing. Full control, but a lot of boilerplate. 🔹 Hibernate ORM We move to object mapping. Less SQL, more Java objects. Cleaner, but still requires configuration and understanding ORM behavior. 🔹 Spring Boot with JPA Things get easier. Auto-configuration, reduced setup, better integration. Focus shifts more toward business logic. 🔹 Spring Data JPA (Repository methods) 🤯 Now this feels like magic! Define methods → Framework generates queries → Minimal SQL needed. 👉 From writing complex SQL to just defining method names… we’ve come a long way. 💡 But here’s the reality: Every layer matters. Understanding JDBC and SQL makes you a stronger developer—even when using high-level abstractions. 📌 Abstraction reduces effort, but fundamentals build mastery. What’s your preferred way of interacting with databases? 👇 #Java #SpringBoot #JPA #Hibernate #BackendDevelopment #SoftwareEngineering #LearningJourney
To view or add a comment, sign in
-
-
#Post4 In the previous post, we understood how request mapping works using @GetMapping and others. Now the next question is 👇 How does Spring Boot handle data sent from the client? That’s where @RequestBody comes in 🔥 When a client sends JSON data → it needs to be converted into a Java object. Example request (JSON): { "name": "User", "age": 25 } Controller: @PostMapping("/user") public User addUser(@RequestBody User user) { return user; } 👉 Spring automatically converts JSON → Java object This is done using a library called Jackson (internally) 💡 Why is this useful? • No manual parsing needed • Clean and readable code Key takeaway: @RequestBody makes it easy to handle request data in APIs 🚀 In the next post, we will understand @PathVariable and @RequestParam 🔥 #Java #SpringBoot #BackendDevelopment #RESTAPI #LearnInPublic
To view or add a comment, sign in
-
🔍 Since I have plenty of time, I was building a tool that indexes every hardcoded constant in your Java bytecode and config files — and diffs them across versions. Ever had to answer "where is this SQL string used?" or "what changed between our last two releases?" across a large multi-module codebase? That's the problem I set out to solve. Constant Tracker parses JVM class files, classifies constants by semantic type (SQL, URL, logging, file path, error message, annotation), and indexes everything into Solr for full-text search. The version diff feature is my favourite part: upload two finalized JARs and see exactly which constants were added, removed, or changed — per class, with full usage context. Tech: Java 25 · Spring Boot 3 WebFlux · Solr 10 · Redis · Postgres · React 19 · Docker Compose 3-command quickstart with pre-seeded demo data included. 🔗 GitHub: https://lnkd.in/dzqxKGHP #java #springboot #solr #postgres #redis #react #githubcopilot
To view or add a comment, sign in
-
-
Stack vs Heap Memory in Java – Where Does Your Data Live? 🧠 Stack Memory: ▸ Method calls + local variables ▸ LIFO (Last In, First Out) ▸ Very fast, auto-cleared after method ends ▸ Each thread has its own stack Heap Memory: ▸ Stores objects & instance variables ▸ Shared across threads ▸ Managed by Garbage Collector ▸ Slower than Stack, can throw OutOfMemoryError Example: void demo() { int x = 10; String s = new String("Java"); } ▸ x → Stack ▸ s (reference) → Stack ▸ "Java" object → Heap Rule: → Primitives → Stack → References → Stack → Objects → Heap #Java #SpringBoot #BackendDevelopment #Memory #JavaDeveloper
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development