
Posted In: Hibernate
Hibernate 5 – One to Many – @JoinColumn vs mappedBy
@JoinColumn Specifies a column for joining an entity association or element collection. If the JoinColumn annotation itself is defaulted, a single join column is assumed and the default values apply. mappedBy The field that owns the relationship. Required unless the relationship is unidirectional. @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = “employer”) private Set employees […]
Read More
Posted In: Hibernate
Hibernate 5 – @GenericGenerator hilo_seqeunce
From Hibernate user guide hilo; legacy-hilo Define a custom algorithm for generating pools of values based on a single value from a table or sequence. These optimizers are not recommended for use. They are maintained (and mentioned) here simply for use by legacy applications that used these strategies previously. @GenericGenerator(name = “hilo_sequence_generator”, strategy = “org.hibernate.id.enhanced.SequenceStyleGenerator”, […]
Read More
Posted In: Apache Log4J, Hibernate, Logback, Logging, SLF4J
Hibernate 5 – print a query string with parameter values
Logging frameworks used 1. Using LOG4J slf4j-log4j12 2. Using LOGBACK 3. Using LOG4J 2X 1. Using LOG4J slf4j-log4j12 Maven slf4j-log4j12 log4j.properties Will print both BasicTypeRegistry and BasicBinder (parameter values) logs. log4j.logger.org.hibernate.type=ALL Will print only BasicBinder (parameter values) logs. log4j.logger.org.hibernate.type.descriptor.sql=trace Parameter values logs 12:52:11,376 TRACE BasicBinder:65 – binding parameter [1] as [VARCHAR] – [Abhijit] 12:52:11,376 […]
Read More
Posted In: Hibernate
Hibernate 5 – hbm2ddl.auto explained
Note – hbm2ddl.auto is a facility to do faster development and testing. This should not be used in production. hbm2ddl.auto has four options 1. validate 2. update 3. create4 4. create-drop Automatically validates or exports schema DDL to the database when the SessionFactory is created. With create-drop, the database schema will be dropped when the […]
Read More
Posted In: Spring + Hibernate Integration
Spring3 + Hibernate3 example
Read More
Tags: Hibernate3, Spring3
- Apache (13)
- Build Tools (2)
- Gradle (2)
- Caching (1)
- cpanel (1)
- cURL (1)
- Database (7)
- Hibernate (5)
- Java Core (38)
- Java Script (15)
- Bootstrap (1)
- File Upload (7)
- jQuery (3)
- React (3)
- JEE (13)
- JSON (41)
- GSON (13)
- Jackson 1X (1)
- Jackson 2X (12)
- jsoniter (1)
- Logging (2)
- Apache Commons Logging (1)
- Apache Log4J (1)
- Logback (1)
- SLF4J (1)
- MongoDB (1)
- OS (1)
- Linux (1)
- Security (5)
- Server (4)
- Tomcat (4)
- Service (2)
- Micro (2)
- Spring (46)
- Pattern (2)
- Spring Boot (20)
- Spring Data (4)
- Spring MVC (8)
- Spring REST (13)
- Spring Security (7)
- Testing (11)
- XML (5)
- JDOM XML Parser (1)