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 ;)
@laurspilca10 ай бұрын
Yes!!!! You are totally right! I did forget that! Man, it's the age!
@temptrue33228 ай бұрын
Thank you Laur, good intro to hibernate
@laurspilca8 ай бұрын
Welcome :)
@OsteenOmega9 ай бұрын
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
@laurspilca9 ай бұрын
Hi. Yes. It make sense for the code to reflect the DB definitions. At least I would do that for clarity.
@OsteenOmega9 ай бұрын
Do you its a good practise using stored procedures today? or should all the logic be placed the application level?
@maksadnahibhoolna-wc2ef6 ай бұрын
Are there more episodes into this series ?
@laurspilca6 ай бұрын
This was a marathon. But you can find a whole playlist on JPA here on this channel :)
@maksadnahibhoolna-wc2ef6 ай бұрын
@@laurspilca sure Laur
@gheorghitabutnaru445510 ай бұрын
Hello! I observed that we can not use LIMIT constraint in a JPQL query. Is there an alternative?
@gheorghitabutnaru445510 ай бұрын
But without using native queries?
@laurspilca10 ай бұрын
@@gheorghitabutnaru4455 Hello. Yes. Limit is not an option in JPQL. You can use the setMaxResults() method on the Query object for this :)
@mils331811 ай бұрын
Thanks Laur
@FatimaBoulila-b1e11 ай бұрын
Merci
@jarekjal10 ай бұрын
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)