title
What is JPA? | JPA Implementation
description
Github link : https://github.com/navinreddy20/youtubeProjects
The Java Persistence API (JPA) is a Java specification for accessing, persisting, and managing data between Java objects / classes and a relational database.
JPA is now considered the standard industry approach for Object to Relational Mapping (ORM) in the Java Industry.
JPA is specification, and requires an implementation.
JPA also defines a runtime EntityManager API for processing queries and transaction on the objects against the database.
In this video we will see :
- What is JPA and how to implement JPA
- Pre-requisites for JPA -: Java, Database, JDBC
- What is ORM and where to use it
- Tools to implement ORM
- Why to use JPA
- Example of JPA
- Fetching and saving values through JPA
- Adding dependency of Hibernate, Mysql
- find() method of JPA
- EntityManager
- createEntityManager factory method
- Creating Meta-inf folder
- Cerating xml file under meta-inf file
- @Entity annotation
- @ID
- Changing values in database
Editing Monitors :
https://amzn.to/2RfKWgL
https://amzn.to/2Q665JW
https://amzn.to/2OUP21a.
Check out our website: http://www.telusko.com
Follow Telusko on Twitter: https://twitter.com/navinreddy20
Follow on Facebook:
Telusko : https://www.facebook.com/teluskolearn...
Navin Reddy : https://www.facebook.com/navintelusko
Follow Navin Reddy on Instagram: https://www.instagram.com/navinreddy20
Subscribe to our other channel:
Navin Reddy : https://www.youtube.com/channel/UCxmk...
Telusko Hindi :
https://www.youtube.com/channel/UCitz...
Donation:
PayPal Id : navinreddy20
Patreon : navinreddy20
http://www.telusko.com/contactus
detail
{'title': 'What is JPA? | JPA Implementation', 'heatmap': [{'end': 696.373, 'start': 681.127, 'weight': 0.723}, {'end': 1189.281, 'start': 1120.257, 'weight': 0.941}], 'summary': 'Covers the fundamentals of jpa and object relational mapping (orm) in java, discusses switching challenges between orm tools, demonstrates jpa implementation with mysql database, and explains entity manager creation and persistence configuration, emphasizing the advantages of using jpa for data handling and future flexibility.', 'chapters': [{'end': 212.165, 'segs': [{'end': 61.275, 'src': 'embed', 'start': 19.32, 'weight': 0, 'content': [{'end': 23.722, 'text': "Because if you don't know how to work with JDBC, then this video will not make any sense to you.", 'start': 19.32, 'duration': 4.402}, {'end': 29.364, 'text': "And having knowledge of Hibernate will be an added advantage, but that's fine.", 'start': 24.743, 'duration': 4.621}, {'end': 32.045, 'text': "Even if you don't know Hibernate, that's fine.", 'start': 29.404, 'duration': 2.641}, {'end': 34.085, 'text': 'We can still try to understand what is happening here.', 'start': 32.384, 'duration': 1.701}, {'end': 36.946, 'text': 'So Java, database, and JDBC, three requisites.', 'start': 34.646, 'duration': 2.3}, {'end': 39.067, 'text': 'And now we can jump into the concept.', 'start': 37.546, 'duration': 1.521}, {'end': 48.129, 'text': 'So before implementing it, we have to understand the theory of JPA, right? So what JPA is? So JPA stands for Java Persistence API.', 'start': 39.707, 'duration': 8.422}, {'end': 52.947, 'text': "So what exactly this means? So let's get back to the world of IT.", 'start': 49.364, 'duration': 3.583}, {'end': 58.973, 'text': 'So when you say you are working in this IT world or technological world, we are working with information, right? We are working with data.', 'start': 52.967, 'duration': 6.006}, {'end': 61.275, 'text': "So, whatever we use, it's all about data right?", 'start': 59.093, 'duration': 2.182}], 'summary': 'Video requires knowledge of jdbc, hibernate, and jpa for working with java, databases, and data.', 'duration': 41.955, 'max_score': 19.32, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY19320.jpg'}, {'end': 106.148, 'src': 'embed', 'start': 78.083, 'weight': 4, 'content': [{'end': 82.93, 'text': 'those data are, by default, temporary data because your application is working with some data.', 'start': 78.083, 'duration': 4.847}, {'end': 85.953, 'text': 'the moment you close the application, you will lose all the data.', 'start': 82.93, 'duration': 3.023}, {'end': 91.06, 'text': 'what you want is, even if your application is set down, you still want to persist that data somewhere.', 'start': 85.953, 'duration': 5.107}, {'end': 93.099, 'text': 'Where do we process our data?', 'start': 91.978, 'duration': 1.121}, {'end': 100.364, 'text': 'So normally we can process data in a file or we can process data in a database, which is your DBMS or RDBMS.', 'start': 93.139, 'duration': 7.225}, {'end': 100.904, 'text': 'you can say', 'start': 100.364, 'duration': 0.54}, {'end': 106.148, 'text': 'Maybe MySQL, Oracle, there are so many RDBMS available.', 'start': 101.264, 'duration': 4.884}], 'summary': 'To persist data beyond application closure, store it in a file or database, such as mysql or oracle.', 'duration': 28.065, 'max_score': 78.083, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY78083.jpg'}, {'end': 149.004, 'src': 'embed', 'start': 119.989, 'weight': 5, 'content': [{'end': 125.131, 'text': 'or so normally in java world we work with objects and then in the database world you have rows and columns.', 'start': 119.989, 'duration': 5.142}, {'end': 128.972, 'text': 'how can you save the object in data in the rows and column format?', 'start': 125.131, 'duration': 3.841}, {'end': 131.714, 'text': "and that's where we have this concept of orm.", 'start': 128.972, 'duration': 2.742}, {'end': 134.014, 'text': 'so what orm is, or what it basically means?', 'start': 131.714, 'duration': 2.3}, {'end': 139.858, 'text': 'it stands for object relational mapping where you have a class, so you have a class structure.', 'start': 134.014, 'duration': 5.844}, {'end': 143.3, 'text': 'so then that class will be having some variables and then you have a table.', 'start': 139.858, 'duration': 3.442}, {'end': 149.004, 'text': 'now, if you can compare, your class name will be your table name and your class properties will be your table columns.', 'start': 143.3, 'duration': 5.704}], 'summary': 'Orm maps object properties to table columns in database.', 'duration': 29.015, 'max_score': 119.989, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY119989.jpg'}, {'end': 192.978, 'src': 'embed', 'start': 158.351, 'weight': 6, 'content': [{'end': 161.754, 'text': 'so there are different languages or technologies where we can use ORM.', 'start': 158.351, 'duration': 3.403}, {'end': 166.146, 'text': 'But the problem is to implement ORM in Java we need some tools right?', 'start': 162.324, 'duration': 3.822}, {'end': 169.347, 'text': 'So when you say tools we have, Hibernate is one of the tools we have.', 'start': 166.186, 'duration': 3.161}, {'end': 170.608, 'text': 'IBT is one of the tools.', 'start': 169.347, 'duration': 1.261}, {'end': 172.509, 'text': 'we have TopLinks, so there are so many tools available.', 'start': 170.608, 'duration': 1.901}, {'end': 174.91, 'text': 'So you can use any of these tools and you can make it work.', 'start': 172.949, 'duration': 1.961}, {'end': 179.872, 'text': 'So using Hibernate, using IBT, you can build an ORM application.', 'start': 175.39, 'duration': 4.482}, {'end': 184.674, 'text': "Now the advantage would be if you're using Hibernate or any ORM tool, let's say you have an object, yeah?", 'start': 180.192, 'duration': 4.482}, {'end': 187.636, 'text': "So let's say you have an alien object inside alien object.", 'start': 184.994, 'duration': 2.642}, {'end': 190.417, 'text': 'you have alien ID, alien name and alien technology.', 'start': 187.636, 'duration': 2.781}, {'end': 192.978, 'text': 'or maybe you can also talk about the salary of alien.', 'start': 190.877, 'duration': 2.101}], 'summary': 'Various orm tools like hibernate, ibt, & toplinks are available for implementing orm in java, enabling the building of orm applications with advantages such as object management and data organization.', 'duration': 34.627, 'max_score': 158.351, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY158351.jpg'}], 'start': 0.672, 'title': 'Jpa and orm in java', 'summary': 'Covers the fundamentals of jpa, emphasizing prerequisites and its significance in data handling. it also delves into the significance of data, object relational mapping (orm) in java, and the benefits of using orm tools like hibernate or ibt for direct object saving.', 'chapters': [{'end': 61.275, 'start': 0.672, 'title': 'Understanding jpa in java', 'summary': 'Discusses the concept of jpa, highlighting its prerequisites including knowledge of java, databases, and jdbc, and explains the theory of jpa and its importance in working with data in the it world.', 'duration': 60.603, 'highlights': ['JPA stands for Java Persistence API, and it is essential for working with data in the IT world.', 'Prerequisites for understanding JPA include knowledge of Java, databases, and JDBC.', 'Knowledge of Hibernate is an added advantage for understanding JPA.', 'Understanding the theory of JPA is crucial before implementing it in practice.']}, {'end': 212.165, 'start': 61.395, 'title': 'Working with data and object relational mapping', 'summary': 'Discusses the importance of data in applications, the need for persisting data, the concept of object relational mapping (orm) in java, and the advantages of using orm tools like hibernate or ibt to directly save objects into a database.', 'duration': 150.77, 'highlights': ["The importance of data in applications and the need to persist it even after the application is closed. Companies spend money to work with data, and it's essential to persist data even after the application is shut down.", 'The concept of Object Relational Mapping (ORM) in Java, which maps class structures and properties to database tables and columns. ORM stands for object relational mapping, where class structures and properties are mapped to database tables and columns.', 'The availability of ORM tools like Hibernate, IBT, and TopLinks to implement ORM in Java applications. Various tools such as Hibernate, IBT, and TopLinks are available to implement ORM in Java applications.', 'Advantages of using ORM tools to directly save objects into a database without the need for fetching and storing data individually using JDBC. ORM tools like Hibernate enable the direct storage of objects into a database, avoiding the tedious process of fetching and storing data individually using JDBC.']}], 'duration': 211.493, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY672.jpg', 'highlights': ['Understanding the theory of JPA is crucial before implementing it in practice.', 'Prerequisites for understanding JPA include knowledge of Java, databases, and JDBC.', 'Knowledge of Hibernate is an added advantage for understanding JPA.', 'JPA stands for Java Persistence API, and it is essential for working with data in the IT world.', 'The importance of data in applications and the need to persist it even after the application is closed.', 'The concept of Object Relational Mapping (ORM) in Java, which maps class structures and properties to database tables and columns.', 'Advantages of using ORM tools to directly save objects into a database without the need for fetching and storing data individually using JDBC.', 'The availability of ORM tools like Hibernate, IBT, and TopLinks to implement ORM in Java applications.']}, {'end': 417.839, 'segs': [{'end': 287.144, 'src': 'embed', 'start': 256.13, 'weight': 0, 'content': [{'end': 262.953, 'text': "They were independent, right? And that's where this Sun Microsystem, they realized, you know, we need to have some common standards.", 'start': 256.13, 'duration': 6.823}, {'end': 267.974, 'text': "And that's where they introduced JPA, which is Java Persistence API.", 'start': 263.233, 'duration': 4.741}, {'end': 269.934, 'text': 'It is basically a specification.', 'start': 268.394, 'duration': 1.54}, {'end': 279.101, 'text': 'So all these tools, maybe Hibernate, Ibtis, Toplin, they will all be implementing JPA standards or JPA specification.', 'start': 270.678, 'duration': 8.423}, {'end': 287.144, 'text': "So that if you want to switch from Ibtis to Hibernate, it will be easier because you're just changing the tool, the implementation,", 'start': 279.681, 'duration': 7.463}], 'summary': 'Sun microsystems introduced jpa as a common standard for tools like hibernate and ibatis to implement, enabling easier switching between them.', 'duration': 31.014, 'max_score': 256.13, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY256130.jpg'}, {'end': 368.062, 'src': 'embed', 'start': 344.776, 'weight': 1, 'content': [{'end': 352.058, 'text': 'in fact, in future, if you are working on Spring Boot applications and then if you want to work with database, we normally go for Spring Boot JPA.', 'start': 344.776, 'duration': 7.282}, {'end': 354.898, 'text': 'so this will be your first step towards JPA in this video.', 'start': 352.058, 'duration': 2.84}, {'end': 356.779, 'text': "so let's try to implement whatever we have talked about.", 'start': 354.898, 'duration': 1.881}, {'end': 360.64, 'text': 'now. what i will do is i will create a new project so you can see my screen there.', 'start': 356.779, 'duration': 3.861}, {'end': 367.061, 'text': "and if we get a new project here and i will say this is a maven project, uh okay, where's maven?", 'start': 360.64, 'duration': 6.421}, {'end': 368.062, 'text': "it's not here.", 'start': 367.061, 'duration': 1.001}], 'summary': 'Introduction to spring boot jpa and project creation', 'duration': 23.286, 'max_score': 344.776, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY344776.jpg'}], 'start': 212.165, 'title': 'Orm tools, jpa, and switching challenges', 'summary': 'Discusses challenges of switching between orm tools like hibernate, ibetis, and toplink, and explains the significance of jpa in facilitating easier switching between technologies, demonstrating its usage in spring boot applications and setting up a jpa demo project using maven and eclipse.', 'chapters': [{'end': 255.991, 'start': 212.165, 'title': 'Orm tools and switching challenges', 'summary': 'Discusses the challenges of switching between different orm tools, highlighting the difficulty of transitioning between tools such as hibernate, ibetis, and toplink due to their unique working structures.', 'duration': 43.826, 'highlights': ['Switching between different ORM tools such as Hibernate, iBetis, and Toplink is challenging due to their unique working structures.', 'ORM tools have their own way of working, making it difficult to transition between them.', 'Companies are increasingly inclined to use ORM tools, leading to a growing demand for ORM implementation.']}, {'end': 417.839, 'start': 256.13, 'title': 'Understanding jpa and its usage', 'summary': 'Discusses the importance of jpa as a specification for implementing common standards in tools like hibernate and ibtis, highlighting its advantage in facilitating easier switching between technologies and its relevance in spring boot applications, leading to the demonstration of setting up a jpa demo project using maven and eclipse.', 'duration': 161.709, 'highlights': ['The importance of JPA as a specification for implementing common standards in tools like Hibernate and Ibtis, highlighting its advantage in facilitating easier switching between technologies. JPA serves as a specification for tools like Hibernate and Ibtis, enabling easier switching between technologies, thus emphasizing its significance in maintaining common standards.', "The relevance of JPA in Spring Boot applications and its role as the first step towards JPA implementation. JPA's significance extends to Spring Boot applications and serves as the initial step towards JPA implementation, indicating its relevance in modern application development.", 'The demonstration of setting up a JPA demo project using Maven and Eclipse, showcasing the practical implementation of the discussed concepts. The chapter culminates in a practical demonstration of setting up a JPA demo project using Maven and Eclipse, providing a hands-on illustration of the concepts discussed.']}], 'duration': 205.674, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY212165.jpg', 'highlights': ['JPA serves as a specification for tools like Hibernate and Ibtis, enabling easier switching between technologies, emphasizing its significance in maintaining common standards.', 'The demonstration of setting up a JPA demo project using Maven and Eclipse showcases the practical implementation of the discussed concepts.', 'The relevance of JPA in Spring Boot applications and its role as the first step towards JPA implementation.']}, {'end': 907.435, 'segs': [{'end': 484.909, 'src': 'embed', 'start': 417.839, 'weight': 0, 'content': [{'end': 425.83, 'text': 'but then i want to implement a jpe type of thing now, of course, to save data somewhere, because jpa will be helpful for saving data.', 'start': 417.839, 'duration': 7.991}, {'end': 428.152, 'text': 'right. so we need a database.', 'start': 425.83, 'duration': 2.322}, {'end': 431.135, 'text': 'unfortunately, i do have mysql here installed.', 'start': 428.152, 'duration': 2.983}, {'end': 433.197, 'text': "so you can see in my machine i'm using mysql.", 'start': 431.135, 'duration': 2.062}, {'end': 435.46, 'text': 'you can use any dbms which you want.', 'start': 433.197, 'duration': 2.263}, {'end': 437.161, 'text': "that's completely fine.", 'start': 435.46, 'duration': 1.701}, {'end': 439.424, 'text': 'uh, you can use postgres, you can use oracle.', 'start': 437.161, 'duration': 2.263}, {'end': 441.105, 'text': 'there will be some modification.', 'start': 439.424, 'duration': 1.681}, {'end': 441.746, 'text': 'we can handle that.', 'start': 441.105, 'duration': 0.641}, {'end': 444.017, 'text': "so i'm using mysql.", 'start': 442.475, 'duration': 1.542}, {'end': 447.28, 'text': "specifically, i'm using mysql workbench to handle my mysql.", 'start': 444.017, 'duration': 3.263}, {'end': 450.063, 'text': 'again, you can work on command line as well if you want it.', 'start': 447.28, 'duration': 2.783}, {'end': 450.824, 'text': "but i'm big.", 'start': 450.063, 'duration': 0.761}, {'end': 452.625, 'text': "i'm a good big fan of gui.", 'start': 450.824, 'duration': 1.801}, {'end': 458.031, 'text': "so i have a workbench here and the database name which i've created is naveen.", 'start': 452.625, 'duration': 5.406}, {'end': 460.133, 'text': 'in that database i have a table because alien.', 'start': 458.031, 'duration': 2.102}, {'end': 465.062, 'text': "So I've already done this beforehand so that I will not waste much of time in the video.", 'start': 460.78, 'duration': 4.282}, {'end': 468.903, 'text': 'So in this alien table, I have those five records.', 'start': 465.502, 'duration': 3.401}, {'end': 473.625, 'text': 'You can see we got one, Naveen, Java, two Archana, Big Data, three, David, .', 'start': 469.263, 'duration': 4.362}, {'end': 478.166, 'text': 'NET, and four, Anna, ML, and then Pranav.', 'start': 473.625, 'duration': 4.541}, {'end': 479.447, 'text': 'So we have these five entries there.', 'start': 478.186, 'duration': 1.261}, {'end': 482.928, 'text': 'Now I want to fetch this data using application.', 'start': 480.327, 'duration': 2.601}, {'end': 484.909, 'text': 'Or maybe I want to store some more data.', 'start': 483.168, 'duration': 1.741}], 'summary': "Implementing jpa with mysql to save data and accessing existing records from the 'naveen' database with 'alien' table containing five entries.", 'duration': 67.07, 'max_score': 417.839, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY417839.jpg'}, {'end': 712.78, 'src': 'heatmap', 'start': 681.127, 'weight': 1, 'content': [{'end': 688.13, 'text': 'Now basically, all the classes or all the classes which represents a database table in JPA is called as entities.', 'start': 681.127, 'duration': 7.003}, {'end': 696.373, 'text': 'Now, in fact, if you have worked on databases, we have E, R diagrams, right? So all the tables are also represented by entities.', 'start': 688.65, 'duration': 7.723}, {'end': 700.997, 'text': 'so alien class is an entity for us right.', 'start': 697.216, 'duration': 3.781}, {'end': 707.599, 'text': 'so to manage those entities we have entity manager, because in your application you might not have one table or one class.', 'start': 700.997, 'duration': 6.602}, {'end': 709.979, 'text': 'you might have 10 classes, so 10 entities.', 'start': 707.599, 'duration': 2.38}, {'end': 712.78, 'text': 'so we need a manager to manage all those entities.', 'start': 709.979, 'duration': 2.801}], 'summary': 'Jpa uses entities to represent database tables, managed by entity manager.', 'duration': 45.34, 'max_score': 681.127, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY681127.jpg'}, {'end': 755.753, 'src': 'embed', 'start': 732.253, 'weight': 3, 'content': [{'end': 740.978, 'text': 'Now, the package is not there is because in the maven dependencies, I have not mentioned that I want to work with JPA or Hibernate.', 'start': 732.253, 'duration': 8.725}, {'end': 746.982, 'text': 'So as I mentioned, JPA is only a specification, right? You need to implement that with the help of Hibernate.', 'start': 741.459, 'duration': 5.523}, {'end': 753.391, 'text': 'or ibetis or toplink, whichever you like, but hibernate is one of the top contender in this list.', 'start': 747.745, 'duration': 5.646}, {'end': 755.753, 'text': 'so i want to implement jpa with the help of hibernate.', 'start': 753.391, 'duration': 2.362}], 'summary': 'Maven dependencies lack jpa or hibernate, need to implement jpa with hibernate.', 'duration': 23.5, 'max_score': 732.253, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY732253.jpg'}], 'start': 417.839, 'title': 'Implementing jpa with databases', 'summary': "Discusses implementing jpa with mysql database, creating a 'naveen' table with 5 records, and using mysql workbench. it also covers setting up jpa with hibernate, downloading project dependencies, and using find method and entitymanager interface.", 'chapters': [{'end': 484.909, 'start': 417.839, 'title': 'Implementing jpa with mysql database', 'summary': "Discusses the implementation of jpa with mysql database, demonstrating the creation of a database and a table named 'naveen' with five records, showcasing the usage of mysql workbench and the option to use other dbms like postgres or oracle.", 'duration': 67.07, 'highlights': ["The chapter demonstrates the creation of a MySQL database named 'naveen' with a table named 'alien' containing five records: Naveen, Java; Archana, Big Data; David, .NET; Anna, ML; and Pranav.", 'The speaker mentions the use of MySQL Workbench for handling the MySQL database and expresses a preference for GUI over command line.', 'The speaker emphasizes the flexibility to use other DBMS like Postgres or Oracle for the implementation of JPA, providing alternative options for the audience.']}, {'end': 907.435, 'start': 485.569, 'title': 'Implementing jpa with hibernate', 'summary': 'Covers the process of creating a class to represent a table, setting up jpa with hibernate, and downloading the necessary dependencies for the project, as well as explaining the use of find method and entitymanager interface.', 'duration': 421.866, 'highlights': ["The chapter covers the process of creating a class to represent a table The speaker demonstrates the creation of a class 'alien' with three properties: id, name, and text, representing the table in the database.", 'Setting up JPA with Hibernate The speaker explains the process of setting up JPA with Hibernate, highlighting the need to download Hibernate dependencies and mentioning the use of Maven repository to search for and download the necessary dependencies.', 'Explaining the use of find method and EntityManager interface The speaker explains the use of the find method and EntityManager interface in JPA, emphasizing the need to manage entities and the process of downloading MySQL connector for working with different DBMS.']}], 'duration': 489.596, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY417839.jpg', 'highlights': ["The chapter demonstrates the creation of a MySQL database named 'naveen' with a table named 'alien' containing five records: Naveen, Java; Archana, Big Data; David, .NET; Anna, ML; and Pranav.", "The chapter covers the process of creating a class to represent a table The speaker demonstrates the creation of a class 'alien' with three properties: id, name, and text, representing the table in the database.", 'The speaker mentions the use of MySQL Workbench for handling the MySQL database and expresses a preference for GUI over command line.', 'Setting up JPA with Hibernate The speaker explains the process of setting up JPA with Hibernate, highlighting the need to download Hibernate dependencies and mentioning the use of Maven repository to search for and download the necessary dependencies.', 'The speaker emphasizes the flexibility to use other DBMS like Postgres or Oracle for the implementation of JPA, providing alternative options for the audience.', 'Explaining the use of find method and EntityManager interface The speaker explains the use of the find method and EntityManager interface in JPA, emphasizing the need to manage entities and the process of downloading MySQL connector for working with different DBMS.']}, {'end': 1251.682, 'segs': [{'end': 935.455, 'src': 'embed', 'start': 907.435, 'weight': 0, 'content': [{'end': 910.816, 'text': 'we got entity manager belongs to persistence package.', 'start': 907.435, 'duration': 3.381}, {'end': 913.477, 'text': "yay, so that's the power of these dependencies.", 'start': 910.816, 'duration': 2.661}, {'end': 918.705, 'text': 'okay, now, how do we create object of entity manager now?', 'start': 914.662, 'duration': 4.043}, {'end': 921.766, 'text': 'unfortunately, we have to write one more step to implement that.', 'start': 918.705, 'duration': 3.061}, {'end': 927.31, 'text': 'to create object of entity manager we need to create object of entity manager factory.', 'start': 921.766, 'duration': 5.544}, {'end': 930.012, 'text': 'so this follows a factory design patterns.', 'start': 927.31, 'duration': 2.702}, {'end': 932.393, 'text': 'you know all, the, all the latest frameworks.', 'start': 930.012, 'duration': 2.381}, {'end': 933.954, 'text': 'they all follow design patterns.', 'start': 932.393, 'duration': 1.561}, {'end': 935.455, 'text': "it's all about design patterns, you know.", 'start': 933.954, 'duration': 1.501}], 'summary': 'Using a factory design pattern to create an entity manager object for persistence.', 'duration': 28.02, 'max_score': 907.435, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY907435.jpg'}, {'end': 1007.875, 'src': 'embed', 'start': 977.767, 'weight': 1, 'content': [{'end': 979.908, 'text': 'uh, is it create any manager factory?', 'start': 977.767, 'duration': 2.141}, {'end': 988.053, 'text': 'yeah, so the method name is create entity manager factory and we have something here again.', 'start': 979.908, 'duration': 8.145}, {'end': 988.433, 'text': 'what is that?', 'start': 988.053, 'duration': 0.38}, {'end': 989.313, 'text': 'something will i will?', 'start': 988.433, 'duration': 0.88}, {'end': 992.115, 'text': 'i will tell you that in some time, but you have to pass something here.', 'start': 989.313, 'duration': 2.802}, {'end': 1003.193, 'text': 'Now, once you got object of EntityManagerFactory, you can use that object EntityManagerFactory and you can say createEntityManager.', 'start': 993.627, 'duration': 9.566}, {'end': 1007.875, 'text': 'So, just to repeat what we have done, we have created two objects EntityManager and EntityManagerFactory.', 'start': 1003.193, 'duration': 4.682}], 'summary': 'Creating entitymanagerfactory and entitymanager objects in the transcript.', 'duration': 30.108, 'max_score': 977.767, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY977767.jpg'}, {'end': 1120.257, 'src': 'embed', 'start': 1093.372, 'weight': 2, 'content': [{'end': 1099.376, 'text': 'where you can specify the properties, i will say new, and this should be an xml file.', 'start': 1093.372, 'duration': 6.004}, {'end': 1102.84, 'text': "yeah. so let's say xml, because xml is a fancy thing.", 'start': 1099.376, 'duration': 3.464}, {'end': 1106.287, 'text': 'right, and like we have properties files, we have xml files.', 'start': 1102.84, 'duration': 3.447}, {'end': 1110.254, 'text': 'thanks to spring framework, we also we have java based configuration.', 'start': 1106.287, 'duration': 3.967}, {'end': 1117.355, 'text': 'so i will say persistence dot xml, and here we have to paste that.', 'start': 1110.254, 'duration': 7.101}, {'end': 1120.257, 'text': 'we have to use that xml code.', 'start': 1117.355, 'duration': 2.902}], 'summary': 'Introducing new xml file for persistence configuration in spring framework.', 'duration': 26.885, 'max_score': 1093.372, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY1093372.jpg'}, {'end': 1189.281, 'src': 'heatmap', 'start': 1120.257, 'weight': 0.941, 'content': [{'end': 1123.218, 'text': 'now, in xml you can specify your own tags.', 'start': 1120.257, 'duration': 2.961}, {'end': 1125.64, 'text': 'i mean the framework will have their own tags.', 'start': 1123.218, 'duration': 2.422}, {'end': 1133.084, 'text': 'so in jpa we have a tag called persistence and in that persistence tag you can mention a persistent unit and you can mention all the properties.', 'start': 1125.64, 'duration': 7.444}, {'end': 1136.325, 'text': "what i'm talking about this thing.", 'start': 1133.084, 'duration': 3.241}, {'end': 1140.728, 'text': 'so you have to specify properties or persistence, and inside this procedure we have a persistent unit.', 'start': 1136.325, 'duration': 4.403}, {'end': 1142.072, 'text': 'now why unit?', 'start': 1141.391, 'duration': 0.681}, {'end': 1144.754, 'text': "is because, let's say, if you have multiple settings,", 'start': 1142.072, 'duration': 2.682}, {'end': 1149.737, 'text': 'you might want to work with different settings for different applications or different behavior or different time.', 'start': 1144.754, 'duration': 4.983}, {'end': 1153.62, 'text': 'so you can specify a different persistent unit and you can select one at a time.', 'start': 1149.737, 'duration': 3.883}, {'end': 1155.482, 'text': 'example these properties.', 'start': 1153.62, 'duration': 1.862}, {'end': 1158.024, 'text': 'they have a unit name as pu.', 'start': 1155.482, 'duration': 2.542}, {'end': 1160.165, 'text': 'you can create another one as pu1, pu2, pu3.', 'start': 1158.024, 'duration': 2.141}, {'end': 1164.769, 'text': 'you can create multiple persistent unit and then here you have to mention these properties.', 'start': 1160.165, 'duration': 4.604}, {'end': 1167.495, 'text': 'so we have a driver name.', 'start': 1165.575, 'duration': 1.92}, {'end': 1170.296, 'text': 'we have a URL, username and password.', 'start': 1167.495, 'duration': 2.801}, {'end': 1173.197, 'text': "now, once you have specified all these things, let's go back to app.", 'start': 1170.296, 'duration': 2.901}, {'end': 1174.337, 'text': 'now, how do we link it?', 'start': 1173.197, 'duration': 1.14}, {'end': 1177.818, 'text': 'how do we link this code with our XML?', 'start': 1174.337, 'duration': 3.481}, {'end': 1180.919, 'text': "and that's where this double quotes comes into picture.", 'start': 1177.818, 'duration': 3.101}, {'end': 1183.639, 'text': 'this is where you will mention your persistent unit name.', 'start': 1180.919, 'duration': 2.72}, {'end': 1184.88, 'text': 'PU can be anything.', 'start': 1183.639, 'duration': 1.241}, {'end': 1188.1, 'text': 'it can be ABC, it can be my JPA PU.', 'start': 1184.88, 'duration': 3.22}, {'end': 1189.281, 'text': 'it can be my PU.', 'start': 1188.1, 'duration': 1.181}], 'summary': 'In jpa, you can specify multiple persistent units with different settings for different applications or behaviors, using tags like persistence and properties, and linking through persistent unit names in the xml.', 'duration': 69.024, 'max_score': 1120.257, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY1120257.jpg'}, {'end': 1170.296, 'src': 'embed', 'start': 1142.072, 'weight': 3, 'content': [{'end': 1144.754, 'text': "is because, let's say, if you have multiple settings,", 'start': 1142.072, 'duration': 2.682}, {'end': 1149.737, 'text': 'you might want to work with different settings for different applications or different behavior or different time.', 'start': 1144.754, 'duration': 4.983}, {'end': 1153.62, 'text': 'so you can specify a different persistent unit and you can select one at a time.', 'start': 1149.737, 'duration': 3.883}, {'end': 1155.482, 'text': 'example these properties.', 'start': 1153.62, 'duration': 1.862}, {'end': 1158.024, 'text': 'they have a unit name as pu.', 'start': 1155.482, 'duration': 2.542}, {'end': 1160.165, 'text': 'you can create another one as pu1, pu2, pu3.', 'start': 1158.024, 'duration': 2.141}, {'end': 1164.769, 'text': 'you can create multiple persistent unit and then here you have to mention these properties.', 'start': 1160.165, 'duration': 4.604}, {'end': 1167.495, 'text': 'so we have a driver name.', 'start': 1165.575, 'duration': 1.92}, {'end': 1170.296, 'text': 'we have a URL, username and password.', 'start': 1167.495, 'duration': 2.801}], 'summary': 'Multiple persistent units allow for different settings and behavior for applications, such as creating pu, pu1, pu2, and pu3.', 'duration': 28.224, 'max_score': 1142.072, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY1142072.jpg'}, {'end': 1253.763, 'src': 'embed', 'start': 1226.953, 'weight': 4, 'content': [{'end': 1230.255, 'text': "how do we mention that this class is not a normal class, it's an entity.", 'start': 1226.953, 'duration': 3.302}, {'end': 1234.777, 'text': 'so for that we need to use a special annotation here, which is called as add entity.', 'start': 1230.255, 'duration': 4.522}, {'end': 1238.26, 'text': 'this is what will make this class as entity.', 'start': 1234.777, 'duration': 3.483}, {'end': 1246.02, 'text': 'and then we have to use at id, which will be your primary key, because every table needs a primary key.', 'start': 1238.26, 'duration': 7.76}, {'end': 1246.901, 'text': 'so two things.', 'start': 1246.02, 'duration': 0.881}, {'end': 1251.682, 'text': 'the first thing the first thing is the entity and second one is at id.', 'start': 1246.901, 'duration': 4.781}, {'end': 1252.003, 'text': 'two things.', 'start': 1251.682, 'duration': 0.321}, {'end': 1253.123, 'text': "that's it.", 'start': 1252.003, 'duration': 1.12}, {'end': 1253.763, 'text': 'now will this work?', 'start': 1253.123, 'duration': 0.64}], 'summary': 'Using @entity and @id annotations to specify entity and primary key in class.', 'duration': 26.81, 'max_score': 1226.953, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY1226953.jpg'}], 'start': 907.435, 'title': 'Entity manager, factory design patterns, and configuring persistence with xml', 'summary': 'Introduces the creation of entity manager and entity manager factory following the factory design pattern and discusses configuring persistence using xml, including specifying properties, creating persistent units, and annotating classes as entities for jpa.', 'chapters': [{'end': 1026.493, 'start': 907.435, 'title': 'Entity manager and factory design patterns', 'summary': 'Introduces the creation of entity manager and entity manager factory, following the factory design pattern, to enable the use of entitymanager and entitymanagerfactory objects for database operations.', 'duration': 119.058, 'highlights': ['The chapter introduces the creation of entity manager and entity manager factory, following the factory design pattern, to enable the use of EntityManager and EntityManagerFactory objects for database operations. (relevance: 5)', 'The method createEntityManagerFactory is used to create the object of EntityManagerFactory, which is essential for creating the EntityManager object for database operations. (relevance: 4)', 'The need to specify the database management system (DBMS) for the EntityManager and EntityManagerFactory objects is highlighted as missing, indicating that the operations will not work without this specification. (relevance: 3)']}, {'end': 1251.682, 'start': 1027.034, 'title': 'Configuring persistence with xml', 'summary': 'Discusses how to configure persistence using xml, including specifying properties, creating persistent units, and annotating classes as entities for jpa.', 'duration': 224.648, 'highlights': ['You need to create a xml file inside the meta inf folder in the resources directory to specify the properties for persistence. The XML file needs to be created inside the meta inf folder in the resources directory to specify the properties for persistence.', 'In JPA, you can create multiple persistent units with different settings by specifying a different persistent unit and selecting one at a time. In JPA, you can create multiple persistent units with different settings by specifying a different persistent unit and selecting one at a time.', 'To make a class an entity for JPA, you need to use the special annotation @Entity and @Id for the primary key. To make a class an entity for JPA, you need to use the special annotation @Entity and @Id for the primary key.', 'The chapter also mentions the usage of double quotes to link the code with the XML by mentioning the persistent unit name. The chapter also mentions the usage of double quotes to link the code with the XML by mentioning the persistent unit name.', 'The chapter explains the process of converting a class into an entity by using the @Entity annotation and defining a primary key with @Id. The chapter explains the process of converting a class into an entity by using the @Entity annotation and defining a primary key with @Id.']}], 'duration': 344.247, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY907435.jpg', 'highlights': ['The chapter introduces the creation of entity manager and entity manager factory, following the factory design pattern, to enable the use of EntityManager and EntityManagerFactory objects for database operations.', 'The method createEntityManagerFactory is used to create the object of EntityManagerFactory, which is essential for creating the EntityManager object for database operations.', 'You need to create a xml file inside the meta inf folder in the resources directory to specify the properties for persistence.', 'In JPA, you can create multiple persistent units with different settings by specifying a different persistent unit and selecting one at a time.', 'To make a class an entity for JPA, you need to use the special annotation @Entity and @Id for the primary key.']}, {'end': 1580.082, 'segs': [{'end': 1326.453, 'src': 'embed', 'start': 1293.893, 'weight': 0, 'content': [{'end': 1296.755, 'text': 'because i want to also want to see how do we save it?', 'start': 1293.893, 'duration': 2.862}, {'end': 1303.364, 'text': 'so what i will do is i will go back here, i will say alien a equal to new alien, And then I will specify some values.', 'start': 1296.755, 'duration': 6.609}, {'end': 1306.205, 'text': "I will say a.setAID as, let's say, 6.", 'start': 1303.384, 'duration': 2.821}, {'end': 1308.526, 'text': 'Or maybe I will go for 9.', 'start': 1306.205, 'duration': 2.321}, {'end': 1315.529, 'text': 'I will say a.setAName as maybe Maria.', 'start': 1308.526, 'duration': 7.003}, {'end': 1321.871, 'text': 'And I will say a.setTech.', 'start': 1316.909, 'duration': 4.962}, {'end': 1326.453, 'text': 'OK, which tech is the meaning now? I would say tech is hardware.', 'start': 1322.751, 'duration': 3.702}], 'summary': "Demonstrating object creation and setting values with 6 or 9 for aid, maria for aname, and 'hardware' for tech.", 'duration': 32.56, 'max_score': 1293.893, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY1293893.jpg'}, {'end': 1392.364, 'src': 'embed', 'start': 1352.734, 'weight': 1, 'content': [{'end': 1355.695, 'text': "let's go back to database here, mysql and okay.", 'start': 1352.734, 'duration': 2.961}, {'end': 1356.716, 'text': 'so there was some issues.', 'start': 1355.695, 'duration': 1.021}, {'end': 1358.477, 'text': 'i just i was just solving the issues.', 'start': 1356.716, 'duration': 1.761}, {'end': 1361.359, 'text': "that's where i've inserted a new row called hidden.", 'start': 1358.477, 'duration': 2.882}, {'end': 1364.6, 'text': "ignore that row, and i would say run this code, let's verify.", 'start': 1361.359, 'duration': 3.241}, {'end': 1365.481, 'text': 'is it maria there?', 'start': 1364.6, 'duration': 0.881}, {'end': 1367.202, 'text': "no, we don't have maria there.", 'start': 1365.481, 'duration': 1.721}, {'end': 1368.422, 'text': "that's weird.", 'start': 1367.202, 'duration': 1.22}, {'end': 1374.305, 'text': 'now the thing is, whenever you want to change data in a database, we use something called, as you know,', 'start': 1368.422, 'duration': 5.883}, {'end': 1377.007, 'text': 'we have transactions to manage asset properties.', 'start': 1374.305, 'duration': 2.702}, {'end': 1385.918, 'text': 'so here we, before saving, we have to start the transaction and before and after saving, we have to commit the transaction.', 'start': 1377.711, 'duration': 8.207}, {'end': 1392.364, 'text': 'and the way you can do that is by saying em, which is the entity manager, get transaction, dot, begin.', 'start': 1385.918, 'duration': 6.446}], 'summary': 'Solving database issues, inserted new row, discussed transaction management using entity manager.', 'duration': 39.63, 'max_score': 1352.734, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY1352734.jpg'}, {'end': 1450.629, 'src': 'embed', 'start': 1419.137, 'weight': 3, 'content': [{'end': 1422.761, 'text': 'we got 9, Maria, and we got hardware.', 'start': 1419.137, 'duration': 3.624}, {'end': 1423.722, 'text': 'simple, yeah.', 'start': 1422.761, 'duration': 0.961}, {'end': 1428.252, 'text': "so now let's see what are the things we have done.", 'start': 1424.349, 'duration': 3.903}, {'end': 1430.614, 'text': 'we have simply created a maven project.', 'start': 1428.252, 'duration': 2.362}, {'end': 1435.458, 'text': 'we created this app class, or we already had that class here.', 'start': 1430.614, 'duration': 4.844}, {'end': 1438.701, 'text': 'in this we have created the alien object and then two objects are important.', 'start': 1435.458, 'duration': 3.243}, {'end': 1442.164, 'text': 'one is entity manager and the entity manager factory.', 'start': 1438.701, 'duration': 3.463}, {'end': 1444.826, 'text': 'so using factory we can create object of entity manager.', 'start': 1442.164, 'duration': 2.662}, {'end': 1450.629, 'text': 'we just need to specify the persistent unit name which we defined in the XML file.', 'start': 1444.826, 'duration': 5.803}], 'summary': 'Created a maven project and initialized alien object, entity manager, and entity manager factory.', 'duration': 31.492, 'max_score': 1419.137, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY1419137.jpg'}, {'end': 1555.187, 'src': 'embed', 'start': 1526.465, 'weight': 4, 'content': [{'end': 1531.209, 'text': "it's because in future, if you think, okay, let's change, I don't want to work with.", 'start': 1526.465, 'duration': 4.744}, {'end': 1538.394, 'text': "maybe let's say, if you don't create a JPA project or if you create a Hibernate project from start, the problem is in Hibernate everything.", 'start': 1531.209, 'duration': 7.185}, {'end': 1541.316, 'text': 'what you do is Hibernate code example.', 'start': 1538.394, 'duration': 2.922}, {'end': 1546.24, 'text': 'these two objects will be based on Hibernate framework or Hibernate packages.', 'start': 1541.316, 'duration': 4.924}, {'end': 1550.463, 'text': "the thing is, in future, if you want to change it, you need to change the, so let's say from Hibernate.", 'start': 1546.24, 'duration': 4.223}, {'end': 1555.187, 'text': 'if you want to move to iPadS or maybe Toplink, you have to change the source code as well.', 'start': 1550.463, 'duration': 4.724}], 'summary': 'Changing from hibernate to another framework requires source code changes.', 'duration': 28.722, 'max_score': 1526.465, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY1526465.jpg'}], 'start': 1251.682, 'title': 'Saving and fetching data in java and implementing transactions in jpa', 'summary': 'Demonstrates saving and fetching data in java using an alien object with specific attributes, encountering issues during verification, and modifying the data value. it also explains the process of implementing transactions in jpa and the advantages of using jpa for future flexibility and minimal changes when switching between orm tools.', 'chapters': [{'end': 1368.422, 'start': 1251.682, 'title': 'Saving and fetching data in java', 'summary': 'Demonstrates saving and fetching data in java using an alien object with specific attributes, such as aid, aname, and tech, and then persisting it to the database, encountering issues during verification, and modifying the data value, ultimately highlighting the simplicity of saving and fetching data.', 'duration': 116.74, 'highlights': ['The process of saving and fetching data in Java is demonstrated using an alien object with attributes like AID, AName, and tech, and then persisting it to the database, encountering issues during verification, and modifying the data value to demonstrate the simplicity of the process.', 'The code demonstrates creating a new alien object with specific attribute values such as AID as 9, AName as Maria, and tech as hardware, and then persisting it to the database using the persist method.', 'During verification, issues are encountered, and a new row is inserted into the database, but upon running the code, the expected data is not found, leading to confusion and highlighting potential issues with the saving process.']}, {'end': 1580.082, 'start': 1368.422, 'title': 'Implementing transactions in jpa', 'summary': 'Explains the process of implementing transactions in jpa, including starting and committing transactions, creating an entity manager and factory, and the advantages of using jpa for future flexibility and minimal changes when switching between orm tools.', 'duration': 211.66, 'highlights': ['By starting and committing transactions using entity manager, we can manage asset properties in JPA, simplifying the process (e.g., em.getTransaction().begin and em.getTransaction().commit).', 'The chapter demonstrates the creation of a maven project, app class, and alien object, emphasizing the importance of entity manager and entity manager factory for managing JPA entities.', 'The speaker emphasizes the advantages of using JPA for future flexibility, highlighting that minimal changes are required when switching between different ORM tools, such as Hibernate and Toplink.']}], 'duration': 328.4, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/otinfgwkMbY/pics/otinfgwkMbY1251682.jpg', 'highlights': ['The process of saving and fetching data in Java is demonstrated using an alien object with attributes like AID, AName, and tech, and then persisting it to the database, encountering issues during verification, and modifying the data value to demonstrate the simplicity of the process.', 'By starting and committing transactions using entity manager, we can manage asset properties in JPA, simplifying the process (e.g., em.getTransaction().begin and em.getTransaction().commit).', 'The code demonstrates creating a new alien object with specific attribute values such as AID as 9, AName as Maria, and tech as hardware, and then persisting it to the database using the persist method.', 'The chapter demonstrates the creation of a maven project, app class, and alien object, emphasizing the importance of entity manager and entity manager factory for managing JPA entities.', 'The speaker emphasizes the advantages of using JPA for future flexibility, highlighting that minimal changes are required when switching between different ORM tools, such as Hibernate and Toplink.', 'During verification, issues are encountered, and a new row is inserted into the database, but upon running the code, the expected data is not found, leading to confusion and highlighting potential issues with the saving process.']}], 'highlights': ['The importance of data in applications and the need to persist it even after the application is closed.', 'Advantages of using ORM tools to directly save objects into a database without the need for fetching and storing data individually using JDBC.', 'JPA serves as a specification for tools like Hibernate and Ibtis, enabling easier switching between technologies, emphasizing its significance in maintaining common standards.', 'The demonstration of setting up a JPA demo project using Maven and Eclipse showcases the practical implementation of the discussed concepts.', "The chapter demonstrates the creation of a MySQL database named 'naveen' with a table named 'alien' containing five records: Naveen, Java; Archana, Big Data; David, .NET; Anna, ML; and Pranav.", 'The method createEntityManagerFactory is used to create the object of EntityManagerFactory, which is essential for creating the EntityManager object for database operations.', 'The process of saving and fetching data in Java is demonstrated using an alien object with attributes like AID, AName, and tech, and then persisting it to the database, encountering issues during verification, and modifying the data value to demonstrate the simplicity of the process.', 'The speaker emphasizes the advantages of using JPA for future flexibility, highlighting that minimal changes are required when switching between different ORM tools, such as Hibernate and Toplink.']}