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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:10:33+00:00 2026-06-14T12:10:33+00:00

I am using Hibernate 3.2.5. When I use a JOIN I can see that

  • 0

I am using Hibernate 3.2.5. When I use a JOIN I can see that the sql query generated by the Hibernate are the syntax prior to the Oracle 9i release. The queries are having (+) symbols to denote the LEFT OUTER JOIN rather than using LEFT OUTER JOIN and so on.

For this criteria:

Criteria criteria = session.createCriteria(Dept.class).createAlias("empMap","id",CriteriaSpecification.LEFT_JOIN).add(Restrictions.eq("deptId", new Integer(6)));

This is the SQL query generated:

select this_.DEPT_ID as DEPT1_1_1_, this_.DEPT_NAME as DEPT2_1_1_, id1_.DEPT_ID as DEPT2_3_, id1_.EMP_ID as EMP1_3_, id1_.EMP_ID as formula0_3_, id1_.EMP_ID as EMP1_0_0_, id1_.DEPT_ID as DEPT2_0_0_, id1_.EMP_NAME as EMP3_0_0_, id1_.AGE as AGE0_0_, id1_.SEX as SEX0_0_ from dept this_, emp id1_ where this_.DEPT_ID=id1_.DEPT_ID(+) and this_.DEPT_ID=?

My Queston is:

1) Why the queries are having old syntax? If I use Hibernate 4.0 or latest one then will it generate the new syntax SQL queries?

2) How to perform Outer Join in this case? I can see options for LEFT JOIN and FULL JOIN but can’t see anything for RIGHT JOIN

EDIT

Q. 2 It was a typo mistake, its RIGHT JOIN

Please let me know about these.

Regards,

  • 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-14T12:10:34+00:00Added an answer on June 14, 2026 at 12:10 pm

    If you look at the current Hibernate source code, then you’ll see that there are a number of different SQL dialects for Oracle:

    • 8 – deprecated in favour of 8i
    • 8i – generates the (+) syntax
    • 9 – deprecated in favour of either 9i or 10g
    • 9i – generates the (+) syntax, with the comment Specifies to not use “ANSI join syntax” because 9i does not seem to properly handle it in all cases
    • 10g – generates ANSI joins

    So, the only way to get ANSI join syntax is to use the 10g dialect. I don’t know if that existed in 3.2.5, or if it did, whether the version of it there generates ANSI joins, but it’s the only thing you can try.

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

Sidebar

Related Questions

In SQL one can write a query that searches for a name of a
I'd like to use Hibernate's criteria api to formulate a particular query that joins
Hi i am using struts2 and hibernate in my project. I need to use
Assume you are using some libraries like NHibernate or Castle ActiveRecord that use log4net
Using hibernate, how can I persist a class with a List<String> field? Consider the
When using hibernate to retrieve data from Oracle 11g DB using either org.hibernate.dialect.Oracle10gDialect or
when using hibernate with spring, can someone explain how the session unit of work
When using Hibernate 2nd level cache and query cache and not specifying anything inside
I'm trying to write a HQL/Criteria/Native SQL query that will return all Employees that
Our current project does not use Hibernate (for various reasons) and we are using

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.