package com.repository.impl;

import com.repository.BaseRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.datasource.DataSourceUtils;
import javax.sql.DataSource;
import java.sql.Connection;

/**
 *
 * Implementation for the base repository.
 *
 * @author Laurentiu Marcut
 */
public class BaseRepositoryImpl implements BaseRepository {

    @Autowired
    private DataSource dataSource;

    /**
     *
     * Getter connection.
     *
     * @return connection
     */
    public Connection getConnection() {
        return DataSourceUtils.getConnection(this.dataSource);
    }
}
