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 com.github.brunodutr.persistence.criteria.service.CriteriaProcessor; | |
public class PessoaService { | |
public List<Pessoa> buscarPessoas(FiltroPessoa filtroPessoa) { | |
return CriteriaProcessor.create(entityManager, Pessoa.class) | |
.filter(filtroPessoa) | |
.getResultList(); |
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 com.github.brunodutr.persistence.criteria.annotations.CriteriaEqual; | |
public class FiltroPessoa { | |
@CriteriaEqual | |
private String nome; | |
@CriteriaEqual | |
private String sobrenome; | |
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
/** | |
* Query dinamica que filtra por nome e sobrenome | |
* | |
*/ | |
public List<Pessoa> buscarPessoas(String nome, String sobrenome) { | |
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); | |
CriteriaQuery<Pessoa> criteriaQuery = criteriaBuilder.createQuery(Pessoa.class); | |
Root<Pessoa> pessoaRoot = criteriaQuery.from(Pessoa.class); |
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
package example.bdutra.it; | |
import javax.inject.Inject; | |
import javax.persistence.EntityManager; | |
import javax.persistence.PersistenceContext; | |
import javax.persistence.Query; | |
import javax.transaction.UserTransaction; | |
import example.bdutra.jpa.person.PersonEntity; |
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
<?xml version="1.0" ?> | |
<arquillian | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns="http://jboss.org/schema/arquillian" | |
xsi:schemaLocation="http://jboss.org/schema/arquillian | |
http://jboss.org/schema/arquillian/arquillian_1_0.xsd"> | |
<defaultProtocol type="Servlet 3.0" /> | |
<extension qualifier="transaction"> |
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
package example.bdutra.it; | |
import org.eu.ingwar.tools.arquillian.extension.suite.annotations.ArquillianSuiteDeployment; | |
import org.jboss.arquillian.container.test.api.Deployment; | |
import org.jboss.shrinkwrap.api.Archive; | |
import org.jboss.shrinkwrap.api.ShrinkWrap; | |
import org.jboss.shrinkwrap.api.spec.JavaArchive; | |
@ArquillianSuiteDeployment | |
public class Deployments { |
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
package example.bdutra.it.jms; | |
import static org.junit.Assert.assertEquals; | |
import java.util.Arrays; | |
import java.util.List; | |
import javax.inject.Inject; | |
import org.jboss.arquillian.container.test.api.Deployment; |
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
package example.bdutra.it.jmx; | |
import static javax.management.MBeanServerInvocationHandler.newProxyInstance; | |
import java.io.IOException; | |
import javax.management.MBeanServerConnection; | |
import javax.management.MalformedObjectNameException; | |
import javax.management.ObjectName; | |
import javax.management.remote.JMXConnector; |
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
swarm: | |
datasources: | |
data-sources: | |
ArquillianDS: | |
driver-name: myh2 | |
connection-url: jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE | |
user-name: sa | |
password: sa | |
jdbc-drivers: | |
myh2: |
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
package example.bdutra.jms; | |
import static javax.ejb.TransactionAttributeType.REQUIRES_NEW; | |
import java.io.Serializable; | |
import javax.annotation.Resource; | |
import javax.ejb.TransactionAttribute; | |
import javax.jms.ConnectionFactory; | |
import javax.jms.JMSContext; |
NewerOlder