Created
August 6, 2013 01:08
-
-
Save marciojrtorres/6161164 to your computer and use it in GitHub Desktop.
Classe DAO e método de busca sobrecarregados
This file contains 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
class ClienteDAO { | |
public List<Cliente> buscaPorNome(String nome, String sobrenome) { | |
// ... código necessário para buscar clientes pelo nome e sobrenome | |
} | |
// ... | |
class ClienteDAO { | |
public List<Cliente> buscaPorNome(String nome, String sobrenome) { | |
// ... código necessário para buscar clientes pelo nome e sobrenome | |
} | |
public List<Cliente> buscaPorNome(String nome) { | |
buscaPorNome(nome, null); | |
} | |
public List<Cliente> buscaPorSobrenome(String sobrenome) { | |
buscaPorNome(null, sobrenome); | |
} | |
} | |
// exemplo de uso: | |
dao.buscaPorNome("marina", "torres"); | |
dao.buscaPorNome("marina"); | |
dao.buscaPorSobrenome("torres"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment