Home
Videos uploaded by user “Thoughts On Java”
Should You Use JPA and Hibernate for Your next Project?
 
08:20
Do JPA and Hibernate really fit the project you’re about to start? This important question gets not asked often enough! And if you don’t think about it, in the beginning, it will be difficult to change your mind after the project started. Most often, the persistence framework gets selected based on personal preferences. And while these are often based on past experiences, it is not always the best approach. You should better check your requirements and choose a framework that fits. I prepared a few simple questions to guide you through the decision of choosing JPA or some other persistence framework. If you like this video, please give it a 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: http://www.thoughts-on-java.org/use-jpa-next-project/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 12210 Thoughts On Java
Getting Started with Hibernate Envers
 
07:46
A lot of business applications require an audit log that documents all changes that were performed on the managed data. There are lots of different options to implement such a log. One of them is Hibernate Envers. It just takes a few annotations to document all changes in the audit tables, and Envers also provides a powerful API to extract information from your audit log. In this video, I will show you how to add Hibernate Envers to your project, activate auditing for an entity and retrieve different information from your audit log. If you like this video, please give it a 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: http://www.thoughts-on-java.org/hibernate-envers-getting-started/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 3351 Thoughts On Java
Difference between JPA, EclipseLink & Hibernate
 
10:20
Today, I will talk about the differences between JPA, Hibernate and EclipseLink. When people are new to JPA, Hibernate or EclipseLink, they are often confused about the difference between them and which one they should use in their project. If you’re one of them, don’t worry. It’s a lot easier than it seems. If you are finding me for the first time, please subscribe to this channel. I’m publishing new videos about JPA and Hibernate twice a week. 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/difference-jpa-hibernate-eclipselink/ ➜ Download JPA at https://jcp.org/en/jsr/detail?id=338. ➜ Getting Started With Hibernate https://www.thoughts-on-java.org/hibernate-getting-started/ ➜ JPQL Guide -https://www.thoughts-on-java.org/jpql/ ➜ Handling of database change events- https://www.eclipse.org/eclipselink/documentation/2.7/solutions/qcn.htm ➜ Composite persistence units to map entities to tables in multiple databases- https://www.eclipse.org/eclipselink/documentation/2.7/solutions/usingmultipledbs001.htm ➜ Support for multi-tenancy-https://www.eclipse.org/eclipselink/documentation/2.7/solutions/multitenancy.htm Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 6294 Thoughts On Java
5 ways to initialize lazy associations and when to use them
 
11:16
Lazy loading of associated entities is a well-established best practice in JPA. Its main goal is to retrieve only the requested entities from the database and to load the related entities only if needed. That is a great approach if you only need the entities you selected in your query. But it creates additional work and can be the cause of performance problems if you also need some of the associated entities. In this video, I show 5 different ways to trigger the initialization of lazy associations and their specific advantages and disadvantages. Links mentioned in the video: JPA 2.1 Entity Graph – Part 1: Named entity graphs: https://goo.gl/K6sFHv JPA 2.1 Entity Graph – Part 2: Define lazy/eager loading at runtime: https://goo.gl/sSFbke Read the accompanying post: https://www.thoughts-on-java.org/5-ways-to-initialize-lazy-relations-and-when-to-use-them/ Join the free Thoughts on Java Library: https://goo.gl/OSG8rH Like my channel? Subscribe! ➜ http://bit.ly/2cUsid8 Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 7463 Thoughts On Java
Hibernate Tips: How to cascade a persist operation to child entities
 
03:16
Get more recipes like this one in my new book Hibernate Tips: More than 70 solutions to common Hibernate problems: https://goo.gl/XfywNk The Hibernate Tips series provides quick answers to common questions. This time, I will show you how to cascade a persist operation to associated child entities. 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: http://www.thoughts-on-java.org/hibernate-tips-cascade-persist-operation-child-entities/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 2340 Thoughts On Java
JPA vs Hibernate : The difference between save, persist, merge and update
 
