Good day! I just started getting acquainted with Hibernate and immediately ran into a problem. In my MySQL database there is some table result , which among other things has a foreign key field test_id . I get an entity- object of the result table and want to get the same test_id field from another table. The problem is that after receiving an entity object, the session is closed and I cannot get the value from the foreign key! Tell me the solutions! PS I use the example from this article:

hibernate for beginners

  • This is an outdated example. Look at the date of the post there as much as 2008. since then much water has flowed under the bridge. - huffman
  • In general, the framework, the framework, is changing so rapidly and radically! - voipp

1 answer 1

See this article for an example of Hibernate - One-To-Many Example (Annotation)

Hibernate tutorial