Skip to content

Instantly share code, notes, and snippets.

Avatar

Gerry gerrymclarnon

View GitHub Profile
@gerrymclarnon
gerrymclarnon / persistence.xml
Created Jan 24, 2013
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.
View persistence.xml
<?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 Dec 11, 2015
A TomEE 1.5 resource file that can be referred to from a persistence unit file, e.g. https://gist.github.com/4629416.
View resources.xml
<!--
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
View 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 Dec 16, 2012
Readme file in GitHub markdown format
View README.md

README markdown

Readme file in GitHub markdown format.

@gerrymclarnon
gerrymclarnon / .gitignore
Created Dec 16, 2012
GIT will ignore these Java files.
View .gitignore
*.class
# Package Files #
*.jar
*.war
*.ear
View HelloWorldFootballApp.java
package net.playermanager.samples.HelloWorld;
public class HelloWorldFootballApp {
public static void main(String[] args) {
System.out.println("Hello World Football");
}
}
You can’t perform that action at this time.