16:06
JPA and Hibernate provide different methods to persist new and to update existing entities. You can choose between JPA’s persist and merge and Hibernate’s save and update methods. It seems like there are 2 pairs of 2 methods that do the same. You can use the methods persist and save to store a new entity and the methods merge and update to store the changes of a detached entity in the database. That’s why a lot of developers are wondering which of these methods they should use. Let’s take a closer look at the details and small differences of these methods. 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/persist-save-merge-saveorupdate-whats-difference-one-use Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 17249 Thoughts On Java
Hibernate Tip: How to delete child entities from a many-to-one association
 
03:06
Get more recipes like this one in my new book Hibernate Tips: More than 70 solutions to common Hibernate problems: https://goo.gl/XfywNk For some many-to-one associations, the child entity can’t exist without its parent. A typical example is the OrderItem which can’t exist without the Order. When you remove the association between the OrderItem and the Order, you need to delete that OrderItem entity as well. So, what’s the easiest way to implement that? The JPA specification provides the orphanRemoval feature for these use cases. When you activate it on the association, Hibernate removes a child entity when you remove its association to the parent entity. 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/hibernate-tips-how-to-delete-child-entities/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 2714 Thoughts On Java
5 Hibernate 5 features every developer should know
 
12:54
It’s quite a while since Hibernate 5.0 came out and brought a bunch of changes. And since then the development team implemented even more features. I explained several of them here on the channel and even more on the blog. It’s about time to have a look at the most popular ones. Based on the search traffic I get from google and my personal experience, the Java 8 support is by far the most popular change. But there are also some other features which might seem small but make common development tasks a lot easier. If you like this video, please give it a 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: http://www.thoughts-on-java.org/5-new-features-hibernate-5-every-developer-know/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 13347 Thoughts On Java
An Introduction to JPA FetchTypes
 
07:10
The JPA FetchType defines when Hibernate gets the related entities from the database, and it is one of the crucial elements for a fast persistence tier. In general, you want to fetch the entities you use in your business tier as efficiently as possible. But that’s not that easy. You either get all relationships with one query or you fetch only the root entity and initialize the relationships as soon as you need them. I’ll explain both approaches in more detail in this video and also provide you some links to more advanced solutions that combine flexibility and efficiency. 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: http://www.thoughts-on-java.org/entity-mappings-introduction-jpa-fetchtypes/ Resources mentioned in the video: Thoughts on Java Library: http://www.thoughts-on-java.org/free-member-library-signup/ Free course "Find and Fix N+1 Select Issues": https://www.thoughts-on-java.org/free-n1_select_course Video "5 ways to initialize lazy associations and when to use them": https://www.youtube.com/watch?v=Dr5Qn6NC-3Y Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 3285 Thoughts On Java
How to generate primary keys with JPA and Hibernate
 
09:08
Today, I will show you how to generate unique primary key values with JPA and Hibernate. But before we start, I want to know how you get the primary key values in your application? Do you use natural keys or UUIDs or do you generate technical IDs? Please post a comment below and tell me about it. I prefer to generate simple, numerical, technical IDs like you can see in the following code snippet instead of using natural keys which often require the combination of multiple attributes. Technical IDs are easier to manage and all involved systems, mainly the database and Hibernate, can index them very efficiently. This allows you to focus on the business logic of your application and avoids performance issues. 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/jpa-generate-primary-keys/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 3443 Thoughts On Java
Hibernate Tip: How to Map a Bidirectional Many-to-One Association
 
04:59
Get more recipes like this one in my new book Hibernate Tips: More than 70 solutions to common Hibernate problems: https://goo.gl/XfywNk JPA and Hibernate allow you to map associations in many different ways. And today I want to show you, how to map a bidirectional many-to-one association. 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: http://www.thoughts-on-java.org/hibernate-tips-map-bidirectional-many-one-association/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 2506 Thoughts On Java
Hibernate Performance Tuning: 10 Common Hibernate Mistakes That Cripple Your Performance
 
