Hibernate is an object-relational mapping (ORM) framework in Java. Let's talk about the different states of an object's.
Transient: In Hibernate, an object is considered transient if it is not associated with any database table.
Persistent: An object becomes persistent when it is associated with a database table. It means the object must be associated with session object
Detached: An object becomes detached when it was once associated with a session but the session is closed or the object is explicitly detached.
📦 MySQL is a widely-used relational database management system (RDBMS) that uses Structured Query Language (SQL) to manage and manipulate data. SQL is divided into several categories, each serving a specific purpose: DDL, DML, DQL, TCL, and DCL. 1. Data Definition Language (DDL) DDL commands are used to define and manage database structures such as tables, indexes, and schemas. The main DDL commands include CREATE, ALTER, DROP, and TRUNCATE. ⭐ CREATE: This command creates a new database object. CREATE TABLE students ( id INT PRIMARY KEY, name VARCHAR(100), age INT ); ⭐ ALTER : This command modifies an existing database object. ALTER TABLE students ADD COLUMN email VARCHAR(100); ⭐ DROP : This command deletes an existing database object. DROP TABLE students; ⭐ TRUNCATE : This command removes all records from a table without deleting the table itself. TRUNCATE TABLE students;

Comments
Post a Comment