Hibernate One to Many Example using Annotation
In this segment, we will perform one-to-numerous relationship to outline list object of persevering class utilizing annotation.
Here, we are utilizing the situation of Forum where one inquiry has various answers.
In such case, there can be numerous responses for an inquiry and each answer may have its own data that is the reason we have utilized rundown in the constant class (containing the reference of Answer class) to speak to an accumulation of answers.
Example of One to Many mapping utilizing annotation
1) Create the Persistent class
This persevering class characterizes properties of the class including List.
Question.java package com.javacodegeeks;