15:09
Do you think your application could be faster if you would just solve your Hibernate problems? Then I have good news for you! I fixed performance problems in a lot of applications, and most of them were caused by the same set of mistakes. And it gets even better, most of them are easy to fix. So, it probably doesn’t take much to improve your application. Here is a list of the 10 most common mistakes that cause Hibernate performance problems and how you can fix them. How to use native queries to perform bulk updates: https://youtu.be/sbrCxgwbzD8 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/common-hibernate-mistakes-cripple-performance/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 3004 Thoughts On Java
How to join unassociated entities with JPA and Hibernate
 
06:38
The representation of associations between entities as attributes is one of the most comfortable and popular features of JPA and Hibernate. It makes it very easy to navigate from one entity to one or more related entities in your Java code, like from a Person entity to the corresponding Address entity. You can also use the relationship attributes in JPQL queries to join entities. The trouble starts as soon as you want to join 2 entities without an association attribute. JPA and Hibernate versions before 5.1 don’t support this kind of joins, and you have to use a workaround to create an implicit cross join. I will show you this in the first part of this video and explain Hibernate’s ad-hoc join feature afterward. If you like this video, please give it a 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: http://www.thoughts-on-java.org/how-to-join-unrelated-entities/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 9818 Thoughts On Java
Liquibase : How to Automatically Update a Database
 
07:09
Today, I want to show you how you can integrate Liquibase into your application so that it automatically updates your database. That is especially interesting when you build smaller applications that don’t run in a highly regulated enterprise environment. In these situations, it’s often not possible to run the update process yourself and there might be no operations team which executes the SQL scripts. So, you need to run the database update automatically when you start your application. There are several ways to do that. If you’re building a plain Java application, you can use the Liquibase API to trigger the update. And it gets even easier, if you’re using a CDI container, e.g. in a Java EE application server, or Spring. I will show you all 3 approaches in this video. The first part of this series: https://www.thoughts-on-java.org/database-migration-with-liquibase-getting-started/ 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/automatic-database-updates-integrating-liquibase/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 5260 Thoughts On Java
Hibernate Tip: How to map a read-only database view
 
02:53
Get more recipes like this one in my new book Hibernate Tips: More than 70 solutions to common Hibernate problems: https://goo.gl/XfywNk The Hibernate Tips series provides quick answers to common questions. This week, I show you how to map a read-only database view. 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: http://www.thoughts-on-java.org/free-member-library Post: http://www.thoughts-on-java.org/hibernate-tips-map-view-hibernate/ Learn more: You can learn more about Hibernate's advanced mapping and query features in my Advanced Hibernate Online Training: http://bit.ly/2eojQ3w Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 4182 Thoughts On Java
How to use Hibernate's 1st level cache
 
