Skip to main content

Posts

Showing posts with the label framework

How to create spring application by using eclipse IDE

How to Create a Spring Application Using Eclipse IDE (Legacy Spring Core Setup) Building a classic Spring Framework application from scratch using manual JAR dependencies and XML configuration is one of the most effective ways to understand inversion of control (IoC) and dependency injection (DI). While modern enterprise environments rely heavily on Spring Boot and Maven or Gradle build automation, legacy systems and fundamental computer science curricula still require a granular understanding of how the Spring IoC container instantiates beans, parses configuration metadata, and manages application lifecycles. ▶ Listen English (India) English (US) Hindi Telugu Tamil Kannada Malayalam Bengali Marathi Gujarati Punjabi Urdu Arabic Spanish French German Portuguese Japanese Korean Chinese (Simplified) Pick a language, then press Listen. This tutorial walks through the ...

Hibernate auto increment with example

Understanding Primary Key Generation Strategies in Hibernate Hibernate Auto-Increment Workflow Hibernate Auto-Increment Workflow 1 Database Schema Setup Create relational table with an auto-incrementing primary key. 2 Define POJO Domain Model Implement Serializable POJO representing the database entity. 3 Configure Mapping Strategy Define identity generation using JPA annotations or XML mapping. 4 Persist Entity via ORM Delegate primary key generation and execute insert operation. Figure: Hibernate Auto-Increment Workflow When persisting entities in a relational database using Hibernate ORM, managing primary keys correctly is critical to data integrity and performance. While manually assigning IDs works for simple static lookup tables, production systems require automated identity generation. Relying on the application layer to calculate or look up the next available primary key introduces concurrency bottlenecks, race conditions, and s...

hibernate sample application with example

Building a Production-Grade Hibernate Sample Application Hibernate Application Architecture Flow Hibernate Application Architecture Flow 1 Configuration Initialization Parse XML metadata and connection properties during startup. 2 SessionFactory Creation Instantiate the thread-safe global cache and SQL factory. 3 Session Acquisition Open a short-lived, single-threaded unit of work per request. 4 Transaction & Operations Execute data persistence and query operations via the session. 5 Session Closure Close the session safely to prevent memory leaks and bloat. Figure: Hibernate Application Architecture Flow Object-Relational Mapping (ORM) frameworks bridge the gap between object-oriented domain models and relational database management systems (RDBMS). In the Java ecosystem, Hibernate serves as the industry standard implementation of the Java Persistence API (JPA). Writing raw JDBC boilerplate code requires managing manual co...

ORM features in hibernate

Core ORM Features in Hibernate: A Production Architecture Guide Hibernate ORM Workflow Hibernate ORM Workflow 1 Define Entity Graph Model data as Java objects with inheritance and collections. 2 Configure Runtime Set up database connection and Hibernate properties. 3 Execute Queries Use ORM abstractions instead of writing raw JDBC SQL strings. 4 Map ResultSets Automatically translate relational rows into rich POJOs. Figure: Hibernate ORM Workflow Enterprise Java persistence historically suffered from severe impedance mismatch. Relational databases store data in tables with foreign-key constraints, rows, and scalar data types. Object-oriented languages like Java represent data as hierarchical object graphs, encapsulation boundaries, inheritance trees, and complex collections. Bridging this gap manually via raw JDBC requires writing repetitive boilerplate code to map ResultSets to POJOs, manage connection lifecycles, and manually construc...