Sign in to save your query history

JPQL ⇄ SQL Converter

Convert between JPQL and SQL queries instantly with proper case conversion

JPQL SQL

Examples

Example 1: Simple Entity Query
JPQL:
SELECT u FROM UserEntity u WHERE u.isActive = true
SQL:
SELECT u FROM user_entity u WHERE u.is_active = true
Example 2: Join Query with Parameters
JPQL:
SELECT o FROM OrderEntity o JOIN o.customerInfo c WHERE c.customerId = :customerId
SQL:
SELECT o FROM order_entity o JOIN o.customer_info c WHERE c.customer_id = :customerId
Example 3: Complex Query with Multiple Conditions
JPQL:
SELECT p FROM ProductEntity p WHERE p.productPrice > :minPrice AND p.categoryType = :category ORDER BY p.createdDate DESC
SQL:
SELECT p FROM product_entity p WHERE p.product_price > :minPrice AND p.category_type = :category ORDER BY p.created_date DESC

Frequently Asked Questions

What is JPQL?
JPQL (Java Persistence Query Language) is a platform-independent object-oriented query language defined as part of the Java Persistence API (JPA). It's used to make queries against entities stored in a relational database.
How does this converter work?
The converter transforms naming conventions between JPQL (camelCase) and SQL (snake_case). It preserves query structure, parameters, and keywords while only changing the case format of entity and field names.
Does it preserve named parameters?
Yes! Named parameters like :userId or :customerId are preserved exactly as written during conversion. Only entity and field names are converted between camelCase and snake_case.
What's the difference between JPQL and SQL?
JPQL operates on Java objects and their relationships, using Java naming conventions (camelCase), while SQL operates directly on database tables using database naming conventions (typically snake_case). JPQL is database-independent, while SQL syntax can vary between database systems.
Can I use this for complex queries?
Yes! The converter handles complex queries including JOINs, subqueries, aggregate functions, and multiple WHERE conditions. It intelligently converts naming conventions while preserving SQL keywords and query structure.
Is this tool free to use?
Yes, this JPQL to SQL converter is completely free to use. No registration, no limits, and no hidden fees. You can convert as many queries as you need.

Found this tool helpful? Give it a star on GitHub!

Star