Saturday, May 27, 2017

How Does Spring Boot Decide What Default Configurations to include?

It will consider some classes from 'spring-boot-autoconfigure' jar file.


When we start a spring boot application , it consults these classes in 'spring-boot-autoconfigure' jar file.
Depending upon certain conditions it applies these auto configuration.



for Example above its checking to see if Dispatcher Servlet is on class path. So if it finds those components in place then it knows it needs to apply its AutoConfiguration.


 
and here is how its used. This Code simulates our web.xml entries.



If you want to Override any of these bean definition simply....

Wednesday, October 26, 2016

Hibernate Display Real SQL Queries

if I set
true
in my hibernate.cfg.xml configuration file in the console I can see the SQL.
But it's not real SQL... Can I see the SQL code that will be passed directly to database?

Example:
I see
select this_.code from true.employee this_ where this_.code=?

Can I see
select employee.code from employee where employee.code=12

the real SQL?

Only Solution is http://www.mkyong.com/hibernate/how-to-display-hibernate-sql-parameter-values-solution/