Skip to content

Instantly share code, notes, and snippets.

View rrajendran's full-sized avatar

Ramesh Rajendran rrajendran

  • Capella Technologies Ltd.,
  • Wokingham, United Kingdom
View GitHub Profile
@rrajendran
rrajendran / BaseDao.java
Last active December 18, 2015 13:19
JPA Dao Layer with default implementation by an abstract class. This is something similar to CrudRepository in spring data jpa
import java.io.Serializable;
public interface BaseDao<T, ID extends Serializable> {
/**
* Saves a given entity. Use the returned instance for further operations as the save operation might have changed the
* entity instance completely.
*
* @param entity
* @return the saved entity
*/
@rrajendran
rrajendran / databaseContext.xml
Last active December 13, 2015 19:08
Spring database context configuration
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:batch="http://www.springframework.org/schema/batch" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
@rrajendran
rrajendran / gitpull
Created February 11, 2013 22:00
Pulls all the project in a given directory usage: ./gitpull.sh
#!/bin/bash
gitpull() {
while read data; do
cd $data
git pull | cat
echo -e
cd ..
done
}
@rrajendran
rrajendran / gitbranch
Created February 11, 2013 21:58
Loops through all the git projects and branches to a given name. usage: ./gitbranch.sh <branch-name>
#!/bin/bash
gitbranch() {
while read data; do
cd $data
git stash
git checkout $1 | cat
git pull
cd ..
echo