Understand the @Entity, @Table, @Id, and @Column annotations.
- [Instructor] So let's actually see JPA entity.…We'll start with a simple example…where we map one database table to one JPA entity.…On the left side is an ER diagram component…representing a table called student.…Student has four columns.…Student_id, student_name, student_fulltime,…and student_age.…On the right side is a Java class called…student with four attributes.…
Student_id of type integer,…name, that's a string,…fulltime, which is a boolean,…and age, which is an integer.…The class must be annotated with @Entity.…@Table is where we specify the database table name.…Entities must have a unique identifier attribute…with @Id.…If desired, @Generatedvalue…tells JPA to generate the id when persisted.…
For this reason,…we don't include student id in the constructor.…@Column maps the class attributes to table columns.…Now that we have identified…the object to relational mapping metadata,…all of our database related coding…can stay in the logical world…because JPA will take care of the physical world for us.…
AuthorMary Ellen Bowman
In this course, learn how to easily implement JPA-based repositories using Spring Data JPA. Mary Ellen Bowman describes the Spring Data umbrella project, and helps you understand JPA for object-relational mapping. She also covers querying, and dives into other Spring Data Commons features such as QueryDSL and auditing.
- Spring Data Commons
- Using JPA for object-relational mapping
- Declaring Spring Data Repositories
- Creating query methods with property expressions and @Query
- Query by example
- QueryDSL Spring Data Extension
- Spring Data REST
- Introduction to Spring Data Mongo
- Common pitfalls
Skill Level Intermediate
Java Database Access with Hibernatewith Peggy Fisher1h 28m Intermediate
1. The Spring Data Umbrella Project
Spring Data Commons2m 39s
2. Understanding JPA for Object-Relational Mapping
3. Introduction to Spring Data JPA
4. Querying with Spring Data
5. More Repository Types
6. Special Features
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.