Displaying posts filed under

programming

Jun
9
2010

How to Configure Spring beans.xml File: The Use of PropertyPlaceholderConfigurer

The file “beans.xml” used for you application is already a kind of configuration file. However, this file is designed for the developer who can quickly customize the application with less coding changes. It is not recommended for an end user to change the file.
For example, you can, of course, define the database connection properties in [...]

Jun
7
2010

How to Configure Spring beans.xml File: Collection properties and EntityManagerFactory Examples

Java beans in Spring can also have their collection properties populated in the beans.xml file. The collection properties here mean things like List, Map and Array.
For example, if you want to create a JPA EntityManagerFactory with a set of connection properties, these properties can be configured in beans.xml like this:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" [...]

May
18
2010

How to Configure Spring beans.xml File: Basic Usage

how to configure spring beans.xml file with more flexibility
Spring is a very flexible java framework. In spring, beans are the main building bricks of an application while the bean configuration file (mostly beans.xml) acts as cement that glues the beans together.

The file beans.xml also allows beans to be initialized with particular values. For example, you [...]

Mar
24
2010

Remember to Clear Entity Manager if Entities No Longer Used

Recently  a lesson was learned about the proper use of Java JPA to persist a large number of records into database in a batch process.

Some times it is necessary to load the records line by line from a large file and insert into the database table. There can be several ways to do this:

Use the [...]

Sep
2
2009

Use Ant to Generate ChangeLogs From CVS ang Group by Date

Since version 1.6.1, Ant, the java build tool, has a core task called “cvschangelog“. It is quite useful to use this task to grab a list of recent changes committed to the CVS repository. The output of this task is in XML format. Something like the following:

<changelog>
<entry>
<date>2009-09-02</date>
<time>12:00</time>
<author>robin</author>
<file>
<name>test/ant/task/ChangeLog.txt</name>
<revision>1.2</revision>
<prevrevision>1.1</prevrevision>
[...]