Custom Validation

Activity: Custom validation Perform custom validation based on your business rulesOur example: Course Code must start with "KVT"Spring MVC calls our custom validationCustom validation returns Boolean value for pass/fail (true/false) Development Process Create custom validation rule Add validation rule to Customer classDisplay error message on HTML formUpdate confirmation page Breaking from up top //  "CourseCodeConstrainValidator.class" … Continue reading Custom Validation

entity-lifecycle-model

Entity Lifecycle Model in JPA & Hibernate The entity lifecycle model is one of the core concepts of JPA and all its implementations. Even though it’s not directly visible when working with JPA’s EntityManager, it affects all operations you perform. The different states of the model define how your persistence provider, e.g. Hibernate, handles your … Continue reading entity-lifecycle-model

Advance Hibernate Mapping Overview

Basic Mapping: Advance Mappings In the database you most likely will haveMultiple tablesRelationships between TablesNeed to model this with Hibernate Advanced Mappings Type One-to-OneOne-to-Many, Many-to-OneMany-to-Many Important Database Concepts Primary key and foreign keyCascade Primary Key and Foreign Key Primary Key: identify a unique row in a tableForeign Key:Link tables togetherA field in one table that … Continue reading Advance Hibernate Mapping Overview

FAQ: How To View Hibernate SQL Parameter Values

Question: I see hibernate printing out the query parameters as ? in the console.Is it possible to printout the value that was actually queried on thedatabase. Asking as this would help in the debugging purpose. Answer: When using Hibernate, if you log the Hibernate SQL statements, you will see this: Hibernate: insert into student (email, first_name, last_name, … Continue reading FAQ: How To View Hibernate SQL Parameter Values

Hibernate Introduction

Hibernate Overview Topics What is Hibernate?Benefits of HibernateCode Snippets What is Hibernate? A framework for persisting/ saving java objects into a databasewww.hibernate.org At high level you will have Java Application, it will make use of Hibernate framework for saving and retrieving data from the database. Benefits of Hibernate  Hibernate handles all the low-level SQLMinimize the … Continue reading Hibernate Introduction