tag:blogger.com,1999:blog-5355106262763766945.post6618363382725417817..comments2022-12-13T10:01:01.574+01:00Comments on Thoughts on Java: JPA 2.1 Entity Graph - Part 2: Define lazy/eager loading at runtimeAnonymoushttp://www.blogger.com/profile/04147076428817122840noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-5355106262763766945.post-45288196060295539842014-04-19T17:56:20.684+02:002014-04-19T17:56:20.684+02:00No, I have not seen it in a "real" proje...No, I have not seen it in a "real" project so far. But that will change as soon as critical applications switch to JEE7 application servers.<br /><br />Having hundreds of these annotations might get a little messy ;-)<br />But it would be similar with predefined SQL statements. You have to put the predefined stuff somewhere in the end. <br />The only alternative would be to create the statement at runtime, based on the user input. And with JPA 2.1 you could even create a dynamic entity graph for the query ;-)<br />But creating everything at runtime has also several drawbacks...<br /><br />Independent of your approach to define a database query, structuring a hughe application is not an easy job. And I don't think, that there is a one size fits all approach. You always need to find the best solution for your current application.<br /><br />Regards,<br />ThorbenAnonymoushttps://www.blogger.com/profile/04147076428817122840noreply@blogger.comtag:blogger.com,1999:blog-5355106262763766945.post-68813511991227825792014-04-12T09:15:13.708+02:002014-04-12T09:15:13.708+02:00I'm really very curious where this whole Annot...I'm really very curious where this whole Annotatiomania™ leads us. Once we declare something like a named entity graph with declarative tools like annotations, I really start wondering why we have stopped writing SQL.<br /><br />I understand that this whole set of features will go through a variety of caches in Hibernate and leverage the whole platform. But the sheer complexity of a project that yields hundreds of such entity graphs makes me think if querying shouldn't better be done with the optimal query language for RDBMS.<br /><br />Have you already seen these JEE7 things in the wild?Lukas Ederhttps://www.blogger.com/profile/02028559621679932902noreply@blogger.com