Skip to content

Instantly share code, notes, and snippets.

View gabanox's full-sized avatar

Gabriel Ramirez gabanox

View GitHub Profile
package com.company.hibernate.dao;
import java.util.List;
import com.company.hibernate.domain.Contact;
public interface ContactDao {
// Find all contacts
public List<Contact> findAll();
/**
* Created on Oct 12, 2011
*/
package com.company.hibernate.domain;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
/**
* Created on Oct 12, 2011
*/
package com.company.hibernate.domain;
import static javax.persistence.GenerationType.IDENTITY;
import java.io.Serializable;
import java.util.Date;
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.samples.spring</groupId>
<artifactId>spring-utility</artifactId>
<version>1.0.0.CI-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Spring Utility</name>
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://54.172.6.102:3306/spring
jdbc.username=fractalystlab
jdbc.password=fractalystlab
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<description>JDBC Pool con DataSource MySQL y StoredProcedure</description>
<import resource="datasource-dbcp.xml"/>
package com.company.app.annotation.procedure;
import java.sql.Types;
import javax.sql.DataSource;
import org.springframework.jdbc.core.SqlParameter;
import org.springframework.jdbc.object.SqlFunction;
public class SfFirstNameById extends SqlFunction<String> {
package com.company.app.annotation.dao;
import java.util.List;
import javax.annotation.Resource;
import javax.sql.DataSource;
import org.springframework.stereotype.Repository;
import com.company.app.annotation.procedure.SfFirstNameById;
package com.company.app.annotation.dao;
public interface ContactSfDao {
public String getFirstNameById(Long id);
}