top of page

OneToOne

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

Hibernate

One to one



 




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

 


Data is saved

 

 

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



 


 


Abobe is uni direction

 

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

 

Also add getter /setter for it.


 


Is is how bidirection is set.

 


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

Th

So join column in answer table is ignored now as below

 


 

 

 

 

 
 
 

Recent Posts

See All
Best Chunking Practices

1. Chunk by Semantic Boundaries (NOT fixed size only) Split by sections, headings, paragraphs , or logical units. Avoid cutting a sentence or concept in half. Works best with docs, tech specs, policie

 
 
 
Future State Architecture

USE CASE: LARGE RETAIL BANK – DIGITAL CHANNEL MODERNIZATION 🔹 Business Context A large retail bank wants to “modernize” its digital channels (internet banking + mobile apps). Constraints: Heavy regul

 
 
 

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