Skip to content

Instantly share code, notes, and snippets.

View jesuino's full-sized avatar

William Antônio Siqueira jesuino

View GitHub Profile
@jesuino
jesuino / persistence.xml
Created August 1, 2014 18:23
Wildfly Datasource and JPA Descriptor (persistence.xml)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0" xsi:schemaLocation=" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="primary">
<jta-data-source>java:jboss/datasources/PeopleDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.transaction.flush_before_completion" value="true"/>
</properties>
</persistence-unit>
@jesuino
jesuino / Person.java
Last active August 29, 2015 14:04
Service and model classes
@Entity
public class Person {
@GeneratedValue
@Id
private long id;
private String firstName;
private String lastName;
private String rfid;
private String job;
@jesuino
jesuino / AccordionTeste.java
Last active August 29, 2015 14:04
Uso do Accordion
// criamos o Accordion
Accordion accordion = new Accordion();
// criando os paineis do Accordion. Notem que o construtor recebe o
// texto que vai aparecer e o nó
TitledPane painel1 = new TitledPane("Painel 1", new Label(
"O Primeiro Painel"));
TitledPane painel2 = new TitledPane("Painel 2", new Button(
"Sou um botão do painel 2"));
TitledPane painel3 = new TitledPane("Painel 3", new Rectangle(150, 50));
// Adicionando um ícone ao Painel
package org.jugvale.rfid;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;
@jesuino
jesuino / FTDIReaderPane.java
Created August 10, 2014 19:30
A JavaFX Pane to read the RFID Tag
package org.jugvale.rfid.ui;
import java.io.IOException;
import java.nio.file.Path;
import java.util.concurrent.ExecutionException;
import java.util.function.Consumer;
import javafx.concurrent.Task;
import javafx.scene.control.Label;
import javafx.scene.control.ListView;
@jesuino
jesuino / PersonResource.java
Created August 12, 2014 02:53
REST and Person class
package org.jugvale.peoplemanagement.rest;
import java.util.List;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
@jesuino
jesuino / jboss-web.xml
Created August 13, 2014 05:29
Descriptors to set security on my app
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<security-domain>other</security-domain>
</jboss-web>
@jesuino
jesuino / PersonResource.java
Created August 14, 2014 15:08
A JAX-RS resource for the Person table
import java.util.List;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
@jesuino
jesuino / Main.java
Created August 16, 2014 00:44
Trying to handle a task usin JMS and REST
package com.redhat.gss.bpms.client;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
import javax.naming.InitialContext;
import javax.naming.NamingException;
@jesuino
jesuino / dependencia.xml
Created August 18, 2014 19:41
Dependência Maven para usar a SDK
<dependency>
<groupId>com.sensedia</groupId>
<artifactId>transparencia-java-sdk</artifactId>
<version>1.0</version>
</dependency>