Created
October 16, 2014 13:16
-
-
Save gabanox/06f48f7659efde682991 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
@Repository("contactSfDao") | |
public class JdbcContactSfDao implements ContactSfDao { | |
private DataSource dataSource; | |
private SfFirstNameById sfFirstNameById; | |
@Resource(name="dataSource") | |
public void setDataSource(DataSource dataSource) { | |
this.dataSource = dataSource; | |
sfFirstNameById = new SfFirstNameById(dataSource); | |
} | |
public DataSource getDataSource() { | |
return dataSource; | |
} | |
public String getFirstNameById(Long id) { | |
List<String> result = sfFirstNameById.execute(id); | |
return result.get(0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment