
Discover how Hibernate and the Java Persistence API simplify database interactions in Java applications, featuring configuration, entity mapping, CRUD, and data retrieval for intermediate Java developers.
Install and configure MySQL Community Edition, including MySQL Workbench and server setup. Create the finances schema and an infinite user with full privileges, and run the schema script.
Install eclipse to start java development; download eclipse id for java developers, a web-based version with maven, choose a 64-bit mirror, extract the zip, set a workspace, and launch eclipse.
Learn how to download, extract a zip file, and locate your working files for the course, then copy them to your desktop and access them from the player or disk.
Explore Hibernate and object relational mapping concepts and how Java objects persist state to a database. Learn how Hibernate configures connections, metadata mappings, and sessions to persist objects.
Explore Hibernate's object-relational mapping via the Java persistence application programming interface standard. Map entities with annotations, configure connections, and perform create, read, update, delete via sessions and Hibernate query language.
Explore object relational mapping with Hibernate, comparing data models and object models, and learn how primary and foreign keys, joins, and object references shape persistence in Java.
Explore the discrepancies between data models and object models and see how ORM frameworks like Hibernate use metadata to generate persistence code, reduce boilerplate, and manage keys and errors.
See hibernate in action through a hands-on demo that covers configuration, mapping data, and session usage to persist an account type entity to a relational database.
Dive into Hibernate by building a simple persistence app, setting up Eclipse and Maven, and connecting to a MySQL database, using annotations for entity mapping and sessions for persistence.
Set up a new Maven project in Eclipse, configure Hibernate dependencies and logging, and build a JPA entity for the finances_user table, including getters and setters.
Annotate the user class with entity and table metadata, map the primary key with id and generated value, and use column annotations to align with the relational database.
Learn to configure Hibernate using SML by creating a Hibernate configuration file, applying a base template, and setting session factory properties, driver, URL, dialect, and mappings.
Obtain a session, start a transaction, create a User entity, persist it, and commit to write to the database using Hibernate.
Explore the core mapping annotations for Hibernate and JPA, learn how value types and field types affect mapping, and distinguish JPA as a specification from Hibernate as its implementation.
Examine field vs. property access in Hibernate, learn how to switch by annotating getters, move mappings from fields to methods, and see how property access inserts a record.
Explore how the column annotation uses insertable and updateable to control when Hibernate writes columns, and how nullable and not null constraints influence persistence.
Explore how Hibernate identifies entities via surrogate primary keys, using @Id and @GeneratedValue with identity or sequence strategies; learn when natural keys apply and sequence generation details.
Explore the table generation strategy for primary keys in Hibernate, including configuring a table generator and mapping key name and value. Compare auto, sequence, identity, and table strategies.
Learn how the @Transient annotation tells Hibernate to ignore non-persistent fields, using a user entity example to prevent unknown column errors and ensure successful inserts.
Use the @Temporal annotation to guide Hibernate’s mapping of Java date and time types to database date, time, and timestamp columns.
Learn how to use the @Formula annotation in Hibernate to derive a runtime property, such as age, from a SQL expression during selects, and understand refresh and database coupling risks.
Learn how hibernate maps Java basic value types to database columns, annotate entities, inspect fields at startup, and understand entity identity, lifecycle states, and collection and composite value mappings.
Explore how hibernate and jpa map basic, composite, and collection value types within a user entity, including single-column basics, embedded composites, and collection-valued fields.
Learn to map composite and collection value types with JPA and Hibernate, using embeddable and collection annotations to store basic and composite values within the owning entity.
Learn to map a composite value type by extracting an address class as an embeddable component of the bank entity, with embedded fields stored in the bank table.
Map a collection of basic value types on an entity and persist it with Hibernate using element collection and collection table annotation.
Map a hash map of basic value types to the database for bank contacts, using map key column annotation with collection table and element collection.
Map a collection of composite value types, such as addresses, with an element collection and a join table. Persist two addresses for one user, with addresses as embeddables.
Explore how entity associations connect objects in Hibernate and JPA, mapping one-to-one, one-to-many, and many-to-one relationships with annotations, and understand bidirectional and unique directional relationships and join columns or tables.
Map entity associations in JPA and Hibernate by linking accounts and transactions, using foreign keys, source and target objects, and one-to-one, one-to-many, many-to-one, many-to-many mappings including junction tables.
Model a unidirectional one-to-one association between credential and user using JPA annotations. Configure @OneToOne with cascade all and @JoinColumn on the foreign key user_id.
Map a bidirectional one-to-one between credential and user by defining the owning side with a join column and using maps by attribute on the inverse side, while managing both sides.
Learn to model a unidirectional one-to-many relationship with JPA annotations, mapping account to transactions via a join column, configuring cascade all and the nullable constraint on the foreign key.
Map a bidirectional one-to-many association with JPA annotations, linking accounts to transactions via many-to-one and a join column; manage sides with accessors and verify by printing account from a transaction.
Map a one-to-many relationship using a join table annotation between budgets and budget transactions. Configure join columns, owning side, and cascade to attach transactions to budgets and persist optional relationships.
Map a unidirectional many-to-many relationship using a join table named user_accounts, designate the accounts entity as the owning side, and relate accounts to users with a set and cascade all.
Map a bi directional many to many association between accounts and users, with accounts owning via a join table and mapped by users on the non-owning side.
Learn how to build a Hibernate application by configuring, mapping metadata, and using the session interface to perform CRUD, queries, and transactions while managing entity lifecycles.
Explore the Hibernate and JPA persistence lifecycle, mapping how invoking methods transitions entities through transient, persistent, removed, and detached states within the persistence context.
Explore the persistence lifecycle and entity states—transient, persistent, removed, detached—and see how save, update, delete, and evict transitions are managed by the persistence context and session.
Use the Hibernate save method to move an account from transient to persistent, cascade saves to related transactions, and persist the account to the database.
Use Hibernate get and load to retrieve entities from the database, turning records into persistent objects in the persistence context; get returns null for missing, while load returns a proxy.
Open a persistence context, retrieve a bank entity in a persistent state, modify its name and last updated date, then commit the transaction to persist changes via Hibernate.
Invoke the Hibernate API delete method to move an entity from the persistent state to removed, then commit to delete it from the database and sync the persistence context.
Reattach a detached bank entity to a new persistence context using Hibernate's update method. Observe the entity becoming attached and an update statement fired to reflect changes in the database.
Explore how Hibernate's saveOrUpdate handles both transient and detached entities, inserting new records or reattaching existing ones by inspecting identifiers in the persistence context.
Explore how the hibernate flush method synchronizes the persistence context with the database via the session and transaction interfaces, and how commit, rollback, and select operations trigger a flush.
Explore how to configure a jpa application with persistence.xml, compare hibernate sessions to the entity manager, perform persistence operations with crud and transactions, and distinguish application-managed from container-managed entity managers.
Configure a JPA application by adding the Hibernate entity manager dependency, creating a persistence.xml with a persistence unit named infinite finances, and supplying the Hibernate provider and database connection properties.
Save a new entity with JPA by creating an entity manager factory and entity manager, begin and commit the transaction, and persist the entity.
Learn to retrieve entities with the JPA entity manager using find and getReference, explore persistence context and contains checks, and understand null results and proxy-based exceptions.
Modify an entity using JPA by creating an entity manager from a persistence unit, starting a transaction, loading it into the persistence context, changing its name, and committing to update.
Use the JPA entity manager to remove an entity from the persistence context, transitioning it from persistent to removed, and commit the transaction to delete the record in the database.
Learn how to reattach a detached entity using the entity manager's merge method, and how clear and detach affect the persistence context to determine updates or inserts.
Explore similarities between the JPA entity manager and the Hibernate session, showing overlapping methods like persist, clear, merge, and flush, and how JPA maps to Hibernate core.
Explore advanced Hibernate concepts, including composite keys and associations, enumeration mapping, inheritance strategies, organizing the persistence layer, mastering complex queries with native SQL, and configuring schema generation.
Map composite natural primary keys with JPA annotations by building a currency ID class and annotating fields in the currency entity, enabling retrieval via concatenated keys.
Explore compound join columns for entities with concatenated primary keys. Use a many-to-one with join columns and referenced column names to map market to currency.
Learn how to map enumerations in Hibernate with JPA annotations, storing account type as strings for robustness, and avoid ordinal pitfalls using @Enumerated(EnumType.STRING).
Learn how to use a mapped superclass in Hibernate to share fields like name, issuer, and purchase date across stock and bond entities, including practical limitations and queries.
Explore table per class inheritance in Hibernate and JPA, replacing mapped superclass with table per class strategy, mapping investment as abstract parent with a table generator and bidirectional portfolio association.
Annotate the investment class for table per class inheritance and link to portfolio. Remove ids from stock and bond, share investment and portfolio ids, and persist via cascade.
Utilize the single table inheritance strategy in Hibernate and JPA for stock and bond by sharing investment table. A discriminator column distinguishes types, accepting nulls as a tradeoff for performance.
Organize persistence code into its own layer to keep it separate from business logic, adopting a consistent DJO pattern with interfaces, an abstract DJO, and entity-specific DJOs using Hibernate sessions.
Explore using database views to handle complex queries in Hibernate and JPA, map a read-only view as an entity, and query with native SQL.
Hibernate can auto generate database tables from your entity model, validate and update schemas, and use create-drop for quick development while noting production risks.
Explore Hibernate query language (hql) and Java persistence query language (jpql) for querying entity model, and learn their syntax and how to pull data with the Hibernate and jpa apis.
Execute Hibernate HQL queries to retrieve transaction entities, using the query interface, and print each transaction title.
Explore how to enhance JPA and Hibernate queries using expressions and operators, building where predicates with dot notation, comparisons, like, between, and logical operators, with transaction examples.
Use parameterized queries to safely handle user input and prevent SQL injection in Hibernate and JPA. Use positional and named parameters, bind big decimal amounts, and handle temporal types explicitly.
Explore inner joins in Hibernate and JPQL to link accounts with their transactions, including deposits over five hundred, and practice explicit joins with an entity manager and typed queries.
Explore how to apply functions in queries to refine results, including the lower function for case-insensitive comparisons, concatenation, traversing multiple associations, and projections returning object arrays.
Define predefined named queries with the named query annotation, attach them to entities for organization and performance benefits, and reuse them via the entity manager with parameters.
Explore lazy loading in Hibernate and JPA, seeing how accounts fetch work with a many-to-one to bank, where lazy defers bank loading until accessed, improving performance.
Are you ready to get more out of JDBC and your data using smart, streamlined techniques? This Hibernate course is a great place to start.
You will start by learning about object relational mapping and Hibernate, then jump into learning about the Hibernate basics. From there, Kevin will teach you basic mapping annotations, mapping composite and collection types, and entity associations. This video tutorial also covers Hibernate API, JPA API, advanced mapping and configurations, and criteria API. Finally, you will learn about the Hibernate query language and Java Persistence query language.
Once you have completed this computer based training course, you will be able to simplify and clarify the persistence tier of your applications using Hibernate and Java Persistence, granting you productivity improvements and easing future maintenance.