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
/** | |
==== ÁRVORE GENEALÓGICA === | |
Vovô Eugênio | |
- Matheus | |
- Pedrinho | |
- Valentina | |
- Mariana | |
- Bruno | |
- Patricia |
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 masterdev; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class ExemplosMap { | |
public static void main(String[] args) { | |
Map<Long, Pessoa> mapa = new HashMap<>(); | |
Pessoa joao = new Pessoa(1L, "Joao"); |
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
<html> | |
<head> | |
<style> | |
.parent { | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
background-color: darkgrey; | |
width: 400px; | |
height: 400px; |
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
<html> | |
<head> | |
<style> | |
.parent { | |
display: flex; | |
background-color: darkgrey; | |
width: 400px; | |
height: 400px; | |
} |
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
@Service | |
public class PessoaService { | |
@Autowired private PessoaRepository pessoaRepository; | |
@Autowired private EnderecoRepository enderecoRepository; | |
public PessoaDTO save (PessoaDTO pessoaDTO) { | |
Pessoa pessoa = convertFrom(pessoaDTO); | |
pessoaRepository.save (pessoa); | |
saveEndereco (pessoaDTO, pessoa); |
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
@Entity | |
public class Pessoa { | |
@Id private Long id; | |
private String nome; | |
} | |
@Entity | |
public class Endereco { | |
@Id private Long id; | |
private Long pessoaId; |
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
public class PessoaDTO { | |
private Long id; | |
private String nome; | |
// dados do endereco | |
private String rua; | |
private String numero; | |
private String bairro; | |
private String cep; | |
private String cidade; |
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
@Entity | |
public class Pessoa { | |
@Id private Long id; | |
private String nome; | |
// dados do endereco | |
private String rua; | |
private String numero; | |
private String bairro; | |
private String cep; |
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
import java.lang.StringBuilder | |
fun main() { | |
val pairs = mutableListOf<Pair<Int, Int>>() | |
pairs.add(Pair(0, 9)) | |
pairs.add(Pair(7, 4)) | |
pairs.add(Pair(5, 2)) | |
pairs.add(Pair(8, 1)) | |
pairs.add(Pair(3,6)) |
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
public interface Identificacao { | |
String getCnpj(); | |
Integer getPeriodo(); | |
static Identificacao of(final String cnpj, final Integer periodo) { | |
return new Identificacao () { | |
public String getCnpj() { | |
return cnpj; | |
} | |
public Integer getPeriodo() { |
NewerOlder