Skip to content
Thorben Janssen
  • BlogExpand
    • Tutorials
    • Hibernate Tips
    • Video Tutorials
  • Persistence Hub
  • Workshops
  • Consulting
  • Book
  • AboutExpand
    • About
    • Talks
    • Contact
Sign In
Thorben Janssen

Sql

  • Native Queries – How to call native SQL queries with JPA & Hibernate
    JPA | Featured | Hibernate Performance | JPA2.1

    Native Queries – How to call native SQL queries with JPA & Hibernate

    ByThorben Janssen

    The Java Persistence Query Language (JPQL) is the most common way to query data from a database with JPA. It enables you to reuse your mapping definitions and is easier to use than SQL. But it supports only a small subset of the SQL standard, and it also provides no support for database-specific features. So…

    Read More Native Queries – How to call native SQL queries with JPA & HibernateContinue

  • How to Use Named Queries with Spring Data JPA
    Spring Data JPA

    How to Use Named Queries with Spring Data JPA

    ByThorben Janssen

    Spring Data JPA provides various options to define and execute queries. All of them use JPA’s query capabilities but make them a lot easier to use. You can: reference a named native or JPQL query, derive queries from the name of a repository method and declare a query using the @Query annotation. I already explained…

    Read More How to Use Named Queries with Spring Data JPAContinue

  • Ultimate Guide: Custom Queries with Spring Data JPA’s @Query Annotation
    Spring Data JPA

    Ultimate Guide: Custom Queries with Spring Data JPA’s @Query Annotation

    ByThorben Janssen

    Derived queries are very comfortable to use as long as the queries are not too complicated. But as soon as you use more than 2-3 query parameters or need to define multiple joins to other entities, you need a more flexible approach. In these situations, you better use Spring Data JPA’s @Query annotation to specify…

    Read More Ultimate Guide: Custom Queries with Spring Data JPA’s @Query AnnotationContinue

  • Why, When and How to Use DTO Projections with JPA and Hibernate
    Hibernate Beginner | JPA

    Why, When and How to Use DTO Projections with JPA and Hibernate

    ByThorben Janssen

    DTOs are easy to use and the most efficient projection for read-only operations. So, whenever you don’t need to change the requested information, you should prefer a DTO projection. But what exactly is a DTO? How does such a projection work with Hibernate? And how can you use it in your queries? I will answer…

    Read More Why, When and How to Use DTO Projections with JPA and HibernateContinue

  • 5 tips to write efficient queries with JPA and Hibernate
    JPA | Hibernate Performance

    5 tips to write efficient queries with JPA and Hibernate

    ByThorben Janssen

    A lot of developers seem to have a love-hate relationship with JPA and Hibernate. They love it because it makes it easy to implement most use cases and they hate it because it also makes it easy to implement very inefficient queries. In the past, I was one of these developers myself. I liked to…

    Read More 5 tips to write efficient queries with JPA and HibernateContinue

Page navigation

1 2 3 Next PageNext

Join the Newsletter

Join 10k+ subscribers to get a persistence tip every weekday.

I will collect, use and protect your data in accordance with my privacy policy.

Level up your skills!

  • In-depth courses
  • Expert sessions
  • Monthly persistence news
Learn more!
Twitter YouTube Github Facebook Xing Linkedin
  • Disclaimer
  • Privacy Policy
  • Terms of Service
  • Imprint
  • Contact
  • Change privacy settings
  • Privacy settings history
  • Revoke consents

© 2025 Thorben Janssen, all rights reserved.

  • Blog
    • Tutorials
    • Hibernate Tips
    • Video Tutorials
  • Persistence Hub
  • Workshops
  • Consulting
  • Book
  • About
    • About
    • Talks
    • Contact
Search