-
JDBC
Select records from database with JdbcTemplate
With this example we are going to demonstrate how to select records from a database using the JdbcTemplate class provided…
Read More » -
Mail
Sending e-mails with Spring
We will create a simple Spring service that will be used for sending mail. One method will create a SimpleMailMessage…
Read More » -
Beans
Use preferences in Spring
Spring provides PreferencesPlaceholderConfigurer that can be used to load preferences. <bean id="preferencePlaceHolder" class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer"> <property name="userTreePath" value="com.myapp.preference.staticPreferenceLoader" /> </bean> <bean id="myEntity"…
Read More » -
hibernate
Add Restrictions to the Criteria object in Hibernate
In this example we shall show you how to add restrictions to the Criteria object in Hibernate. In Hibernate, Criteria…
Read More » -
hibernate
Order query resultset in Hibernate with Criteria
This is an example of how to order a query resultset in Hibernate with Criteria. In Hibernate, Criteria is a…
Read More » -
hibernate
Count total records in Hibernate with Projections
With this example we are going to demonstrate how to count total records in Hibernate using the Projections Class. In…
Read More » -
hibernate
Pagination in Hibernate with query results
In this example we shall show you how to use pagination in Hibernate with query results. To use pagination in…
Read More » -
hibernate
Set limit in Hibernate query result
This is an example of how to set limit in Hibernate query result. In order to set limit to a query…
Read More » -
hibernate
Retrieve objects in Hibernate with HQL query
With this example we are going to demonstrate how to retrieve objects in Hibernate with HQL query. In short, to…
Read More » -
hibernate
Create Hibernate SessionFactory example
In this example we shall show you how to create a new SessionFactory example in Hibernate. To create a new…
Read More »