top of page

OneToOne

  • Writer: Anand Nerurkar
    Anand Nerurkar
  • May 1, 2024
  • 1 min read

Hibernate

One to one


ree

 

ree
ree

ree
ree


When we run, answer.answer_id is created in question table ,marked as FKey.

 

ree

Data is saved

 

ree

 

Answer.answer_id is afkey and it is join colmn which we can rename it with joinclumn annotation as below



ree

 

ree

 

ree

Abobe is uni direction

 

To make it bidirection, we need to add question column in answer entity as below

ree

 

Also add getter /setter for it.


 

ree

Is is how bidirection is set.

 

ree

Now e have join column in both table, but we need to maintain in question table only , ignore answer table join column,

So go to answer entity and map question field as below

ree

Th

So join column in answer table is ignored now as below

ree

 

ree

 

 

 

 

 
 
 

Recent Posts

See All
AI Risk Metrices

🏦 KEY BANKING RISK METRICS (EXPLAINED SIMPLY) 🔍 What is AUC  (in Credit / Risk Models)? AUC = Area Under the ROC Curve In simple terms: AUC measures how well a model can distinguish between good and

 
 
 
Gen AI USe case Estimation

✅ How to Build Estimation for a GenAI Use Case Step 1: Identify the Use Case Scope What business problem are you solving? (Customer support, document processing, fraud detection, etc.) Who are the end

 
 
 

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
  • Facebook
  • Twitter
  • LinkedIn

©2024 by AeeroTech. Proudly created with Wix.com

bottom of page