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
window.fbAsyncInit = function() { | |
FB.init({ | |
appId: '225654845054108', // aqui vai o id do App do facebook =) | |
status: true, | |
xfbml: true | |
}) | |
}; |
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
(function(d, s, id) { | |
var js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) { | |
return; | |
} | |
js = d.createElement(s); | |
js.id = id; | |
js.src = "//connect.facebook.net/pt_BR/all.js"; |
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
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-failsafe-plugin</artifactId> | |
<version>2.12.4</version> |
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
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-failsafe-plugin</artifactId> | |
<version>2.12.4</version> |
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
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-pmd-plugin</artifactId> |
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
<dependencies> | |
<dependency> | |
<groupId>org.hibernate</groupId> | |
<artifactId>hibernate-core</artifactId> |
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
import java.util.Optional; | |
public class Rastreio { | |
public static void main(String[] args) { | |
Buscador buscador = new Buscador(); | |
Optional<Pessoa> pessoaOp = buscador.buscaPorNome("Fabrício de Souza Batista"); | |
pessoaOp.ifPresent(c -> { | |
System.out.println("cpf: "+c.getCpf()); | |
}); | |
} | |
} |
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
import java.util.Optional; | |
public class Buscador{ | |
// metodos e atributos | |
public Optional<Pessoa> buscaPorNome(String nome) { | |
try{ | |
Pessoa pessoa = (Pessoa) entityManager. | |
createQuery("SELECT p FROM Pessoa p WHERE nome LIKE:pessoaNome"). | |
setParameter("pessoaNome", nome).getSingleResult(); | |
Optional<Pessoa> pessoaOp = Optional.of(pessoa); | |
return pessoaOp; |
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
public class Rastreio { | |
public static void main(String[] args) { | |
Buscador buscador = new Buscador(); | |
Pessoa pessoa = buscador.buscaPorNome("Fabrício de Souza Batista"); | |
if(pessoa != null){ | |
System.out.println("cpf: "+pessoa.getCpf()); | |
} | |
} | |
} |
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
public class Rastreio { | |
public static void main(String[] args) { | |
Buscador buscador = new Buscador(); | |
Pessoa pessoa = buscador.buscaPorNome("Fabrício de Souza Batista"); | |
System.out.println("cpf: "+pessoa.getCpf()); | |
} | |
} |