Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7878349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:38:02+00:00 2026-06-03T03:38:02+00:00

Consider a read-only service that needs to do real time searching of a backing

  • 0

Consider a read-only service that needs to do real time searching of a backing database. The service needs to be able to generate fairly complex select queries to generate summaries, reports, and results based on multi-table objects. The priorities for the library/framework selection are performance (of the sql), maintainability, and longevity.

Hibernate – Seems to require “tricks” to get it to generate the correct SQL, The Criteria API looks promising but also has several limitations when it comes to arbitrary queries.

MyBatis – No Criteria-like API but it’s clear and clean and often doesn’t require the tricks and tweeks of Hibernate. Limited database abstraction.

Some other yet-to-be-evaluated solutions include: SQLBuilder, Squiggle, Querydsl, JOOQ, or a custom solution.

What have SO users found works best for making a fast versatile searching service.

[update] – Some of the tricks and issues I have faced with Hibernate are…

  • https://hibernate.onjira.com/browse/HHH-879
  • https://hibernate.onjira.com/browse/HHH-5291
  • How to apply Where clause to secondary table
  • https://forum.hibernate.org/viewtopic.php?f=1&t=973514

In general, joining to the same table twice seems to cause problems. I’ve even managed to trick hibernate into producing the correct SQL only to have it map the results wrong because it cached the first instance of the entity and assumed the columns from the second join where redundant. Conditional joins expressed via annotations is also painful. Not saying it’s impossible but very cryptic and not intuitive.

To answer X-Zero below I am wanting to go from a specification to a result. Ie, the consumer tells me what they know, and I build a query that answers their question on-the-fly. In practice I intend to have some limits on what they can pass in.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:38:03+00:00Added an answer on June 3, 2026 at 3:38 am

    For a query-oriented service I’d strongly recommend to stay away from Hibernate or similar JPA frameworks. MyBatis can be a good choice and it provides some basic scripting support for dynamically constructing queries from SQL fragments, but you’ll have to deal with SQL dialects yourself.

    Also, to add to your list, there are also Spring SQL Template classes and JDBI, though neither of them address issue with SQL dialects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider a notepad Text.txt which has a data that can be read only with
Consider the following simple C program that read a file into a buffer and
Consider the following SQL: BEGIN TRAN SET TRANSACTION ISOLATION LEVEL READ COMMITTED INSERT Bands
I've been looking for a way to create a read-only form field and every
Consider following tables in MySQL database: entries: creator_id INT entry TEXT is_expired BOOL other:
I read the other password recovery questions on SO and it seems that most
Got some doubts with bottom half.Here, I consider tasklets only. Also , I consider
I've read here that matplotlib is good at handling large data sets. I'm writing
I have what I'd consider a standard .NET MVC3 Repository pattern project that I've
I am designing a web API which requires fast read only access to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.