Hibernate Tip How to map multiple entities to the same table











>> YOUR LINK HERE: ___ http://youtube.com/watch?v=RxE9nU285nM

Get more recipes like this one in my new book Hibernate Tips: More than 70 solutions to common Hibernate problems: https://goo.gl/XfywNk • One of the readers of my blog asked me this question: Some of our entities have a lot of attributes and we don’t need all of them in all use cases. Can I create a second entity that only maps a subset of the most commonly used attributes? Is there anything I should consider? • Yes, you can map two or more entities to the same database table. If you want to map the same database table to two entities, you should create a simple inheritance hierarchy. The superclass, in this example a class called AbstractAuthor, should be abstract and contain all attributes that are shared by both entities. You should map it as a mapped superclass so that it is not an entity itself. • Entities or DTOs – When should you use which projection? :- https://www.thoughts-on-java.org/enti... • 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

#############################









Content Report
Youtor.org / YTube video Downloader © 2025

created by www.youtor.org