Hibernate Tip: How to persist a List of Strings as an ElementCollection

Опубликовано: 02 Октябрь 2024
на канале: Thorben Janssen
7,589
105

Get more recipes like this one in my new book Hibernate Tips: More than 70 solutions to common Hibernate problems: https://goo.gl/XfywNk

Today I want to answer a question that I get asked on a regular basis: I just need to persist a simple List of Strings. Do I really need to create an additional entity for it?
Well, it's better to map each String to an entity because it provides better performance than an element collection. But you don’t have to do it if ease of use is more important than performance.

If you like this video, please give me your thumbs up and share it with your friends and co-workers.

Like my channel? Subscribe!
➜ http://bit.ly/2cUsid8

Join the free Member Library:
https://goo.gl/dtyIIC

Read the accompanying post: https://www.thoughts-on-java.org/hibe...

Want to connect with me?
Blog: http://www.thoughts-on-java.org/
Twitter:   / thjanssen123  
Facebook:   / thoughtsonjava  
#Hibernate #JPA #HibernateTips #ElementCollection #Mapping