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 9148363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:15:05+00:00 2026-06-17T11:15:05+00:00

The current code: CriteriaQuery criteriaQuery = cb.createQuery(MinutisPreke.class); Root<MinutisPreke> from = criteriaQuery.from(MinutisPreke.class); Join<LankomumasDiena, MinutisPreke> ld

  • 0

The current code:

CriteriaQuery criteriaQuery = cb.createQuery(MinutisPreke.class);
Root<MinutisPreke> from = criteriaQuery.from(MinutisPreke.class);
Join<LankomumasDiena, MinutisPreke> ld = from.join("lankomumasDiena", JoinType.LEFT);
cb.and(cb.equal(ld.get("intervalas"), 7));

generates the following query:

SELECT COUNT(t0.pr_id) FROM preke AS t0 
LEFT OUTER JOIN lankomumas AS t1 
ON (t1.pr_id = t0.pr_id) 
WHERE (t1.intervalas = 7)

How to add statement in the LEFT OUTER JOIN ON clause using criteria query so my code would generate this query:

SELECT COUNT(t0.pr_id) FROM preke AS t0 
LEFT OUTER JOIN lankomumas AS t1 
ON (t1.pr_id = t0.pr_id) AND (t1.intervalas = 7)

EDIT 1:
If you don’t see any difference in first and second querys, please read this thread:
SQL join: where clause vs. on clause

  • 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-17T11:15:06+00:00Added an answer on June 17, 2026 at 11:15 am

    EclipseLink added support for the ON clause in a 2.5 nightly build as described here:
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=367452
    but it is not a part of the JPA specification so you will need to cast the Join to EclipseLink’s org.eclipse.persistence.internal.jpa.querydef.JoinImpl

    ((JoinImpl)ld).on(cb.and(cb.equal(ld.get("intervalas"), 7));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the current code: <div class=submenu id=submenu0> <ul class=root id=root0> <li class=line_element line0><a><img
In my current code I have an TNCPConnection class which is derived from enable_shared_from_this
My current code needs to read foreign characters from the web, currently my solution
Here is the current code I am using: <UserControl xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml x:Class=ButtonPrototype.MainPage Width=640 Height=480>
my current code is below. If you visit the root of my webpage http://evanparsons.net/
This is my current code: $result = mysql_query(SELECT * FROM characters WHERE namn =
Current Code: WHERE EXTRACT(YEAR_MONTH FROM timestamp_field) = EXTRACT(YEAR_MONTH FROM now())) Instead of EXTRACT(YEAR_MONTH FROM
Current code. ------ <div class=wrapper> <div class=page-1></div> <div class=page-2></div> <div class=page-3></div> </div> <div class=wrapper>
My current code allows me to draw rectangles from a user defined spot but
Here is my current code: $sql = SELECT * FROM user_posts; $result = mysql_query($sql);

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.