Instantly share code, notes, and snippets.

View livraria.sql
This file has been truncated, but you can view the full file.
create table livros (
id integer primary key auto_increment not null,
nome varchar(100) not null,
data_de_lancamento date not null,
autor_id integer not null,
preco decimal(10,2) not null
);
create table autores (
id integer primary key auto_increment not null,
View aula3.sql
create table medicos (
id integer primary key auto_increment not null,
crm varchar(50) not null,
nome varchar(100) not null
);
create table receitas (
id integer primary key auto_increment not null,
medico_id int not null,
nome_remedio varchar(100) not null,
View livraria.sql
This file has been truncated, but you can view the full file.
create table livros (
id integer primary key auto_increment not null,
nome varchar(100) not null,
data_de_lancamento date not null,
autor_id integer not null,
preco decimal(10,2) not null
);
create table autores (
id integer primary key auto_increment not null,
View EsId.java
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface EsId {
}
View gist:a08cc3809121a7298a16
public class PerguntaService {
//METODO QUE DEVE SER TESTADO, POIS A LOGIDA DE OBTER A LISTA TA AQUI
public List<Pergunta> listarPerguntas(){
return List<Pergunta> perguntas = LogicaParaObterEssaLista();
}
//METODO UNICAMENTE FEITO PARA TRATAR E FAZER O RETORNO PARA O CONTROLLER
View gist:68e47c40d171d71bd7b2
public static void main(String[] args) {
// String consultaSimplesURL = "http://www8.receita.fazenda.gov.br/SIMPLESNACIONAL/aplicacoes.aspx?id=21";
String consultaSimplesURL = "http://www.santander.com.br";
HashMap<String,Object> inflate = new HashMap<String,Object>();
// inflate.put("cnpj","ContentPlaceHolderConteudo_lblCNPJ::text");
// inflate.put("nomeEmpresaResult","ContentPlaceHolderConteudo_lblNomeEmpresa::text");
// inflate.put("situacaoResult","ContentPlaceHolderConteudo_lblSituacaoSimples::text");
View gist:0a6ae1b05960be8d30a2
Filtro JAVA
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
getToken((HttpServletRequest) request);
chain.doFilter(request, response);
}
private String getToken(HttpServletRequest httpRequest) throws ServletException {
String token = null;
View teste.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd">