Skip to content

Instantly share code, notes, and snippets.

View wombat's full-sized avatar
😃
Working

Daniel Sachse wombat

😃
Working
View GitHub Profile
@wombat
wombat / FoodResourceTest.java
Last active December 21, 2015 14:08
JAX-RS 2.0 Client + Arquillian = Dream Team
@RunWith(Arquillian.class)
public class FoodResourceTest {
@Deployment
public static WebArchive createDeployment() {
return ShrinkWrap.create(WebArchive.class, "test.war")
.addPackages(true, "eu.jugcologne.foodeys")
.addClass(RestApplication.class)
.addAsResource("test-persistence.xml", "META-INF/persistence.xml")
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
}
@wombat
wombat / standalone.xml
Created April 17, 2013 15:14
DataSource in standalone.xml
<datasource jta="true" jndi-name="java:jboss/datasources/TweetCamp" pool-name="TweetCampDS" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:mysql://localhost:3306/TweetCamp</connection-url>
<driver>mysql</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>100</max-pool-size>
<prefill>true</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
@wombat
wombat / gist:5405115
Created April 17, 2013 15:12
Mysql driver in standalone.xml
<driver name="mysql" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
@wombat
wombat / module.xml
Last active December 16, 2015 08:19
Mysql module.xml
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.mysql">
<resources>
<resource-root path="mysql-connector-java-5.1.24-bin.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
</dependencies>
</module>
@Entity
public class Product implements Serializable {
@Id
private Long id;
@Transient
private String translation;
public String getTranslation() {
return translation;
@wombat
wombat / ScTable.java
Last active December 11, 2015 03:29
Dynamic product description translations
@XmlRootElement
@Entity
@Table(name = "sc_table")
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorColumn(name = "sc_table_type", discriminatorType = DiscriminatorType.STRING)
public class ScTable extends ScModel implements Serializable {
@Getter
@Setter
@Column(name = "code")
private String code;
@wombat
wombat / gist:3911776
Created October 18, 2012 13:20
JPA Modelgen
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<compilerArgument>-proc:none</compilerArgument>
</configuration>
</plugin>