- JPA ou Hibernate?
- JPA deu origem ao Hibernate. Hibernate é uma implementação de JPA
- Existe um mundo onde JDBC puro é mais utilizado?
- Eu uso bastante JDBC puro. Normalmente se usa quando se precisa falar diretamente com o banco, não HQL ou coisa equivalente. Existem tretas com spring-jdbc que o jdbc puro trata bem. Não cheguei a usar algo mais específico do spring para stream de dados e coisas mais pesadas.
- Existe algum Query Builder no mundo Java?
- Muitos. Como exemplo, jOOQ.
Um pequeno exercício Java para trabalhar modelagem de dados.
Você precisa saber se o SLA de atendimento está sendo atendido e, se não está, quantos pacientes na fila foram atendidos depois do SLA.
Você receberá um único array de EVENTOS, ordenado pela ordem cornológica de acontecimento. Cada evento contém as seguintes informações:
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.Arrays; | |
import java.util.stream.Collector; | |
class SegundoMenor { | |
static class AB { | |
int a, b; | |
boolean primeiro; | |
boolean segundo; |
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.stream.Collectors; | |
import java.util.stream.Stream; | |
public class LongestCommonPrefix { | |
static final Holder FIRST_HOLDER = new Holder("", 0) { | |
@Override | |
Holder acc(String another) { | |
return another.isEmpty()? EMPTY_HOLDER: new Holder(another); | |
} | |
@Override |
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.time.Instant; | |
import static java.time.temporal.ChronoUnit.*; | |
class Domingos { | |
public static void main(String... args) { | |
Instant x1 = Instant.now(); | |
int deltaMes[] = { | |
31, // jan 1 | |
28, // fev 1 | |
31, // mar 1 |
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.math.BigDecimal; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Collections; | |
import java.util.List; | |
public class DesafioSemLoop { | |
public static BigDecimal totalCompras(List<Compra> compras) { | |
//TODO implementar a soma sem usar loops while, for, do-while... |
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 * as dotenvsafe from "dotenv-safe" | |
import * as Discord from "discord.js" | |
const createDeffered = () => { | |
let d = {}; | |
const promise = new Promise((resolve, reject) => { | |
d = { resolve, reject }; | |
}); | |
return { ...d, promise }; | |
}; |
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
#include<stdio.h> | |
int main() { | |
printf("Standard output\n"); | |
fprintf(stderr, "Standard Error\n"); | |
return 0; | |
} |
Oi, Aldrick!
O exemplo é bobo, a dúvida não
Alguns passos a seguir rumo a dominação do Java:
- Faz um CRUD Java
- Faz um cli Java
- Aprende a fazer um package Java
- Aprende a consumir um package Java
- Aprende a configurar e atualizar packages
- Aprende a deploiar Java
- Aprende a consumir requests usando Java
- Aprende a usar databases no Java
NewerOlder