Loading [Contrib]/a11y/accessibility-menu.js
Back
Close

Hibernate Native SQL

vembubalaji
2,412 views

Native Joins

  • If we would like to get data from both User and team based on the user table, we can use native joins. In this case, we are using the left outer join
A quick sample. Check out the JAVA class and SQL file
// { autofold
package com.tu.nativesqlsample;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.hibernate.Session;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  • Notice that the returned Object List are the columns requested.
  • To ensure eager loading of associated tables we can use addJoin and addEntity.
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants