regarding the problem with title being null after merge (at 1:51:00). according to hibernate documentation: "Merging is the process of taking an incoming entity instance that is in the detached state and copying its data over onto a new managed instance." - so it is new instance created, so you should to assign the value returned by em.merge(b1) back to b1. other way you continue working on old unmanaged instance and you have still null in title field ;)
hello. is it necessary to use the cascade feature of jpa if already defined in your sql schema? example, we usually use the ON UPDATE, and ON DELETE , during schema definition
you couldn't prove getReference() method behaviour probably because your Intellij settings, try to uncheck Settings -> Build -> Debugger -> DataViews -> Java -> Enable toString() object veiw option (at least in my Community version it solved the issue, and is helpful with debugging Hibernate lazy loading also)
regarding the problem with title being null after merge (at 1:51:00). according to hibernate documentation: "Merging is the process of taking an incoming entity instance that is in the detached state and copying its data over onto a new managed instance." - so it is new instance created, so you should to assign the value returned by em.merge(b1) back to b1. other way you continue working on old unmanaged instance and you have still null in title field ;)
Yes!!!! You are totally right! I did forget that! Man, it's the age!
Do you its a good practise using stored procedures today? or should all the logic be placed the application level?
Thank you Laur, good intro to hibernate
Welcome :)
hello. is it necessary to use the cascade feature of jpa if already defined in your sql schema? example, we usually use the ON UPDATE, and ON DELETE , during schema definition
Hi. Yes. It make sense for the code to reflect the DB definitions. At least I would do that for clarity.
Thanks Laur
Are there more episodes into this series ?
This was a marathon. But you can find a whole playlist on JPA here on this channel :)
@@laurspilca sure Laur
Merci
you couldn't prove getReference() method behaviour probably because your Intellij settings, try to uncheck Settings -> Build -> Debugger -> DataViews -> Java -> Enable toString() object veiw option (at least in my Community version it solved the issue, and is helpful with debugging Hibernate lazy loading also)
Yes. I thought it's Intellij!
Hello! I observed that we can not use LIMIT constraint in a JPQL query. Is there an alternative?
But without using native queries?
@@gheorghitabutnaru4455 Hello. Yes. Limit is not an option in JPQL. You can use the setMaxResults() method on the Query object for this :)
githupp ??
github.com/lspil/youtubechannel/tree/master/jpa_marathon_e1