Skip to content

Instantly share code, notes, and snippets.

git ls-files --others --exclude-standard | xargs -I {} -n1 rm "{}"
@aeberhardo
aeberhardo / persistence.xml
Created March 4, 2016 21:11 — forked from jesuino/persistence.xml
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>
@aeberhardo
aeberhardo / InMemoryDbFixture.java
Created January 17, 2016 07:09 — forked from skempken/InMemoryDbFixture.java
Creates a JPA EntityManager in code with a H2 in-memory database based on entity classes.
import org.hibernate.ejb.Ejb3Configuration;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import java.util.Collection;
import java.util.Properties;
public class InMemoryDbFixture {
private String scope;