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

  • Home
  • SEARCH
  • 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 8327901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:16:11+00:00 2026-06-09T01:16:11+00:00

I have the following requirement, I need to expose an API where the user

  • 0

I have the following requirement,
I need to expose an API where the user can send a free form ‘query’ like expression and I need to return true/false.
ex: For a car object, if the query is

" (make = 'FORD' AND year IN (1990,1991)) OR type = 'SUV') ".

However, ‘make’ ‘year’ or ‘type’ comes from a table which is populated externally.

TABLE CAR_PROPERTIES (
 propertyName VARCHAR2(40),
 propertyValue VARCHAR2(10)
)

There are other join tables which I traverse first to load the properties.

So, if there is a new property (and corresponding value), I need to support in the query.

As of now, this is what I did:

  1. If there is no requirement to add dynamic properties to a class, I know I
    can use some thing like JoSQL on my collection.

  2. I looked into creating the class dynamically once the application starts using Java Tools API or javaassist.

Client is insisting on a solution which doesn’t require adding new properties and deploying the code (though the ‘caller’ of this API does need code changes in order to use the new properties in the query).

I don’t like creating new Class dynamically. Looking for any pointers or solutions.

  • 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-09T01:16:13+00:00Added an answer on June 9, 2026 at 1:16 am

    Raj – just few recommendations and inspirations for your design:

    1. Would not even do a full O/R mapping. I would considering translating your domain specific language into SQL. I’ve done such a thing in Python. It is much easier because you are doing language-to-language translation between two easy languages (custom DSL and SQL). With robust regular expressions you can have a very concise and powerful framework for handling this kinds of interactions. (see Regex Table Lexer and other patterns)

    2. There are some interesting designs to look into:

      • OData API allows users to use RESTful “algebra” to query data using customer expressions OData4J handles mapping
        http://code.google.com/p/odata4j/

      • QueryDSL:
        http://blog.mysema.com/2011/01/querying-in-sql-with-querydsl.html

      • SQLDSL:
        http://code.google.com/p/sql-dsl/

    3. For dynamic relationship and property expressions I suggest (embedded) graph data structures
      Here is a helpful tutorial that shows rel-to-graph mappings:
      http://py2neo.org/tutorials/tables_to_graphs
      and just a tutorial on Neo4J which I use for similar purposes:
      http://docs.neo4j.org/chunked/stable/tutorials.html

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

Sidebar

Related Questions

I have the following requirement: Based on some user input, I need to generate
I have the following requirement for creating a user profile in my application: User
I have the following Query and i need the query to fetch data from
In my web-application I have a the following requirement. I need to have a
I am developing an application where i need the following requirement: Suppose i have
I have the following requirement. I need to implement dll kind of thing on
I have the following requirement. I need to prevent not admin users exit the
I have the following requirement: In case the user push one of the paginator
I have a need for a counter of type long with the following requirements/facts:
I have following requirement, I have C#/.Net console application, which refers to 'System.Data.Sqlite.dll' 'System.Data.Sqlite.dll'

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.