12:00
This is a free sample lecture of my Hibernate Performance Tuning Online Training (https://www.thoughts-on-java.org/hibernate-performance-online-training/). Hibernate activates the 1st level cache by default and uses it to optimize the performance of your application if you don’t prevent it. OK, you probably wonder why you should prevent Hibernate from using the cache and optimizing the performance. That doesn’t make much sense, right? This happens by accident if you don’t know about the 1st level cache and the situations in which Hibernate can use it. But more about that in the video.
Views: 7192 Thoughts On Java
Hibernate Tip - How to log SQL statements and their parameters
 
02:42
Get more recipes like this one in my new book Hibernate Tips: More than 70 solutions to common Hibernate problems: https://goo.gl/XfywNk How to log the SQL statements generated by Hibernate and their bind parameters. 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: http://www.thoughts-on-java.org/free-member-library Hibernate Logging Guide – Use the right config for development and production: http://www.thoughts-on-java.org/hibernate-logging-guide/ Post: http://www.thoughts-on-java.org/hibernate-tips-how-to-log-sql-statements-and-their-parameters/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 2070 Thoughts On Java
How to persist LocalDate and LocalDateTime with JPA
 
06:20
Join the free Member Library to get access to free ebooks and cheat sheets about JPA and Hibernate: https://goo.gl/dfqr6n Java 8 brought lots of great features, and one of the most important and most anticipated ones was the new Date and Time API. There were lots of issues with the old API, and I won’t get into any details on why we needed a new one. I’m sure you had to struggle often enough with it yourself. The new Date and Time API is much better. It’s well designed, easy to use and (finally) immutable. The only issue that remains is that the JPA standard doesn’t support it. Well, that’s not completely correct. You can use it, but JPA will map it to a BLOB instead of a DATE or TIMESTAMP. That means the database is not aware of the date object and cannot apply any optimization for it. That’s not the way we should or want to do it. But that doesn’t mean that you can’t use the Date and Time API. You just have to decide how you want to add the support for it. You either use Hibernate 5, which provides proprietary support for the Date and Time API, or you take a few minutes to implement an AttributeConverter like I show you in this video. Read the original post: https://www.thoughts-on-java.org/persist-localdate-localdatetime-jpa/ 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 Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 5326 Thoughts On Java
Hibernate Tip: How to map a bidirectional many-to-many association
 
04:51
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 show you how you can map a many-to-many association so that you can navigate it in both directions. 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/hibernate-tips-map-bidirectional-many-many-association/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 2055 Thoughts On Java
How to automatically validate entity attributes with Hibernate Validator
 
05:21
Validation is an important task, but it’s most often also tedious to implement. It’s a good thing that the BeanValidation specification and Hibernate Validator as it’s reference implementation take over most of the work. They provide an easy to use, standardized way to validate object attributes and method parameters. And the best thing, they integrate with Hibernate ORM and all other JPA 2.x implementations to provide automatic validation of entity attributes. Sounds interesting? Let me give you a quick overview of what you can do. If you like this video, please give it a 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: http://www.thoughts-on-java.org/automatically-validate-entities-with-hibernate-validator/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 2871 Thoughts On Java
Why you should avoid CascadeType.REMOVE for to-many associations and what to do instead
 
08:46
Today, I want to show you why you shouldn’t use CascadeType.REMOVE and what to do instead. The CascadeTypes REMOVE and ALL provide a comfortable option to remove an entity together with all its child entities. But that creates several issues for to-many associations, and you should only use it for to-one relationships. 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/avoid-cascadetype-delete-many-assocations/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 2157 Thoughts On Java
Hibernate Tip: How to map native query results to a POJO
 
02:58
Get more recipes like this one in my new book Hibernate Tips: More than 70 solutions to common Hibernate problems: https://goo.gl/XfywNk This time, I want to show you how you can tell Hibernate to map the result of a native SQL query to a POJO. 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/hibernate-tips-map-native-query-results-pojo/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 2509 Thoughts On Java
Hibernate Tip: What's the Difference Between JOIN, LEFT JOIN and JOIN FETCH
 
06:16
Get more recipes like this one in my new book Hibernate Tips: More than 70 solutions to common Hibernate problems: https://goo.gl/XfywNk I got the following question via email and thought that it is an interesting topic for a Hibernate Tip. So here it is: I saw JPQL queries using JOIN, LEFT JOIN and JOIN FETCH statement. What are the differences between these 3 join statements? You might know the JOIN and LEFT JOIN statements from SQL. It supports clauses with the same name and a very similar syntax. The JOIN FETCH clause is specific to JPA. Let’s take a closer look at all 3 options in this video. 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/hibernate-tips-difference-join-left-join-fetch-join Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 1918 Thoughts On Java
Hibernate Tip: How to use a custom database sequence
 
03:27
Get more recipes like this one in my new book Hibernate Tips: More than 70 solutions to common Hibernate problems: https://goo.gl/XfywNk The Hibernate Tips series provides quick answers to common questions. This week, I show you how to use a custom database sequence instead of Hibernate's default one. 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: http://www.thoughts-on-java.org/free-member-library Post: http://www.thoughts-on-java.org/hibernate-tips-map-native-query-results-entities/ Learn more: @SqlResultSetMappings are a powerful feature which allows you to define complex mappings for native query results. You can also use it to map the query result to multiple entities (http://www.thoughts-on-java.org/result-set-mapping-complex-mappings/) or POJOs (http://www.thoughts-on-java.org/result-set-mapping-constructor-result-mappings/). Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 2075 Thoughts On Java
Hibernate Tip: How to use a timestamp for versioning and optimistic locking
 
04:45
Get more recipes like this one in my new book Hibernate Tips: More than 70 solutions to common Hibernate problems: https://goo.gl/XfywNk When you had to map a legacy table model in one of your projects, you probably know this situation. Instead of a numeric version column, the table model uses the timestamp of the last update. I don’t recommend using this approach because numeric versioning is much more efficient. But if you have to, you can also use a timestamp for versioning with JPA and Hibernate. 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/hibernate-tips-use-timestamp-versioning-optimistic-locking/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 1472 Thoughts On Java
Getting Started with Flyway & Version-Based Migration
 
11:44
Today, I want to give you a quick introduction to version-based database migration with Flyway. Updating a database seems easy as long as you’re the only developer on the team and don’t have to support multiple systems. But that changes dramatically when your team implements multiple features in parallel, uses different test databases and runs the application on one or more production servers. Updating all these databases, keeping track of all executed update operations and merging the changes of your co-workers quickly becomes an issue. Getting Started with Liquibase : https://www.thoughts-on-java.org/database-migration-with-liquibase-getting-started/ Download Flyway : https://flywaydb.org 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/flyway-getting-started Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 1880 Thoughts On Java
Bag vs. List vs. Set: Most Efficient Data Type  for To-Many Associations?
 
06:19
Which data type should you use to map a to-many association with Hibernate? Is it better to use a Set or a List? That’s a very common question, and most developers are surprised when they look at the documentation and find out that these are not the only options. You can also use a Bag or a Map. The mapping to a Map is a special case, and I already explained it in great details in one of my previous videos. In contrast to the other 3 options, it provides indexed based access to the associated entities. That might be beneficial for some use cases, but the creation and management of the Map also creates an overhead. It should, therefore, not be your default choice. So, let’s focus on the other 3 options. List, Set, and Bag represents simple collections of entities. List and Set should sound familiar because the java.util package contains interfaces with these names. But what is a Bag? There is no class in the java.util package with that name. How to map an association as a java.util.Map: https://youtu.be/D1xnl-yxjuA 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/association-mappings-bag-list-set/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 1375 Thoughts On Java
7 Tips to improve your Hibernate performance
 
23:44
Implementing the persistence tier with Hibernate is easy. You just need to add a few annotations to map a database table. Getting a good performance out of it requires more knowledge. But don’t worry, the most common reasons for performance issues are not that difficult to fix. I will show you 7 Tips that will help you to speed up your persistence tier in this video. Join the free Member Library and download a cheat sheet with the tips of this video: https://goo.gl/dfqr6n Links mentioned in the video: Mini course - Find and fix n+1 select issues: https://goo.gl/DLdZwd How to call native SQL queries with JPA and Hibernate: https://www.youtube.com/watch?v=W0-3H4_luOA Read the accompanying post: https://www.thoughts-on-java.org/tips-to-boost-your-hibernate-performance/ Learn more about Hibernate performance tuning in my online training: https://goo.gl/eZGyZK Like my channel? Subscribe! ➜ http://bit.ly/2cUsid8 Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 12627 Thoughts On Java
Getting Started with jOOQ : Building SQL Queries in Java
 
10:38
JPA and Hibernate are a great fit to implement persist and update use cases, and simple queries. But most applications need a lot more than that. You need to be able to use the full feature set of SQL to implement your queries. That’s why JPA supports native queries. But it’s not comfortable to use. You probably don’t want to provide your query as a simple String or to handle the differences between the various database dialects yourself. Other libraries are much better suited to implement complex SQL queries. One of them is jOOQ. It provides you with a Java DSL that enables you to build SQL queries in a comfortable and type-safe way. It abstracts the technical difficulties of plain JDBC and handles the subtle differences of the various SQL dialects. In this video, I will give you a basic introduction to jOOQ so that you can start using it in your application. And in my next video, I will show you how to integrate it with Hibernate. Before we get started, please make sure you subscribed to my channel and clicked the bell icon, so that you get new videos every week. Download jOOQ- https://www.jooq.org/download Configure jOOQ's code generator- https://www.jooq.org/doc/3.10/manual/code-generation/codegen-configuration/#N49C79 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/getting-started-with-jooq/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 2553 Thoughts On Java
Best Practices for Many-To-One and One-To-Many Association Mappings
 
09:35
Today, I want to talk about best practices for many-to-one and one-to-many association mappings. When you model your database, you will most likely define several of these associations. And it’s, of course, the same when you model your entities. It’s quite easy to do that with JPA and Hibernate. You just need an attribute that represents the association and annotate it with a @ManyToOne or @OneToMany association. But as easy as it seems, there are several pitfalls that you can avoid by following a few best practices. Why you should avoid CascadeType.REMOVE for to-many associations and what to do instead:- https://youtu.be/GFy8dJNCRcY 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/best-practices-many-one-one-many-associations-mappings Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 7178 Thoughts On Java
Effective Java 3rd Edition - Book Review
 
04:33
Get the book: https://www.thoughts-on-java.org/effectiveJava (affiliate link) The previous edition was one of the most popular books among professional Java developers, and I couldn’t wait to finally read the updated 3rd edition. I got this book 2 weeks ago, and it more than fulfilled my expectations. It is packed with best practices and detailed descriptions of the finer details of the Java language. Every developer should at least read the chapters about generics and lambdas. Joshua Bloch does an amazing job explaining best practices and providing detailed insights into how and when to use the different Java features. Effective Java is a must-read for every professional Java developer. You can get a lot of books about Java, and several of them do a good job explaining the different language features. But as a professional developer, you know that this is just the first step. There is a huge difference between knowing a feature and understanding when and how to use it to build an efficient and maintainable application. If you read the previous editions of Joshua Bloch’s book Effective Java, you know that he did a great job explaining best practices and showing how to write readable and maintainable code. That doesn’t change with the 3rd edition which he updated to include the features and paradigms introduced in Java 7, 8 and 9. Especially the chapters about interface design, generics and lambdas are a must-read for every Java developer. Over the last 2 weeks, I read the book from cover to cover, and I highly recommend you do the same. It was entertaining and highly educating. But you don’t have to take this approach. The book consists of 90 items, and you can read one of them if you’re looking for specific advice. Each item can stand on its own and provides detailed explanations of a specific Java feature, how to use it and when to prefer a different solution. This structure makes the book easy to use and extremely helpful in your daily work. Like the previous edition, this book will become one of my go-to references if I need advise to implement a complex task or to design a new API. I’m sure I will reread some of the more advanced items about lambdas and generics shortly. 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/review-effective-java-3rd-edition/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 7371 Thoughts On Java
Basic result set mappings for native SQL queries
 
06:35
Quite often JPQL is not powerful enough to perform the queries you need in real world projects. In general, this is not an issue because JPA is designed as a leaky abstraction and you can use the full potential of SQL by using native queries. The only downside is, that these queries return a List of Object[] instead of the mapped entities and value objects you are used to get from JPQL queries. Each Object[] in the List contains one record returned by the database. You then need to iterate through the array, cast each Object to its specific type and map them to your domain model. This creates lots of repetitive code and type casts. It would be more comfortable, if you could tell the EntityManager to map the result of the query into entities or value objects as it is the case for JPQL statements. The good news is, JPA provides this functionality. It is called SQL result set mapping and in this video, I will show you how to use it to map your query results to managed entities. If you like this video, please give it a 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: http://www.thoughts-on-java.org/result-set-mapping-basics/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 3695 Thoughts On Java
Hibernate Tip : How to avoid MultipleBagFetchException
 
03:03
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 will answer a question about the MultipleBagFetchException,. But before we discuss this question in detail, please subscribe and hit the bell icon to not miss any videos. I upload new videos every Tuesday and Thursday. 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/hibernate-tips-how-to-avoid-hibernates-multiplebagfetchexception/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 544 Thoughts On Java
Hibernate Tip: Map an Unidirectional One-to-Many Association Without a Junction Table
 
03:37
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 will answer a common question about the mapping of unidirectional one-to-many associations. But before we start, please subscribe and hit the bell icon to get notified about new hibernate tip videos. I upload a new one every week. 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/hibernate-tips-unidirectional-one-to-many-association-without-junction-table Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 701 Thoughts On Java
Hibernate Logging Guide: Use the right configuration for development and production
 
06:10
Choosing the right logging configuration can make the difference between finding a performance issue during development or suffering from it on production. But it can also create an overhead that slows down your application. You need to decide what you need and configure your system accordingly. 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: http://www.thoughts-on-java.org/hibernate-logging-guide/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 1749 Thoughts On Java
Hibernate Tips: How to use Hibernate's native bootstrapping API
 
04:58
Get more recipes like this one in my new book Hibernate Tips: More than 70 solutions to common Hibernate problems: https://goo.gl/XfywNk You can configure and bootstrap Hibernate in multiple different ways and today I want to show you how to use its native bootstrapping API. This API is very flexible which makes it more complicated to use but also more powerful than the JPA bootstrapping API. 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/hibernate-tips-use-hibernates-native-bootstrapping-api/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 1874 Thoughts On Java
Hibernate Tip: How to log the execution time of a query
 
03:16
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 performance related question that someone asked me on my blog. Here it is: Some of my queries seem to be slow. Can Hibernate measure and log the execution time of a query? The answer is: Yes! It can do that and a lot more. Let me show you how. 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/hibernate-tips-log-execution-time-query/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 1313 Thoughts On Java
Hibernate Tip: How to filter entities from a mapped association?
 
03:40
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 show you how you can add additional filter criteria to a mapped association. 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/hibernate-tips-filter-entities-mapped-association/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 1105 Thoughts On Java
Hibernate Tip: How to map a java.util.Date
 
03:36
Get more recipes like this one in my new book Hibernate Tips: More than 70 solutions to common Hibernate problems: https://goo.gl/XfywNk JPA and Hibernate offer a standard mapping for java.util.Date that stores it as a timestamp with nanoseconds. That’s OK as a default, but as always, it doesn’t fit all use cases. In this video, I want to show you how you can easily customize this mapping. 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/hibernate-tips-map-java-util-date-database-column/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 2084 Thoughts On Java
Hibernate Tip:  How to map an entity to multiple tables
 
04:31
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 will answer a question about the mapping of entities to multiple database tables. But before we discuss it in detail, please subscribe and hit the bell icon to get a new hibernate tip video every week. 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/hibernate-tips-how-to-map-an-entity-to-multiple-tables/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 1956 Thoughts On Java
Hibernate Tip: How to use the QueryCache to avoid additional queries
 
02:36
Get more recipes like this one in my new book Hibernate Tips: More than 70 solutions to common Hibernate problems: https://goo.gl/XfywNk The Hibernate Tips series provides quick answers to common questions. This week, I show you how to cache the result of a query in Hibernate's QueryCache. 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: http://www.thoughts-on-java.org/free-member-library Post: http://www.thoughts-on-java.org/hibernate-tips-use-querycache-avoid-additional-queries/ Learn more: I explain caching and other performance tuning techniques in more detail in my Hibernate Performance Tuning Online Training: http://bit.ly/2d1h1o4 Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 1565 Thoughts On Java
Hibernate Tip: How to implement a subquery in a CriteriaQuery
 
03:56
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 the following question: In one of our use cases, we use the Criteria API to build the query dynamically. Now I need to add a subquery. Does the Criteria API support subqueries? And how can I implement them? Yes, you can use sub queries in your CriteriaQuery and I will show you how in this video. But before we jump in, please subscribe to this channel and turn on the notification so that you don’t miss any future Hibernate tips. 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/hibernate-tip-subquery-criteriaquery Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 1155 Thoughts On Java
Hibernate Tip: How to Call a Stored Procedure
 
04:08
Get more recipes like this one in my new book Hibernate Tips: More than 70 solutions to common Hibernate problems: https://goo.gl/XfywNk The Hibernate Tips series provides quick answers to common questions. This time, I will show you how to use a @NamedStoredProcedureQuery to call a stored procedure with Hibernate. 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: http://www.thoughts-on-java.org/hibernate-tips-call-stored-procedure/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 4025 Thoughts On Java
Create type-safe queries with JPA’s static metamodel
 
06:27
Today I want to show you how you can use JPA’s metamodel to get rid of the String references in your persistence code. 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/static-metamodel/ Resources mentioned in this video: - Hibernate Tip: How to automatically add Metamodel classes to your classpath: https://www.youtube.com/watch?v=fj7MX5oIg-E&index=8&list=PL50BZOuKafAbXxVJiD9csunZfQOJ5X7hP - Thoughts on Java Library: https://goo.gl/dtyIIC Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 1571 Thoughts On Java
Version based database migration with Liquibase
 
10:47
Today, I want to talk about version-based database migration with Liquibase. Creating the database for your application seems to be easy as long as you don’t need to support multiple versions or work in multiple teams. You just generate an SQL script from your database model or in the worst case, export the required statements from your test database. You can then execute it manually or use JPA to do that automatically. This approach doesn’t work as soon as you need to support multiple versions of your application. And extracting the required changes from the test database becomes a huge mess when the size of your team and the number of changes increases. You can avoid some of these problems when you create the database update scripts, while working on the next release, and store them alongside your code in git or whichever version control system you use. Whenever someone gets the latest code changes, he will also get the required database changes. With the right tooling in place, you will even be able to apply these changes automatically. One tool that can help you with that is Liquibase. 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/database-migration-with-liquibase-getting-started/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 3443 Thoughts On Java
How to generate UUIDs as primary keys with Hibernate
 
05:59
Most developers prefer numerical primary keys because they are efficient to use and easy to generate. But that doesn’t mean that a primary key has to be a number. UUIDs, for example, have gained some popularity over the recent years 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/generate-uuids-primary-keys-hibernate/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 2924 Thoughts On Java
Hibernate Tip: How to map an Enum to a database column
 
04:09
Get more recipes like this one in my new book Hibernate Tips: More than 70 solutions to common Hibernate problems: https://goo.gl/XfywNk The Hibernate Tips series provides quick answers to common questions. This time, I will show you how to map a Java Enum to a database column. That's one of the basic JPA and Hibernate mappings and you should know the 2 standard options with their advantages and disadvantages. 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: http://www.thoughts-on-java.org/hibernate-tips-map-enum-database-column/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 2034 Thoughts On Java
Hibernate Tip: The Fastest Option to Remove a List of Entities
 
03:21
Get more recipes like this one in my new book Hibernate Tips: More than 70 solutions to common Hibernate problems: https://goo.gl/XfywNk I was asked for the fastest option to delete a bunch of database records. So, here it is. How to detach entities from the persistence context before executing a bulk update: https://youtu.be/p-euc3vQQAc 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/hibernate-tip-fastest-option-delete-100-records/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 1007 Thoughts On Java
5 Tips To Write Efficient Queries With JPA And Hibernate
 
13:07
A lot of developers seem to have a love-hate relationship with JPA and Hibernate. They love it because it makes it easy to implement most use cases and they hate it because it also makes it easy to implement very inefficient queries. In the past, I was one of these developers myself. I liked to use Hibernate, but I also struggled with slow database queries and other performance issues. That changed over the years when I spend more and more time working with and teaching about Hibernate. When you analyze enough inefficient queries, you recognize that you just have to follow a few simple recommendations to avoid most of them. 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/5-tips-write-efficient-queries-jpa-hibernate/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 2203 Thoughts On Java
How to Persist Creation and Update Timestamps with Hibernate
 
04:44
Storing the creation timestamp or the timestamp of the last update is a common requirement for modern applications. It sounds like a simple requirement, but for a huge application, you don’t want to set a new update timestamp in every use case that changes the entity. You need a simple, fail-safe solution that automatically updates the timestamp for each and every change. The easiest way to implement that is to use Hibernate's @CreationTimestamp and @UpdateTimestamp annotations and let Hibernate trigger the required updates. If you like this video, please give it a 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: http://www.thoughts-on-java.org/persist-creation-update-timestamps-hibernate/ Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Views: 1751 Thoughts On Java

Harmonization music definition essay
A stitch in time saves nine short essay topics
Essay on an interesting journey by train
The strange case of dr jekyll and mr hyde good evil essay
Top quality essay