001    /*
002    @license.text@
003     */
004    package biz.hammurapi.sql;
005    
006    import java.sql.Connection;
007    import java.sql.SQLException;
008    
009    /**
010     * Retrieves identity by executing SQL statement
011     * @author Pavel Vlasov
012     * @revision $Revision$
013     */
014    public class GenericIdentityRetriever implements IdentityRetriever {
015            
016            private String sql;
017    
018            public GenericIdentityRetriever(String sql) {
019                    this.sql=sql;
020            }
021    
022            public int retrieve(Connection con) throws SQLException {
023                    return new SQLProcessor(con, null).projectSingleInt(sql, null);
024            }
025    
026    }