Pages

Monday, 29 July 2013

Autowiring in Spring

Wiring show the relationship between the bean & Spring Container. Using the Wiring you are tell
the Spring container which bean needed and how should that dependencies inject.In Spring we can
automatically wire using the autowire property of bean.

How to call stored procedure in Hibernate

Step 1: First Create the Stored Procedure in MySQL

Create procedure 'GetStudents' (INT student_id varchar(20))
Begin
    select * from student where s_id = student_id;
End

call GetStudents('2');

Inversion of Control (IOC) vs DI (Dependency Injection)


Difference between the Inversion of Control(IOC) and DI (Dependency Injection) : The main goal of IOC and DI is removed the dependencies of your application and make it's loosely coupled. Let's Understand IOC using the Simple mailing Application work flow.

ElasticSearch & Index Document

How to Index & Search Document in Elastic Search Using the Elastic Search Java API
  • Here we see the example how to insert to the Student  document in Elastic Search Engine & Search through the XContentBuilder.
  • Here are three Class in the Example
  • Student.java
  • Subject.java
  • ElasticSearchExample.java

    Spring Annotations Example

    How to create the Basic Application Using the Annotation.

    In this Example we inject the dependencies of Foo object in the Bar class using the Spring Container and provide the wiring between the Spring Container & bean using the Annotation.

    Spring Container & Bean Life Cycle

    Basic Spring Container

    Spring Container is core part of Spring frameworks.Spring Container provide or uses the IOC (Inversion of Control) for the manage the Component means Beans that made up your applications.

    There are two types of Spring container in Spring framework.

    1). First One defined by org.springframeworks.bean.factory.BeanFactory interface  this the most basic type   of Spring Container provide the basic Support for the instantiation and dispatch the bean and inject the       dependencies.

    2). Second One defined by org.springframeworks.context.ApplicationContext interface this build from the using of the BeanFactory wrapper and it's provide the application frameworks services like the resolve the textual message from the properties file and we can implement the events listener on the application context.