Skip to content

Instantly share code, notes, and snippets.

View andreluizf's full-sized avatar

Andre luiz Ferreira andreluizf

  • Matera
  • Av. Duque de Caxias
View GitHub Profile
@andreluizf
andreluizf / MySelectManyCheckBoxRenderer
Created May 17, 2013 12:37
SelectCheckBox Menu prime faces NxM
package com.xkey.principal.renderers;
import java.io.IOException;
import java.util.List;
import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
import javax.faces.component.UINamingContainer;
import javax.faces.component.UISelectMany;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
package com.xkey.principal;
import com.xkey.principal.helpers.LoginHelper;
import com.google.common.collect.Lists;
import com.xkey.principal.bean.Login;
import com.xkey.saxgeral.helpers.SessionHelper;
import java.util.List;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.security.authentication.AuthenticationProvider;
package com.xkey.saxgeral.helpers;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class MD5Helper {
@andreluizf
andreluizf / ArvoreBinaria.java
Last active December 29, 2015 08:39
Arvore binaria
package RaulJoaquim;
import javax.swing.JOptionPane;
public class ArvoreBinaria {
private static class ARVORE {
public String animal;
public ARVORE dir, esq;
}
@andreluizf
andreluizf / cfg.xml
Created February 4, 2014 17:43
projeto hibernate
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Database connection settings -->
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://ativacao.xkeysti.com.br:3306/DB_CAX</property>
<property name="hibernate.connection.username">xkey</property>
<property name="hibernate.connection.password">b50988995b</property>
<!-- JDBC connection pool (use the built-in) -->
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="ProjetoWEbMaven" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<properties>
<property name="javax.persistence.jdbc.url"
value="jdbc:mysql://mysql.nutricaonline.com:3306/nutricaonline?zeroDateTimeBehavior=convertToNull" />
<property name="javax.persistence.jdbc.password" value="Sup0rt3" />
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
<property name="javax.persistence.jdbc.user" value="nutricaonline" />
@andreluizf
andreluizf / persistence.xml
Created February 5, 2014 18:33
alta performace conexao DB
<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="order-old" transaction-type="RESOURCE_LOCAL">
<class>model.Order</class>
<class>model.OrderLine</class>
<class>model.Customer</class>
<properties>
<!-- Change this to access your own database. -->
@andreluizf
andreluizf / persistence.xml
Last active August 29, 2015 14:02
repository
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="CAX" transaction-type="JTA">
<jta-data-source>CAX</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="eclipselink.jdbc.cache-statements" value="true"/>
<!-- Optimization #10 - batch writing -->
<property name="eclipselink.jdbc.batch-writing" value="JDBC"/>
<property name="eclipselink.jdbc.batch-writing.size" value="1000"/>
import br.com.xkey.cax.model.Produto;
import br.com.xkey.cax.repository.produto.ProdutoRepository;
import javax.ejb.EJB;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
import javax.faces.convert.FacesConverter;
@andreluizf
andreluizf / pom.xml
Created July 18, 2014 16:57
maven deploy
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>