Removed clojure work for now.
diff --git a/jpars.script.clojure/.classpath b/jpars.script.clojure/.classpath
deleted file mode 100644
index 1151b0d..0000000
--- a/jpars.script.clojure/.classpath
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java">
- <attributes>
- <attribute name="optional" value="true"/>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java">
- <attributes>
- <attribute name="optional" value="true"/>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
- <attributes>
- <attribute name="owner.project.facets" value="java"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
diff --git a/jpars.script.clojure/.project b/jpars.script.clojure/.project
deleted file mode 100644
index 3eaec5d..0000000
--- a/jpars.script.clojure/.project
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>jpars.script.clojure</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.common.project.facet.core.builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.validation.validationbuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
- <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
- <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpars.script.clojure/.settings/.jsdtscope b/jpars.script.clojure/.settings/.jsdtscope
deleted file mode 100644
index b46b920..0000000
--- a/jpars.script.clojure/.settings/.jsdtscope
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/main/webapp"/>
- <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
- <attributes>
- <attribute name="hide" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
- <classpathentry kind="output" path=""/>
-</classpath>
diff --git a/jpars.script.clojure/.settings/oracle.eclipse.tools.webtier.ui.prefs b/jpars.script.clojure/.settings/oracle.eclipse.tools.webtier.ui.prefs
deleted file mode 100644
index ce0f81f..0000000
--- a/jpars.script.clojure/.settings/oracle.eclipse.tools.webtier.ui.prefs
+++ /dev/null
@@ -1,20 +0,0 @@
-//_hiddenCategory_\:http\://java.sun.com/jsf/core=false
-//_hiddenCategory_\:http\://java.sun.com/jsf/html=false
-//_hiddenCategory_\:http\://java.sun.com/jsp/jstl/core=false
-//_hiddenCategory_\:http\://java.sun.com/jsp/jstl/fmt=false
-//_hiddenCategory_\:http\://java.sun.com/jsp/jstl/sql=false
-//_hiddenCategory_\:http\://java.sun.com/jsp/jstl/xml=false
-//_hiddenCategory_\:http\://java.sun.com/jstl/core=false
-//_hiddenCategory_\:http\://java.sun.com/jstl/core_rt=false
-//_hiddenCategory_\:http\://java.sun.com/jstl/fmt=false
-//_hiddenCategory_\:http\://java.sun.com/jstl/fmt_rt=false
-//_hiddenCategory_\:http\://java.sun.com/jstl/sql=false
-//_hiddenCategory_\:http\://java.sun.com/jstl/sql_rt=false
-//_hiddenCategory_\:http\://java.sun.com/jstl/xml=false
-//_hiddenCategory_\:http\://java.sun.com/jstl/xml_rt=false
-//_hiddenCategory_\:http\://mojarra.dev.java.net/mojarra_ext=true
-_hiddenCategory_\:HTML=false
-_hiddenCategory_\:ManagedBeans=false
-_hiddenCategory_\:PageVariables=false
-_hiddenCategory_\:jsp11=false
-eclipse.preferences.version=1
diff --git a/jpars.script.clojure/.settings/org.eclipse.jdt.core.prefs b/jpars.script.clojure/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 443e085..0000000
--- a/jpars.script.clojure/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
-org.eclipse.jdt.core.compiler.compliance=1.7
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.source=1.7
diff --git a/jpars.script.clojure/.settings/org.eclipse.m2e.core.prefs b/jpars.script.clojure/.settings/org.eclipse.m2e.core.prefs
deleted file mode 100644
index f897a7f..0000000
--- a/jpars.script.clojure/.settings/org.eclipse.m2e.core.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-activeProfiles=
-eclipse.preferences.version=1
-resolveWorkspaceProjects=true
-version=1
diff --git a/jpars.script.clojure/.settings/org.eclipse.wst.common.component b/jpars.script.clojure/.settings/org.eclipse.wst.common.component
deleted file mode 100644
index 469a63c..0000000
--- a/jpars.script.clojure/.settings/org.eclipse.wst.common.component
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
- <wb-module deploy-name="jpars.script.clojure">
- <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
- <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
- <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
- <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
- <property name="context-root" value="jpars.script.clojure"/>
- <property name="java-output-path" value="/jpars.script.clojure/target/classes"/>
- </wb-module>
-</project-modules>
diff --git a/jpars.script.clojure/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml b/jpars.script.clojure/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml
deleted file mode 100644
index cc81385..0000000
--- a/jpars.script.clojure/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<root>
- <facet id="jst.jaxrs">
- <node name="libprov">
- <attribute name="provider-id" value="jaxrs-no-op-library-provider"/>
- </node>
- </facet>
-</root>
diff --git a/jpars.script.clojure/.settings/org.eclipse.wst.common.project.facet.core.xml b/jpars.script.clojure/.settings/org.eclipse.wst.common.project.facet.core.xml
deleted file mode 100644
index 65276cf..0000000
--- a/jpars.script.clojure/.settings/org.eclipse.wst.common.project.facet.core.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<faceted-project>
- <fixed facet="wst.jsdt.web"/>
- <installed facet="jst.web" version="2.3"/>
- <installed facet="wst.jsdt.web" version="1.0"/>
- <installed facet="jst.jaxrs" version="1.1"/>
- <installed facet="java" version="1.7"/>
-</faceted-project>
diff --git a/jpars.script.clojure/.settings/org.eclipse.wst.jsdt.ui.superType.container b/jpars.script.clojure/.settings/org.eclipse.wst.jsdt.ui.superType.container
deleted file mode 100644
index 3bd5d0a..0000000
--- a/jpars.script.clojure/.settings/org.eclipse.wst.jsdt.ui.superType.container
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
diff --git a/jpars.script.clojure/.settings/org.eclipse.wst.jsdt.ui.superType.name b/jpars.script.clojure/.settings/org.eclipse.wst.jsdt.ui.superType.name
deleted file mode 100644
index 05bd71b..0000000
--- a/jpars.script.clojure/.settings/org.eclipse.wst.jsdt.ui.superType.name
+++ /dev/null
@@ -1 +0,0 @@
-Window
\ No newline at end of file
diff --git a/jpars.script.clojure/pom.xml b/jpars.script.clojure/pom.xml
deleted file mode 100644
index ae3f300..0000000
--- a/jpars.script.clojure/pom.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.eclipse.persistence.incubator</groupId>
- <artifactId>jpars.script.clojure</artifactId>
- <packaging>war</packaging>
- <version>2.4.2-SNAPSHOT</version>
-
- <dependencies>
- <dependency>
- <groupId>com.oracle.toplink</groupId>
- <artifactId>eclipselink</artifactId>
- <version>12.1.2-0-0</version>
- <exclusions>
- <exclusion>
- <artifactId>commonj.sdo</artifactId>
- <groupId>commonj.sdo</groupId>
- </exclusion>
- </exclusions>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>com.oracle.toplink</groupId>
- <artifactId>toplink-dataservices</artifactId>
- <version>12.1.2-0-0</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>com.oracle.toplink</groupId>
- <artifactId>javax.persistence</artifactId>
- <version>12.1.2-0-0</version>
- <scope>provided</scope>
- </dependency>
-
- <!-- EclipseLink JPA-RS Web Fragment -->
- <dependency>
- <groupId>com.oracle.toplink</groupId>
- <artifactId>toplink-dataservices-web</artifactId>
- <version>12.1.2-0-0</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.11</version>
- <scope>test</scope>
- </dependency>
-
-
- <dependency>
- <groupId>org.clojure</groupId>
- <artifactId>clojure</artifactId>
- <version>1.5.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>10.9.1.0</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <build>
- <finalName>jpars.script.clojure</finalName>
- <defaultGoal>test</defaultGoal>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <systemProperties>
- <property>
- <name>derby.stream.error.file</name>
- <value>target/derby.log</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/jpars.script.clojure/src/main/java/example/ApplicationInitialize.java b/jpars.script.clojure/src/main/java/example/ApplicationInitialize.java
deleted file mode 100644
index fc25cf7..0000000
--- a/jpars.script.clojure/src/main/java/example/ApplicationInitialize.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial
- ******************************************************************************/
-package example;
-
-
-public class ApplicationInitialize {
-
- public static void init() {
- ClojureScriptRunner.execute("example/application.clj", "example", "createService", "test-2");
- }
-}
diff --git a/jpars.script.clojure/src/main/java/example/ClojureScriptRunner.java b/jpars.script.clojure/src/main/java/example/ClojureScriptRunner.java
deleted file mode 100644
index afe82b2..0000000
--- a/jpars.script.clojure/src/main/java/example/ClojureScriptRunner.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial
- ******************************************************************************/
-package example;
-
-import java.io.IOException;
-
-import clojure.lang.RT;
-import clojure.lang.Var;
-
-public class ClojureScriptRunner {
-
- public static Object execute(String scriptResource, String ns, String procedure, String... args ) {
- try {
- RT.loadResourceScript(scriptResource);
- } catch (IOException e) {
- throw new RuntimeException("ClojureScriptRunner.execute", e);
- }
- Var ds = RT.var(ns, procedure);
-
- return ds.invoke(args);
- }
-}
diff --git a/jpars.script.clojure/src/main/java/example/CreateDataService.java b/jpars.script.clojure/src/main/java/example/CreateDataService.java
deleted file mode 100644
index c50925f..0000000
--- a/jpars.script.clojure/src/main/java/example/CreateDataService.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial
- ******************************************************************************/
-package example;
-
-import org.eclipse.persistence.script.EntityType;
-import org.eclipse.persistence.script.PersistenceUnit;
-
-public class CreateDataService {
-
- public static void create(String name) {
- PersistenceUnit pu = new PersistenceUnit(name);
-
- pu.setDataSource("java:app/env/DS");
-
- EntityType person = pu.addType("Person", "D_PERSON");
- person.generatedId("id");
- person.basic("name", String.class, "NAME");
-
- EntityType address = pu.addType("Address", "D_Address");
- address.generatedId("id");
- address.basic("street", String.class, "NAME");
-
- pu.create("v1.0");
- }
-
-}
diff --git a/jpars.script.clojure/src/main/java/example/DataService.java b/jpars.script.clojure/src/main/java/example/DataService.java
deleted file mode 100644
index 39bf4ea..0000000
--- a/jpars.script.clojure/src/main/java/example/DataService.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial
- ******************************************************************************/
-package example;
-
-
-public class DataService {
-
- public static Object create() {
- return ClojureScriptRunner.execute("example/data-services.clj", "toplink", "create", "test");
- }
-}
diff --git a/jpars.script.clojure/src/main/java/example/application.clj b/jpars.script.clojure/src/main/java/example/application.clj
deleted file mode 100644
index 709ea62..0000000
--- a/jpars.script.clojure/src/main/java/example/application.clj
+++ /dev/null
@@ -1,26 +0,0 @@
-; example.clj
-(ns example)
-
-(import org.eclipse.persistence.script.PersistenceUnit)
-(import org.eclipse.persistence.script.DataService)
-
-(defn createService [name]
-
- (let [pu (PersistenceUnit. "example")]
- (.setDataSource pu "java:app/env/DS")
-
- (doto (.addType pu "Person")
- (.generatedId "id")
- (.basic "name")
- )
-
- (doto (.addType pu "Address")
- (.generatedId "id")
- (.basic "street")
- (.basic "city")
- (.basic "state")
- (.basic "country")
- )
-
- (.create (DataService. pu) "v1.0" "create-or-extend-tables")))
-
diff --git a/jpars.script.clojure/src/main/java/example/data-services.clj b/jpars.script.clojure/src/main/java/example/data-services.clj
deleted file mode 100644
index d057c56..0000000
--- a/jpars.script.clojure/src/main/java/example/data-services.clj
+++ /dev/null
@@ -1,9 +0,0 @@
-; data-services.clj
-(ns toplink)
-
-(defn create [name]
- (str "Create: " name)
-)
-
-(defn addType [service name]
-)
\ No newline at end of file
diff --git a/jpars.script.clojure/src/main/java/org/eclipse/persistence/dynamic/ReflectiveDynamicClassLoader.java b/jpars.script.clojure/src/main/java/org/eclipse/persistence/dynamic/ReflectiveDynamicClassLoader.java
deleted file mode 100644
index db02059..0000000
--- a/jpars.script.clojure/src/main/java/org/eclipse/persistence/dynamic/ReflectiveDynamicClassLoader.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial
- ******************************************************************************/
-package org.eclipse.persistence.dynamic;
-
-import java.lang.reflect.Method;
-
-/**
- * Extended {@link DynamicClassLoader} used to create classes using reflective
- * access to defineClass. This causes the class to be created on the provided
- * delegate/parent loader instead of just within this custom loader. Required
- * for frameworks that don't take and use a loader.
- *
- * @author dclarke
- * @since EclipseLink 2.4.2
- */
-public class ReflectiveDynamicClassLoader extends DynamicClassLoader {
-
- private Method defineClassMethod;
-
- public ReflectiveDynamicClassLoader(ClassLoader delegate) {
- super(delegate);
- }
-
- protected Method getDefineClassMethod() {
- if (this.defineClassMethod == null) {
- try {
- this.defineClassMethod = ClassLoader.class.getDeclaredMethod("defineClass", new Class<?>[] { String.class, byte[].class, int.class, int.class });
- this.defineClassMethod.setAccessible(true);
- } catch (Exception e) {
- throw new RuntimeException("ReflectiveDynamicClassLoader could not access defineClass method", e);
- }
- }
- return this.defineClassMethod;
- }
-
- @Override
- protected Class<?> defineDynamicClass(String name, byte[] b) {
- try {
- return (Class<?>) getDefineClassMethod().invoke(getParent(), new Object[] { name, b, 0, b.length });
- } catch (Exception e) {
- throw new RuntimeException("ReflectiveDynamicClassLoader falied to create class: " + name, e);
- }
- }
-
-}
diff --git a/jpars.script.clojure/src/main/java/org/eclipse/persistence/jpa/dynamic/EntityType.java b/jpars.script.clojure/src/main/java/org/eclipse/persistence/jpa/dynamic/EntityType.java
deleted file mode 100644
index 6253bc1..0000000
--- a/jpars.script.clojure/src/main/java/org/eclipse/persistence/jpa/dynamic/EntityType.java
+++ /dev/null
@@ -1,118 +0,0 @@
-package org.eclipse.persistence.jpa.dynamic;
-
-import java.util.ArrayList;
-
-import org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor;
-import org.eclipse.persistence.internal.jpa.metadata.accessors.classes.XMLAttributes;
-import org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.BasicAccessor;
-import org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.BasicCollectionAccessor;
-import org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.BasicMapAccessor;
-import org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.ElementCollectionAccessor;
-import org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.EmbeddedAccessor;
-import org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.IdAccessor;
-import org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.ManyToManyAccessor;
-import org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.ManyToOneAccessor;
-import org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.OneToManyAccessor;
-import org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.OneToOneAccessor;
-import org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.TransformationAccessor;
-import org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.TransientAccessor;
-import org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.VariableOneToOneAccessor;
-import org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.VersionAccessor;
-import org.eclipse.persistence.internal.jpa.metadata.columns.AssociationOverrideMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.columns.AttributeOverrideMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.columns.ColumnMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.sequencing.GeneratedValueMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.structures.ArrayAccessor;
-import org.eclipse.persistence.internal.jpa.metadata.structures.StructureAccessor;
-
-public class EntityType {
-
- private Mappings mappings;
-
- private EntityAccessor accessor;
-
- public EntityType(Mappings mappings, String name) {
- this.mappings = mappings;
- this.accessor = new EntityAccessor();
- this.accessor.setName(name);
- this.accessor.setClassName(name);
- this.accessor.setAccess("VIRTUAL");
- this.accessor.setMetadataComplete(true);
- this.accessor.setAssociationOverrides(new ArrayList<AssociationOverrideMetadata>());
- this.accessor.setAttributeOverrides(new ArrayList<AttributeOverrideMetadata>());
-
- XMLAttributes xmlAttributes = new XMLAttributes();
- this.accessor.setAttributes(xmlAttributes);
- xmlAttributes.setEntityMappings(getMappings().getXmlMappings());
- xmlAttributes.setIds(new ArrayList<IdAccessor>());
- xmlAttributes.setBasics(new ArrayList<BasicAccessor>());
-
- xmlAttributes.setBasicCollections(new ArrayList<BasicCollectionAccessor>());
- xmlAttributes.setBasicMaps(new ArrayList<BasicMapAccessor>());
- xmlAttributes.setArrays(new ArrayList<ArrayAccessor>());
- xmlAttributes.setElementCollections(new ArrayList<ElementCollectionAccessor>());
- xmlAttributes.setEmbeddeds(new ArrayList<EmbeddedAccessor>());
- xmlAttributes.setManyToManys(new ArrayList<ManyToManyAccessor>());
- xmlAttributes.setManyToOnes(new ArrayList<ManyToOneAccessor>());
- xmlAttributes.setOneToManys(new ArrayList<OneToManyAccessor>());
- xmlAttributes.setOneToOnes(new ArrayList<OneToOneAccessor>());
- xmlAttributes.setStructures(new ArrayList<StructureAccessor>());
- xmlAttributes.setTransformations(new ArrayList<TransformationAccessor>());
- xmlAttributes.setTransients(new ArrayList<TransientAccessor>());
- xmlAttributes.setVariableOneToOnes(new ArrayList<VariableOneToOneAccessor>());
- xmlAttributes.setVersions(new ArrayList<VersionAccessor>());
- }
-
- public Mappings getMappings() {
- return mappings;
- }
-
- public EntityAccessor getAccessor() {
- return accessor;
- }
-
- public void addId(String name, String type, String columnName) {
- IdAccessor id = new IdAccessor();
- id.setName(name);
- id.setAttributeType(type);
- if (columnName != null) {
- ColumnMetadata column = new ColumnMetadata();
- column.setEntityMappings(getMappings().getXmlMappings());
- column.setName(columnName);
- id.setColumn(column);
- }
- getAccessor().getAttributes().getIds().add(id);
- }
-
- public void addGeneratedId(String name, String type, String columnName) {
- IdAccessor id = new IdAccessor();
- id.setName(name);
- id.setAttributeType(type);
- if (columnName != null) {
- ColumnMetadata column = new ColumnMetadata();
- column.setEntityMappings(getMappings().getXmlMappings());
- column.setName(columnName);
- id.setColumn(column);
- }
- GeneratedValueMetadata gen = new GeneratedValueMetadata();
- gen.setEntityMappings(getMappings().getXmlMappings());
- gen.setStrategy("AUTO");
- id.setGeneratedValue(gen);
-
- getAccessor().getAttributes().getIds().add(id);
- }
-
- public void addBasic(String name, String type, String columnName) {
- BasicAccessor basic = new BasicAccessor();
- basic.setName(name);
- basic.setAttributeType(type);
- if (columnName != null) {
- ColumnMetadata column = new ColumnMetadata();
- column.setEntityMappings(getMappings().getXmlMappings());
- column.setName(columnName);
- basic.setColumn(column);
- }
- getAccessor().getAttributes().getBasics().add(basic);
-
- }
-}
diff --git a/jpars.script.clojure/src/main/java/org/eclipse/persistence/jpa/dynamic/Mappings.java b/jpars.script.clojure/src/main/java/org/eclipse/persistence/jpa/dynamic/Mappings.java
deleted file mode 100644
index 8235f31..0000000
--- a/jpars.script.clojure/src/main/java/org/eclipse/persistence/jpa/dynamic/Mappings.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial
- ******************************************************************************/
-package org.eclipse.persistence.jpa.dynamic;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EmbeddableAccessor;
-import org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor;
-import org.eclipse.persistence.internal.jpa.metadata.accessors.classes.MappedSuperclassAccessor;
-import org.eclipse.persistence.internal.jpa.metadata.columns.TenantDiscriminatorColumnMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.converters.ConverterMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.converters.ObjectTypeConverterMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.converters.StructConverterMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.converters.TypeConverterMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.partitioning.HashPartitioningMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.partitioning.PartitioningMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.partitioning.PinnedPartitioningMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.partitioning.RangePartitioningMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.partitioning.ReplicationPartitioningMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.partitioning.RoundRobinPartitioningMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.partitioning.UnionPartitioningMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.partitioning.ValuePartitioningMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.queries.NamedNativeQueryMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.queries.NamedPLSQLStoredFunctionQueryMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.queries.NamedPLSQLStoredProcedureQueryMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.queries.NamedQueryMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.queries.NamedStoredFunctionQueryMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.queries.NamedStoredProcedureQueryMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.queries.PLSQLRecordMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.queries.PLSQLTableMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.queries.SQLResultSetMappingMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.sequencing.SequenceGeneratorMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.sequencing.TableGeneratorMetadata;
-import org.eclipse.persistence.internal.jpa.metadata.xml.XMLEntityMappings;
-import org.eclipse.persistence.internal.jpa.metadata.xml.XMLPersistenceUnitMetadata;
-
-public class Mappings {
-
- private PersistenceUnit unit;
-
- private XMLEntityMappings mappings;
-
- private Map<String, EntityType> types;
-
- protected Mappings(PersistenceUnit unit) {
- this.unit = unit;
- this.types = new HashMap<String, EntityType>();
- this.mappings = new XMLEntityMappings();
-
- this.mappings.setAccess("VIRTUAL");
- this.mappings.setPackage("org.eclipse.persistence.jpa.dynamic.model");
-
- XMLPersistenceUnitMetadata md = new XMLPersistenceUnitMetadata();
- md.setEntityMappings(this.mappings);
- md.setXMLMappingMetadataComplete(true);
- this.mappings.setPersistenceUnitMetadata(md);
-
- // Populate empty collections
- this.mappings.setConverters(new ArrayList<ConverterMetadata>());
- this.mappings.setEmbeddables(new ArrayList<EmbeddableAccessor>());
- this.mappings.setEntities(new ArrayList<EntityAccessor>());
- this.mappings.setHashPartitioning(new ArrayList<HashPartitioningMetadata>());
- this.mappings.setIsEclipseLinkORMFile(true);
- this.mappings.setLoadedForCanonicalModel(false);
- this.mappings.setLoader(getUnit().getInfo().getClassLoader());
- this.mappings.setMappedSuperclasses(new ArrayList<MappedSuperclassAccessor>());
- this.mappings.setMappingFile("in-memory");
- this.mappings.setNamedQueries(new ArrayList<NamedQueryMetadata>());
- this.mappings.setNamedStoredFunctionQueries(new ArrayList<NamedStoredFunctionQueryMetadata>());
- this.mappings.setNamedNativeQueries(new ArrayList<NamedNativeQueryMetadata>());
- this.mappings.setNamedPLSQLStoredFunctionQueries(new ArrayList<NamedPLSQLStoredFunctionQueryMetadata>());
- this.mappings.setNamedPLSQLStoredProcedureQueries(new ArrayList<NamedPLSQLStoredProcedureQueryMetadata>());
- this.mappings.setNamedStoredProcedureQueries(new ArrayList<NamedStoredProcedureQueryMetadata>());
- this.mappings.setObjectTypeConverters(new ArrayList<ObjectTypeConverterMetadata>());
- this.mappings.setPartitioning(new ArrayList<PartitioningMetadata>());
- this.mappings.setPinnedPartitioning(new ArrayList<PinnedPartitioningMetadata>());
- this.mappings.setPLSQLRecords(new ArrayList<PLSQLRecordMetadata>());
- this.mappings.setPLSQLTables(new ArrayList<PLSQLTableMetadata>());
- this.mappings.setRangePartitioning(new ArrayList<RangePartitioningMetadata>());
- this.mappings.setReplicationPartitioning(new ArrayList<ReplicationPartitioningMetadata>());
- this.mappings.setRoundRobinPartitioning(new ArrayList<RoundRobinPartitioningMetadata>());
- this.mappings.setSequenceGenerators(new ArrayList<SequenceGeneratorMetadata>());
- this.mappings.setSqlResultSetMappings(new ArrayList<SQLResultSetMappingMetadata>());
- this.mappings.setStructConverters(new ArrayList<StructConverterMetadata>());
- this.mappings.setTableGenerators(new ArrayList<TableGeneratorMetadata>());
- this.mappings.setTenantDiscriminatorColumns(new ArrayList<TenantDiscriminatorColumnMetadata>());
- this.mappings.setTypeConverters(new ArrayList<TypeConverterMetadata>());
- this.mappings.setUnionPartitioning(new ArrayList<UnionPartitioningMetadata>());
- this.mappings.setValuePartitioning(new ArrayList<ValuePartitioningMetadata>());
- }
- protected Map<String, EntityType> getTypes() {
- return this.types;
- }
-
- protected PersistenceUnit getUnit() {
- return this.unit;
- }
-
- protected XMLEntityMappings getXmlMappings() {
- return this.mappings;
- }
-
- public EntityType addType(String name) {
- EntityType type = new EntityType(this, name);
- getTypes().put(name, type);
-
- getXmlMappings().getEntities().add(type.getAccessor());
-
- return type;
- }
-
-}
diff --git a/jpars.script.clojure/src/main/java/org/eclipse/persistence/jpa/dynamic/PersistenceUnit.java b/jpars.script.clojure/src/main/java/org/eclipse/persistence/jpa/dynamic/PersistenceUnit.java
deleted file mode 100644
index 0157957..0000000
--- a/jpars.script.clojure/src/main/java/org/eclipse/persistence/jpa/dynamic/PersistenceUnit.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial
- ******************************************************************************/
-package org.eclipse.persistence.jpa.dynamic;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.spi.PersistenceUnitInfo;
-import javax.persistence.spi.PersistenceUnitTransactionType;
-
-import org.eclipse.persistence.config.PersistenceUnitProperties;
-import org.eclipse.persistence.exceptions.PersistenceUnitLoadingException;
-import org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl;
-import org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider;
-import org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl;
-import org.eclipse.persistence.internal.jpa.deployment.JPAInitializer;
-import org.eclipse.persistence.internal.jpa.deployment.SEPersistenceUnitInfo;
-import org.eclipse.persistence.internal.jpa.metadata.xml.XMLEntityMappings;
-import org.eclipse.persistence.jpa.PersistenceProvider;
-import org.eclipse.persistence.jpa.metadata.XMLMetadataSource;
-import org.eclipse.persistence.logging.SessionLog;
-
-public class PersistenceUnit {
-
- private SEPersistenceUnitInfo puInfo;
-
- private Mappings mappings;
-
- public PersistenceUnit(String name, ClassLoader cl) {
- this.puInfo = new SEPersistenceUnitInfo();
- this.puInfo.setClassLoader(cl);
- this.puInfo.setPersistenceUnitName(name);
- try {
- this.puInfo.setPersistenceUnitRootUrl(new URL("http://localhost"));
- } catch (MalformedURLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- this.puInfo.setTransactionType(PersistenceUnitTransactionType.RESOURCE_LOCAL);
-
- this.puInfo.setProperties(new Properties());
-
- this.mappings = new Mappings(this);
-
- this.puInfo.getProperties().put(PersistenceUnitProperties.METADATA_SOURCE, new InMemoryMetadataSource());
- }
-
- public PersistenceUnitInfo getInfo() {
- return this.puInfo;
- }
-
- public Mappings getMappings() {
- return this.mappings;
- }
-
- public void setProperty(String key, String value) {
- getInfo().getProperties().put(key, value);
- }
-
- private class InMemoryMetadataSource extends XMLMetadataSource {
- @Override
- public XMLEntityMappings getEntityMappings(Map<String, Object> properties, ClassLoader classLoader, SessionLog log) {
- return getMappings().getXmlMappings();
- }
-
- }
-
- public EntityManagerFactory createEntityManagerFactory() {
- EntityManagerSetupImpl emSetupImpl = null;
- boolean isNew = false;
- // the name that uniquely defines persistence unit
- String name = getInfo().getPersistenceUnitName();
-
- // TODO: Fix this
- String uniqueName = name;
- String sessionName = name;
- Map<String, Object> nonNullProperties = new HashMap<>();
- JPAInitializer initializer = new PersistenceProvider().getInitializer(name, nonNullProperties);
-
- try {
- uniqueName = initializer.createUniquePersistenceUnitName(puInfo);
-
- sessionName = EntityManagerSetupImpl.getOrBuildSessionName(nonNullProperties, puInfo, uniqueName);
- synchronized (EntityManagerFactoryProvider.emSetupImpls) {
- emSetupImpl = EntityManagerFactoryProvider.getEntityManagerSetupImpl(sessionName);
- if (emSetupImpl == null) {
- // there may be initial emSetupImpl cached in Initializer -
- // remove it and use.
- emSetupImpl = initializer.extractInitialEmSetupImpl(name);
- if (emSetupImpl != null) {
- // change the name
- emSetupImpl.changeSessionName(sessionName);
- } else {
- // create and predeploy a new emSetupImpl
- emSetupImpl = initializer.callPredeploy(puInfo, nonNullProperties, uniqueName, sessionName);
- }
- // emSetupImpl has been already predeployed, predeploy will
- // just increment factoryCount.
- emSetupImpl.predeploy(emSetupImpl.getPersistenceUnitInfo(), nonNullProperties);
- EntityManagerFactoryProvider.addEntityManagerSetupImpl(sessionName, emSetupImpl);
- isNew = true;
- }
- }
-
- } catch (Exception e) {
- throw PersistenceUnitLoadingException.exceptionSearchingForPersistenceResources(initializer.getInitializationClassLoader(), e);
- }
-
- if (!isNew) {
- if (!uniqueName.equals(emSetupImpl.getPersistenceUnitUniqueName())) {
- throw PersistenceUnitLoadingException.sessionNameAlreadyInUse(sessionName, uniqueName, emSetupImpl.getPersistenceUnitUniqueName());
- }
-
- // synchronized to prevent undeploying by other threads.
- boolean undeployed = false;
- synchronized (emSetupImpl) {
- if (emSetupImpl.isUndeployed()) {
- undeployed = true;
- }
-
- // emSetupImpl has been already predeployed, predeploy will just
- // increment factoryCount.
- emSetupImpl.predeploy(emSetupImpl.getPersistenceUnitInfo(), nonNullProperties);
- }
- if (undeployed) {
- // after the emSetupImpl has been obtained from emSetupImpls
- // it has been undeployed by factory.close() in another thread -
- // start all over again.
- return createEntityManagerFactory();
- }
- }
-
- EntityManagerFactoryImpl factory = null;
- try {
- factory = new EntityManagerFactoryImpl(emSetupImpl, nonNullProperties);
-
- // This code has been added to allow validation to occur without
- // actually calling createEntityManager
- if (emSetupImpl.shouldGetSessionOnCreateFactory(nonNullProperties)) {
- factory.getDatabaseSession();
- }
- return factory;
- } catch (RuntimeException ex) {
- if (factory != null) {
- factory.close();
- } else {
- emSetupImpl.undeploy();
- }
- throw ex;
- }
-
- }
-
-}
diff --git a/jpars.script.clojure/src/main/java/org/eclipse/persistence/script/DataService.java b/jpars.script.clojure/src/main/java/org/eclipse/persistence/script/DataService.java
deleted file mode 100644
index eac0204..0000000
--- a/jpars.script.clojure/src/main/java/org/eclipse/persistence/script/DataService.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial
- ******************************************************************************/
-package org.eclipse.persistence.script;
-
-import java.lang.reflect.Field;
-import java.util.Map;
-import java.util.ServiceLoader;
-
-import javax.persistence.EntityManagerFactory;
-
-import org.eclipse.persistence.internal.sessions.DatabaseSessionImpl;
-import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext;
-import org.eclipse.persistence.jpa.rs.PersistenceContext;
-import org.eclipse.persistence.jpa.rs.PersistenceContextFactory;
-import org.eclipse.persistence.jpa.rs.PersistenceContextFactoryProvider;
-import org.eclipse.persistence.jpa.rs.PersistenceFactoryBase;
-
-public class DataService {
-
- private PersistenceUnit unit;
-
- public DataService(PersistenceUnit unit) {
- this.unit = unit;
- }
-
- public PersistenceUnit getUnit() {
- return this.unit;
- }
-
- public String getName() {
- return getUnit().getName();
- }
-
- /**
- * Launch the dynamic PU and make it available through the REST interface.
- *
- * @param schemaGeneration
- */
- public void create(String version, String schemaGeneration) {
- EntityManagerFactory emf = getUnit().create(schemaGeneration);
-
- PersistenceFactoryBase factory = (PersistenceFactoryBase) getFactory(getUnit().getDynamicClassLoader());
- PersistenceContext context = factory.bootstrapPersistenceContext(getName(), emf, null, version, true);
-
- DynamicJAXBContext jaxbContext = ((DynamicJAXBContext) context.getJAXBContext());
- DatabaseSessionImpl sessionImpl = (DatabaseSessionImpl) jaxbContext.getXMLContext().getSessions().get(0);
- sessionImpl.getEventManager().preLogin(sessionImpl);
-
- getDynamicPersistenceContexts(factory).put(getName(), context);
- }
-
- private static PersistenceContextFactory getFactory(ClassLoader loader) {
- ServiceLoader<PersistenceContextFactoryProvider> contextFactoryLoader = ServiceLoader.load(PersistenceContextFactoryProvider.class, loader);
-
- for (PersistenceContextFactoryProvider provider : contextFactoryLoader) {
- PersistenceContextFactory factory = provider.getPersistenceContextFactory(null);
- if (factory != null) {
- return factory;
- }
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- private static Map<String, PersistenceContext> getDynamicPersistenceContexts(PersistenceFactoryBase factory) {
- try {
- Field field = factory.getClass().getDeclaredField("dynamicPersistenceContexts");
- field.setAccessible(true);
- return (Map<String, PersistenceContext>) field.get(factory);
- } catch (Exception e) {
- e.printStackTrace();
- throw new RuntimeException(e);
- }
- }
-
-}
diff --git a/jpars.script.clojure/src/main/java/org/eclipse/persistence/script/EntityType.java b/jpars.script.clojure/src/main/java/org/eclipse/persistence/script/EntityType.java
deleted file mode 100644
index 53ca103..0000000
--- a/jpars.script.clojure/src/main/java/org/eclipse/persistence/script/EntityType.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial
- ******************************************************************************/
-package org.eclipse.persistence.script;
-
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicTypeBuilder;
-
-public class EntityType {
-
- private JPADynamicTypeBuilder builder;
-
- protected EntityType(Class<DynamicEntity> dynamicClass, String... tableNames) {
- this.builder = new JPADynamicTypeBuilder(dynamicClass, null, tableNames);
- }
-
- protected JPADynamicTypeBuilder getBuilder() {
- return this.builder;
- }
-
- public void id(String name, Class<?> type, String column) {
- getBuilder().setPrimaryKeyFields(column);
- basic(name, type == null ? int.class : type, column);
- }
-
- public void generatedId(String name) {
- generatedId(name, long.class, name.toUpperCase());
- }
-
- public void generatedId(String name, Class<?> type, String column) {
- id(name, type, column);
- getBuilder().configureSequencing(name + "_SEQ", column);
- }
-
- public void basic(String name) {
- basic(name, null, null);
- }
-
- public void basic(String name, Class<?> type,String column) {
- getBuilder().addDirectMapping(name, type == null ? String.class : type, column == null ? name.toUpperCase() : column);
- }
-}
diff --git a/jpars.script.clojure/src/main/java/org/eclipse/persistence/script/PersistenceUnit.java b/jpars.script.clojure/src/main/java/org/eclipse/persistence/script/PersistenceUnit.java
deleted file mode 100644
index 6677683..0000000
--- a/jpars.script.clojure/src/main/java/org/eclipse/persistence/script/PersistenceUnit.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial
- ******************************************************************************/
-package org.eclipse.persistence.script;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.persistence.EntityManagerFactory;
-
-import org.eclipse.persistence.config.PersistenceUnitProperties;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl;
-import org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider;
-import org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl;
-import org.eclipse.persistence.internal.jpa.deployment.SEPersistenceUnitInfo;
-import org.eclipse.persistence.internal.sessions.DatabaseSessionImpl;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicHelper;
-import org.eclipse.persistence.logging.SessionLog;
-import org.eclipse.persistence.sessions.factories.SessionManager;
-import org.eclipse.persistence.tools.schemaframework.SchemaManager;
-
-public class PersistenceUnit {
-
- private DynamicClassLoader dcl = new DynamicClassLoader(Thread.currentThread().getContextClassLoader());
-
- private List<EntityType> types = new ArrayList<EntityType>();
-
- private String packageName = "org.eclipse.pesistence.dynamic.model.";
-
- private String name;
-
- private Map<String, Object> properties = new HashMap<String, Object>();
-
- public PersistenceUnit(String name, ClassLoader loader) {
- this.name = name;
- this.packageName = packageName + name + ".";
- setClassLoader(loader);
- }
-
- public PersistenceUnit(String name) {
- this(name, null);
- }
-
- public String getName() {
- return name;
- }
-
- public Map<String, Object> getProperties() {
- return this.properties;
- }
-
- public DynamicClassLoader getDynamicClassLoader() {
- return dcl;
- }
-
- public void setDynamicClassLoader(DynamicClassLoader dcl) {
- this.dcl = dcl;
- }
-
- public void setClassLoader(ClassLoader cl) {
- if (cl instanceof DynamicClassLoader) {
- dcl = (DynamicClassLoader) cl;
- } else {
- dcl = new DynamicClassLoader(cl == null ? Thread.currentThread().getContextClassLoader() : cl);
- }
- }
-
- protected List<EntityType> getTypes() {
- return this.types;
- }
-
- public String getPackageName() {
- return packageName;
- }
-
- public void setPackageName(String packageName) {
- this.packageName = packageName;
- }
-
- public EntityType addType(String name, String... tableNames) {
- @SuppressWarnings("unchecked")
- Class<DynamicEntity> dynamicClass = (Class<DynamicEntity>) getDynamicClassLoader().createDynamicClass(getPackageName() + name);
- EntityType type = new EntityType(dynamicClass, tableNames);
- getTypes().add(type);
- return type;
- }
-
- public EntityType addType(String name) {
- @SuppressWarnings("unchecked")
- Class<DynamicEntity> dynamicClass = (Class<DynamicEntity>) getDynamicClassLoader().createDynamicClass(getPackageName() + name);
- EntityType type = new EntityType(dynamicClass, new String[] { name.toUpperCase() });
- getTypes().add(type);
- return type;
- }
-
- public void setProperty(String name, String value) {
- getProperties().put(name, value);
- }
-
- public void setDataSource(String dsName) {
- setProperty(PersistenceUnitProperties.NON_JTA_DATASOURCE, dsName);
- }
-
- public void setDriver(String value) {
- setProperty(PersistenceUnitProperties.JDBC_DRIVER, value);
- }
-
- public void setUrl(String value) {
- setProperty(PersistenceUnitProperties.JDBC_URL, value);
- }
-
- public void setUserName(String value) {
- setProperty(PersistenceUnitProperties.JDBC_USER, value);
- }
-
- public void setPassword(String value) {
- setProperty(PersistenceUnitProperties.JDBC_PASSWORD, value);
- }
-
- /**
- * Launch the dynamic PU and make it available through the REST interface.
- *
- * @param schemaGeneration
- */
- public EntityManagerFactory create(String schemaGeneration) {
- DynamicType[] dynamicTypes = new DynamicType[getTypes().size()];
- for (int index = 0; index < getTypes().size(); index++) {
- dynamicTypes[index] = getTypes().get(index).getBuilder().getType();
- }
-
- // Create an entity manager factory.
- EntityManagerFactory emf = createEntityManagerFactory(getDynamicClassLoader());
-
- // Create JPA Dynamic Helper (with the emf above) and after the types
- // have been created and add the types through the helper.
- JPADynamicHelper helper = new JPADynamicHelper(emf);
- helper.addTypes(true, true, dynamicTypes);
-
- // Schema Generation
- if (PersistenceUnitProperties.CREATE_ONLY.equals(schemaGeneration)) {
- } else if (PersistenceUnitProperties.DROP_AND_CREATE.equals(schemaGeneration)) {
- new SchemaManager(helper.getSession()).replaceDefaultTables();
- } else if (PersistenceUnitProperties.CREATE_OR_EXTEND.equals(schemaGeneration)) {
- new SchemaManager(helper.getSession()).extendDefaultTables(true);
- } else if (schemaGeneration != null) {
- throw new IllegalArgumentException("Invalid schema-gen: " + schemaGeneration);
- }
-
- return emf;
- }
-
- private EntityManagerFactory createEntityManagerFactory(DynamicClassLoader dcl) {
- Map<String, Object> props = new HashMap<String, Object>();
- SEPersistenceUnitInfo info = new SEPersistenceUnitInfo();
- info.setClassLoader(dcl);
- info.setPersistenceUnitName(getName());
-
- Properties p = new Properties();
- p.putAll(getProperties());
- p.put(PersistenceUnitProperties.CLASSLOADER, dcl);
- p.put(PersistenceUnitProperties.WEAVING, "static");
- p.put(PersistenceUnitProperties.LOGGING_LEVEL, SessionLog.FINE_LABEL);
-
- info.setProperties(p);
-
- if (EntityManagerFactoryProvider.getEmSetupImpls().containsKey(getName())) {
- EntityManagerFactoryProvider.getEmSetupImpls().remove(getName());
- }
- if (SessionManager.getManager().getSessions().containsKey(getName())) {
- SessionManager.getManager().destroySession(getName());
- }
-
- EntityManagerSetupImpl setup = new EntityManagerSetupImpl(getName(), getName());
- setup.predeploy(info, props);
-
- // call to setup.deploy prevents execution of prelogin. Prelogin must be
- // run to
- // get JPA-RS mappings populated correctly
- DatabaseSessionImpl sessionImpl = setup.deploy(dcl, props);
-
- if (EntityManagerFactoryProvider.getEmSetupImpls().containsKey(getName())) {
- EntityManagerFactoryProvider.getEmSetupImpls().put(getName(), setup);
- }
-
- EntityManagerFactoryImpl emf = new EntityManagerFactoryImpl(sessionImpl);
-
- return emf;
- }
-}
diff --git a/jpars.script.clojure/src/main/webapp/WEB-INF/lib/clojure-1.5.1.jar b/jpars.script.clojure/src/main/webapp/WEB-INF/lib/clojure-1.5.1.jar
deleted file mode 100644
index 68e6713..0000000
--- a/jpars.script.clojure/src/main/webapp/WEB-INF/lib/clojure-1.5.1.jar
+++ /dev/null
Binary files differ
diff --git a/jpars.script.clojure/src/main/webapp/WEB-INF/web.xml b/jpars.script.clojure/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index cc6ed05..0000000
--- a/jpars.script.clojure/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
- version="3.0">
-
- <data-source>
- <name>java:app/env/DS</name>
- <class-name>com.mysql.jdbc.Driver</class-name>
- <server-name>localhost</server-name>
- <url>jdbc:mysql://localhost:3306/mysql</url>
- <user>root</user>
- <password>password</password>
- </data-source>
-</web-app>
\ No newline at end of file
diff --git a/jpars.script.clojure/src/main/webapp/index.jsp b/jpars.script.clojure/src/main/webapp/index.jsp
deleted file mode 100644
index dfc605c..0000000
--- a/jpars.script.clojure/src/main/webapp/index.jsp
+++ /dev/null
@@ -1,7 +0,0 @@
-<%@page import="example.ApplicationInitialize"%>
-<html>
-<body>
-<h2>EclipseLink JPA-RS: Clojure Scripting</h2>
-<% ApplicationInitialize.init(); %>
-</body>
-</html>
diff --git a/jpars.script.clojure/src/test/java/test/TestApplicationInitialize.java b/jpars.script.clojure/src/test/java/test/TestApplicationInitialize.java
deleted file mode 100644
index 56b2b6f..0000000
--- a/jpars.script.clojure/src/test/java/test/TestApplicationInitialize.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial
- ******************************************************************************/
-package test;
-
-
-public class TestApplicationInitialize {
-
- public void create() {
- // ApplicationInitialize.init();
- }
-}
diff --git a/jpars.script.clojure/src/test/java/test/TestDataService.java b/jpars.script.clojure/src/test/java/test/TestDataService.java
deleted file mode 100644
index e8bc48f..0000000
--- a/jpars.script.clojure/src/test/java/test/TestDataService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial
- ******************************************************************************/
-package test;
-
-import java.io.IOException;
-
-import org.junit.Test;
-
-import example.DataService;
-
-public class TestDataService {
-
- @Test
- public void create() throws IOException {
- Object result = DataService.create();
- System.out.println(result);
- }
-}
diff --git a/jpars.script.clojure/src/test/java/test/api/TestCreatePersistenceUnit.java b/jpars.script.clojure/src/test/java/test/api/TestCreatePersistenceUnit.java
deleted file mode 100644
index 88cccf7..0000000
--- a/jpars.script.clojure/src/test/java/test/api/TestCreatePersistenceUnit.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial
- ******************************************************************************/
-package test.api;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-
-import org.eclipse.persistence.config.PersistenceUnitProperties;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicHelper;
-import org.eclipse.persistence.script.EntityType;
-import org.eclipse.persistence.script.PersistenceUnit;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class TestCreatePersistenceUnit {
-
- @Test
- public void verifyEmf() {
- Assert.assertNotNull(emf);
- }
-
- @Test
- public void createPerson() {
- EntityManager em = emf.createEntityManager();
-
- try {
- JPADynamicHelper helper = new JPADynamicHelper(em);
-
- DynamicType personType = helper.getType("Person");
-
- DynamicEntity person = personType.newDynamicEntity();
- person.set("name", "Test");
-
- em.getTransaction().begin();
- em.persist(person);
- em.getTransaction().commit();
-
- } finally {
- if (em.getTransaction().isActive()) {
- em.getTransaction().rollback();
- }
- em.close();
- }
- }
-
- private static EntityManagerFactory emf;
-
- @BeforeClass
- public static void setup() {
- emf = createPersonPU("test", PersistenceUnitProperties.DROP_AND_CREATE);
- }
-
- @AfterClass
- public static void tearDown() {
- emf.close();
- }
-
- public static EntityManagerFactory createPersonPU(String name, String schemaGen) {
- PersistenceUnit pu = new PersistenceUnit(name);
-
- pu.setDriver("org.apache.derby.jdbc.EmbeddedDriver");
- pu.setUrl("jdbc:derby:target/derby/"+name+ ";create=true");
- pu.setUserName("app");
- pu.setPassword("app");
-
- EntityType person = pu.addType("Person", "D_PERSON");
- person.generatedId("id", int.class, "P_ID");
- person.basic("name", String.class, "NAME");
-
- EntityType address = pu.addType("Address", "D_Address");
- address.generatedId("id", int.class, "P_ID");
- address.basic("street", String.class, "NAME");
-
- return pu.create(schemaGen);
- }
-}
diff --git a/jpars.script.clojure/src/test/java/test/jpa/dynamic/TestCreate.java b/jpars.script.clojure/src/test/java/test/jpa/dynamic/TestCreate.java
deleted file mode 100644
index 4babd12..0000000
--- a/jpars.script.clojure/src/test/java/test/jpa/dynamic/TestCreate.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial
- ******************************************************************************/
-package test.jpa.dynamic;
-
-import javax.persistence.EntityManagerFactory;
-
-import org.eclipse.persistence.config.PersistenceUnitProperties;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.jpa.dynamic.EntityType;
-import org.eclipse.persistence.jpa.dynamic.PersistenceUnit;
-import org.junit.Assert;
-import org.junit.Test;
-
-public class TestCreate {
-
- @Test
- public void createEmpty() {
- PersistenceUnit unit = new PersistenceUnit("test", Thread.currentThread().getContextClassLoader());
-
- unit.setProperty(PersistenceUnitProperties.JDBC_DRIVER, "org.apache.derby.jdbc.EmbeddedDriver");
- unit.setProperty(PersistenceUnitProperties.JDBC_URL, "jdbc:derby:target/derby/test;create=true");
- unit.setProperty(PersistenceUnitProperties.JDBC_USER, "app");
- unit.setProperty(PersistenceUnitProperties.JDBC_PASSWORD, "app");
-
- unit.setProperty(PersistenceUnitProperties.LOGGING_LEVEL, "FINE");
-
- EntityManagerFactory emf = unit.createEntityManagerFactory();
-
- Assert.assertNotNull(emf);
- Assert.assertTrue(emf.isOpen());
-
- JpaHelper.getServerSession(emf);
-
- emf.close();
- }
-
- @Test
- public void createSimple() {
- PersistenceUnit unit = new PersistenceUnit("test", Thread.currentThread().getContextClassLoader());
-
- unit.setProperty(PersistenceUnitProperties.JDBC_DRIVER, "org.apache.derby.jdbc.EmbeddedDriver");
- unit.setProperty(PersistenceUnitProperties.JDBC_URL, "jdbc:derby:target/derby/test;create=true");
- unit.setProperty(PersistenceUnitProperties.JDBC_USER, "app");
- unit.setProperty(PersistenceUnitProperties.JDBC_PASSWORD, "app");
-
- unit.setProperty(PersistenceUnitProperties.DDL_GENERATION_MODE, PersistenceUnitProperties.DDL_DATABASE_GENERATION);
- unit.setProperty(PersistenceUnitProperties.DDL_GENERATION, PersistenceUnitProperties.DROP_AND_CREATE);
-
- unit.setProperty(PersistenceUnitProperties.LOGGING_LEVEL, "FINE");
-
- // Add simple Person type
- EntityType person = unit.getMappings().addType("Person");
- person.addGeneratedId("id", "Integer", null);
- person.addBasic("name", "String", null);
-
- EntityManagerFactory emf = unit.createEntityManagerFactory();
-
- Assert.assertNotNull(emf);
- Assert.assertTrue(emf.isOpen());
-
- JpaHelper.getServerSession(emf);
-
- emf.close();
- }
-}