Skip to content

Instantly share code, notes, and snippets.

View gerrymclarnon's full-sized avatar

Gerry gerrymclarnon

View GitHub Profile
@gerrymclarnon
gerrymclarnon / persistence.xml
Created January 24, 2013 23:20
A TomEE 1.5 persistence unit example using EclipseLink as the JPA provider. The data source is defined in a resources.xml file, an example of which can be found here... https://gist.github.com/4629327.
<?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="CustomerDBSpringPU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/sample</jta-data-source>
<class>customerdb.Customer</class>
<class>customerdb.DiscountCode</class>
@gerrymclarnon
gerrymclarnon / resources.xml
Last active December 11, 2015 16:39
A TomEE 1.5 resource file that can be referred to from a persistence unit file, e.g. https://gist.github.com/4629416.
<!--
A TomEE 1.5 Resource definition file used to configure application specific resources.
Location: <webapp>/WEB-INF/classes/META-INF/resources.xml
-->
<resources>
<Resource id="jdbc/sample" type="DataSource">
JdbcDriver org.apache.derby.jdbc.ClientDriver
JdbcUrl jdbc:derby://localhost:1527/sample
UserName app
Password app
@gerrymclarnon
gerrymclarnon / MyResource.java
Created December 17, 2012 13:18
MyResource.java
package net.playermanager.examples;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
/** Example resource class hosted at the URI path "/myresource"
*/
@Path("/myresource")
@gerrymclarnon
gerrymclarnon / README.md
Created December 16, 2012 20:13
Readme file in GitHub markdown format

README markdown

Readme file in GitHub markdown format.

@gerrymclarnon
gerrymclarnon / .gitignore
Created December 16, 2012 20:09
GIT will ignore these Java files.
*.class
# Package Files #
*.jar
*.war
*.ear
@gerrymclarnon
gerrymclarnon / HelloWorldFootballApp.java
Created November 7, 2012 13:11
HelloWorldFootballApp.java
package net.playermanager.samples.HelloWorld;
public class HelloWorldFootballApp {
public static void main(String[] args) {
System.out.println("Hello World Football");
}
}