diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..72b632a8e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: Build +on: + push: + branches: + - main + - master +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Cache local Maven repository + uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-maven- + - name: Set up JDK Corretto + uses: actions/setup-java@v3 + with: + distribution: 'corretto' + java-version: '17' + architecture: x64 + - name: Maven Build + run: mvn clean install + diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 64e1e1034..25eca780e 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -24,10 +24,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up JDK 8 (Corretto) + - name: Set up JDK (Corretto) uses: actions/setup-java@v3 with: - java-version: '8' + java-version: '17' distribution: 'corretto' cache: maven - name: Build with Maven diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 000000000..162c8d2f6 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,33 @@ +name: Pull Request + +on: + pull_request: + branches: + - main + - master +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true +jobs: + build: + runs-on: ${{ matrix.os }}-latest + strategy: + matrix: + os: [ubuntu, windows] + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Cache local Maven repository + uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-maven- + - name: Set up JDK Corretto + uses: actions/setup-java@v3 + with: + distribution: 'corretto' + java-version: 17 + - name: Maven Build + run: mvn clean install diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..c579644c2 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,106 @@ +name: Release + +on: + workflow_dispatch: + inputs: + releaseVersion: + description: Release Version + required: true + default: 3.0.0 + snapshotVersion: + description: Snapshot Version + required: true + default: 3.0.1-SNAPSHOT + +run-name: 'version set to ${{ github.event.inputs.releaseVersion }} for release' + +jobs: + release-project: + runs-on: ubuntu-latest + steps: + + - uses: actions/checkout@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 + + - name: Cache local Maven repository + uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-maven- + + - name: Set up JDK Corretto + uses: actions/setup-java@v3 + with: + distribution: 'corretto' + java-version: '17' + architecture: x64 + + - name: "Configure Git" + run: | + git fetch + git checkout ${{ github.event.inputs.branch }} + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: "Maven: Set Release Version" + run: mvn versions:set -DnewVersion=${{ github.event.inputs.releaseVersion }} + + - name: Setup Maven settings.xml + uses: whelk-io/maven-settings-xml-action@v11 + with: + servers: + '[ + { + "id": "github", + "username": "${env.GITHUB_USERNAME}", + "password": "${env.GITHUB_TOKEN}" + } + ]' + + - name: Build Project + run: mvn clean install + + - name: Publish to GitHub Packages Apache Maven + run: mvn deploy + env: + GITHUB_USERNAME: x-access-token + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} + BUILD_ENV: 'github-actions' + + - name: "Git: Commit Release Version" + run: | + git add '**pom.xml' + git commit -m "version set to ${{ github.event.inputs.releaseVersion }} for release" + + - name: "Maven: Set Snapshot Version" + run: mvn versions:set -DnewVersion=${{ github.event.inputs.snapshotVersion }} + + - name: "Git: Commit Snapshot Version" + run: | + git add '**pom.xml' + git commit -m "version set to ${{ github.event.inputs.snapshotVersion }} for development" + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.event.inputs.releaseVersion }} + release_name: Release ${{ github.event.inputs.releaseVersion }} + body: | + Changes in this Release: + - First Change + - Second Change + draft: false + prerelease: false + + - name: "Git: Push Changes" + run: | + git checkout -B ${{ github.event.inputs.releaseVersion }} + git push --set-upstream origin ${{ github.event.inputs.releaseVersion }} + git checkout -B master + git push --set-upstream origin master \ No newline at end of file diff --git a/.gitignore b/.gitignore index e000e0dc5..b30725e74 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ classes .DS_Store nb-configuration.xml context.xml +*.versionsBackup \ No newline at end of file diff --git a/odata2-annotation-processor/annotation-processor-api/pom.xml b/odata2-annotation-processor/annotation-processor-api/pom.xml index 120163da3..d5cf999f8 100644 --- a/odata2-annotation-processor/annotation-processor-api/pom.xml +++ b/odata2-annotation-processor/annotation-processor-api/pom.xml @@ -25,7 +25,7 @@ org.apache.olingo olingo-odata2-annotation-processor - 2.0.13 + 3.0.0-SNAPSHOT .. diff --git a/odata2-annotation-processor/annotation-processor-core/pom.xml b/odata2-annotation-processor/annotation-processor-core/pom.xml index b57a282f2..85d468078 100644 --- a/odata2-annotation-processor/annotation-processor-core/pom.xml +++ b/odata2-annotation-processor/annotation-processor-core/pom.xml @@ -20,7 +20,7 @@ org.apache.olingo olingo-odata2-annotation-processor - 2.0.13 + 3.0.0-SNAPSHOT .. diff --git a/odata2-annotation-processor/annotation-processor-ref/pom.xml b/odata2-annotation-processor/annotation-processor-ref/pom.xml index 3f62b39a8..143638ebc 100644 --- a/odata2-annotation-processor/annotation-processor-ref/pom.xml +++ b/odata2-annotation-processor/annotation-processor-ref/pom.xml @@ -20,7 +20,7 @@ org.apache.olingo olingo-odata2-annotation-processor - 2.0.13 + 3.0.0-SNAPSHOT .. @@ -90,7 +90,6 @@ org.slf4j slf4j-log4j12 - ${slf4j.version} @@ -102,7 +101,6 @@ xmlunit xmlunit - ${xmlunit.version} test diff --git a/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/ResourceHelper.java b/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/ResourceHelper.java index 7d64bc410..511169f1f 100644 --- a/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/ResourceHelper.java +++ b/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/ResourceHelper.java @@ -1,20 +1,16 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.annotation.processor.ref.model; @@ -23,7 +19,6 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; - import javax.imageio.ImageIO; /** @@ -31,66 +26,69 @@ */ public class ResourceHelper { - public static byte[] loadAsByte(final String resource) { - return load(resource, new byte[0]); - } - - public static byte[] load(final String resource, final byte[] defaultResult) { - InputStream instream = null; - try { - instream = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource); - if (instream == null) { - return defaultResult; - } - ByteArrayOutputStream stream = new ByteArrayOutputStream(); - int b = 0; - while ((b = instream.read()) != -1) { - stream.write(b); - } + public static byte[] loadAsByte(final String resource) { + return load(resource, new byte[0]); + } - return stream.toByteArray(); - } catch (IOException e) { - throw new RuntimeException(e); - } finally { - if (instream != null) { + public static byte[] load(final String resource, final byte[] defaultResult) { + InputStream instream = null; try { - instream.close(); - } catch (IOException ex) {} - } + instream = Thread.currentThread() + .getContextClassLoader() + .getResourceAsStream(resource); + if (instream == null) { + return defaultResult; + } + ByteArrayOutputStream stream = new ByteArrayOutputStream(); + int b = 0; + while ((b = instream.read()) != -1) { + stream.write(b); + } + + return stream.toByteArray(); + } catch (IOException e) { + throw new RuntimeException(e); + } finally { + if (instream != null) { + try { + instream.close(); + } catch (IOException ex) { + } + } + } + } + + public enum Format { + BMP, JPEG, PNG, GIF } - } - public enum Format { - BMP, JPEG, PNG, GIF - }; + public static byte[] generateImage() { + return generateImage(Format.PNG); + } - public static byte[] generateImage() { - return generateImage(Format.PNG); - } + public static byte[] generateImage(final Format format) { + try { + int width = 320; + int height = 320; + BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_BINARY); + WritableRaster raster = image.getRaster(); - public static byte[] generateImage(final Format format) { - try { - int width = 320; - int height = 320; - BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_BINARY); - WritableRaster raster = image.getRaster(); + int mod = format.ordinal() + 2; + for (int h = 0; h < height; h++) { + for (int w = 0; w < width; w++) { + if (((h / 32) + (w / 32)) % mod == 0) { + raster.setSample(w, h, 0, 0); + } else { + raster.setSample(w, h, 0, 1); + } + } + } - int mod = format.ordinal() + 2; - for (int h = 0; h < height; h++) { - for (int w = 0; w < width; w++) { - if (((h / 32) + (w / 32)) % mod == 0) { - raster.setSample(w, h, 0, 0); - } else { - raster.setSample(w, h, 0, 1); - } + ByteArrayOutputStream out = new ByteArrayOutputStream(1024); + ImageIO.write(image, format.name(), out); + return out.toByteArray(); + } catch (IOException ex) { + return new byte[0]; } - } - - ByteArrayOutputStream out = new ByteArrayOutputStream(1024); - ImageIO.write(image, format.name(), out); - return out.toByteArray(); - } catch (IOException ex) { - return new byte[0]; } - } } diff --git a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefXmlTest.java b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefXmlTest.java index 635e605b2..13867b9ca 100644 --- a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefXmlTest.java +++ b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefXmlTest.java @@ -1,30 +1,24 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.annotation.processor.ref; import static org.custommonkey.xmlunit.XMLAssert.assertXpathExists; - import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import java.util.Map; - import org.apache.http.HttpResponse; import org.apache.olingo.odata2.api.commons.HttpStatusCodes; import org.apache.olingo.odata2.api.edm.Edm; @@ -38,59 +32,59 @@ /** * Abstract base class for tests employing the reference scenario reading or writing XML. - * + * */ @Ignore("no test methods") public class AbstractRefXmlTest extends AbstractRefTest { - public AbstractRefXmlTest(final ServletType servletType) { - super(servletType); - } - - @Before - public void setXmlNamespacePrefixes() { - Map prefixMap = new HashMap(); - prefixMap.put(Edm.PREFIX_ATOM, Edm.NAMESPACE_ATOM_2005); - prefixMap.put(Edm.PREFIX_APP, Edm.NAMESPACE_APP_2007); - prefixMap.put(Edm.PREFIX_D, Edm.NAMESPACE_D_2007_08); - prefixMap.put(Edm.PREFIX_M, Edm.NAMESPACE_M_2007_08); - prefixMap.put(Edm.PREFIX_EDM, Edm.NAMESPACE_EDM_2008_09); - prefixMap.put(Edm.PREFIX_EDMX, Edm.NAMESPACE_EDMX_2007_06); - prefixMap.put(Edm.PREFIX_XML, Edm.NAMESPACE_XML_1998); - XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(prefixMap)); - } - - @Override - protected void badRequest(final String uri) throws Exception { - final HttpResponse response = callUri(uri, HttpStatusCodes.BAD_REQUEST); - validateXmlError(getBody(response)); - } + public AbstractRefXmlTest(final ServletType servletType) { + super(servletType); + } - @Override - protected void notFound(final String uri) throws Exception { - final HttpResponse response = callUri(uri, HttpStatusCodes.NOT_FOUND); - validateXmlError(getBody(response)); - } + @Before + public void setXmlNamespacePrefixes() { + Map prefixMap = new HashMap(); + prefixMap.put(Edm.PREFIX_ATOM, Edm.NAMESPACE_ATOM_2005); + prefixMap.put(Edm.PREFIX_APP, Edm.NAMESPACE_APP_2007); + prefixMap.put(Edm.PREFIX_D, Edm.NAMESPACE_D_2007_08); + prefixMap.put(Edm.PREFIX_M, Edm.NAMESPACE_M_2007_08); + prefixMap.put(Edm.PREFIX_EDM, Edm.NAMESPACE_EDM_2008_09); + prefixMap.put(Edm.PREFIX_EDMX, Edm.NAMESPACE_EDMX_2007_06); + prefixMap.put(Edm.PREFIX_XML, Edm.NAMESPACE_XML_1998); + XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(prefixMap)); + } - protected void validateXmlError(final String xml) throws XpathException, IOException, SAXException { - assertXpathExists("/m:error", xml); - assertXpathExists("/m:error/m:code", xml); - assertXpathExists("/m:error/m:message[@xml:lang=\"en\"]", xml); - } + @Override + protected void badRequest(final String uri) throws Exception { + final HttpResponse response = callUri(uri, HttpStatusCodes.BAD_REQUEST); + validateXmlError(getBody(response)); + } - protected String readFile(final String filename) throws IOException { - InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(filename); - if (in == null) { - throw new IOException("Requested file '" + filename + "' was not found."); + @Override + protected void notFound(final String uri) throws Exception { + final HttpResponse response = callUri(uri, HttpStatusCodes.NOT_FOUND); + validateXmlError(getBody(response)); } - byte[] tmp = new byte[8192]; - int count = in.read(tmp); - StringBuffer b = new StringBuffer(); - while (count >= 0) { - b.append(new String(tmp, 0, count)); - count = in.read(tmp); + protected void validateXmlError(final String xml) throws XpathException, IOException, SAXException { + assertXpathExists("/m:error", xml); + assertXpathExists("/m:error/m:code", xml); + assertXpathExists("/m:error/m:message[@xml:lang=\"en\"]", xml); } - return b.toString(); - } + protected String readFile(final String filename) throws IOException { + InputStream in = AbstractRefXmlTest.class.getResourceAsStream(filename); + if (in == null) { + throw new IOException("Requested file '" + filename + "' was not found."); + } + + byte[] tmp = new byte[8192]; + int count = in.read(tmp); + StringBuffer b = new StringBuffer(); + while (count >= 0) { + b.append(new String(tmp, 0, count)); + count = in.read(tmp); + } + + return b.toString(); + } } diff --git a/odata2-annotation-processor/annotation-processor-web/pom.xml b/odata2-annotation-processor/annotation-processor-web/pom.xml index 797d8dac7..5f00dff29 100644 --- a/odata2-annotation-processor/annotation-processor-web/pom.xml +++ b/odata2-annotation-processor/annotation-processor-web/pom.xml @@ -20,14 +20,10 @@ org.apache.olingo olingo-odata2-annotation-processor - 2.0.13 + 3.0.0-SNAPSHOT .. - - 1.7.1 - - @@ -61,13 +57,6 @@ - - - javax.servlet - servlet-api - 2.5 - provided - org.apache.cxf cxf-rt-frontend-jaxrs @@ -86,7 +75,6 @@ org.slf4j slf4j-log4j12 - ${version.slf4j} diff --git a/odata2-annotation-processor/annotation-processor-web/src/main/resources/META-INF/LICENSE b/odata2-annotation-processor/annotation-processor-web/src/main/resources/META-INF/LICENSE index 6547e9637..28751de46 100644 --- a/odata2-annotation-processor/annotation-processor-web/src/main/resources/META-INF/LICENSE +++ b/odata2-annotation-processor/annotation-processor-web/src/main/resources/META-INF/LICENSE @@ -497,8 +497,8 @@ ===================================================================== - - javax.ws.rs-api (http://jax-rs-spec.java.net) - javax.ws.rs:javax.ws.rs-api:jar:2.0-m10 + - jakarta.ws.rs-api (http://jax-rs-spec.java.net) + jakarta.ws.rs:jakarta.ws.rs-api:jar:2.0-m10 - JAXB Reference Implementation (http://jaxb.java.net/) com.sun.xml.bind:jaxb-impl:jar:2.2.6 License: CDDL 1.1 (https://glassfish.java.net/public/CDDL+GPL_1_1.html) diff --git a/odata2-annotation-processor/annotation-processor-web/src/main/webapp/WEB-INF/web.xml b/odata2-annotation-processor/annotation-processor-web/src/main/webapp/WEB-INF/web.xml index 2e4635ec8..15eca6077 100644 --- a/odata2-annotation-processor/annotation-processor-web/src/main/webapp/WEB-INF/web.xml +++ b/odata2-annotation-processor/annotation-processor-web/src/main/webapp/WEB-INF/web.xml @@ -30,7 +30,7 @@ ReferenceScenarioServlet org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet - javax.ws.rs.Application + jakarta.ws.rs.Application org.apache.olingo.odata2.core.rest.app.ODataApplication diff --git a/odata2-annotation-processor/pom.xml b/odata2-annotation-processor/pom.xml index d830a1c50..3f3f19c7a 100644 --- a/odata2-annotation-processor/pom.xml +++ b/odata2-annotation-processor/pom.xml @@ -18,7 +18,7 @@ org.apache.olingo olingo-odata2-parent - 2.0.13 + 3.0.0-SNAPSHOT .. diff --git a/odata2-dist/janos/pom.xml b/odata2-dist/janos/pom.xml index f4b3926e8..37704a270 100644 --- a/odata2-dist/janos/pom.xml +++ b/odata2-dist/janos/pom.xml @@ -17,7 +17,7 @@ org.apache.olingo olingo-odata2-dist - 2.0.13 + 3.0.0-SNAPSHOT .. diff --git a/odata2-dist/janos/src/main/resources/LICENSE b/odata2-dist/janos/src/main/resources/LICENSE index 932a86ec0..d832967ef 100644 --- a/odata2-dist/janos/src/main/resources/LICENSE +++ b/odata2-dist/janos/src/main/resources/LICENSE @@ -205,8 +205,8 @@ ===================================================================== - - javax.ws.rs-api (http://jax-rs-spec.java.net) - javax.ws.rs:javax.ws.rs-api:jar:2.0-m10 + - jakarta.ws.rs-api (http://jax-rs-spec.java.net) + jakarta.ws.rs:jakarta.ws.rs-api:jar:2.0-m10 License: CDDL 1.1 (https://glassfish.java.net/public/CDDL+GPL_1_1.html) ===================================================================== diff --git a/odata2-dist/javadoc/pom.xml b/odata2-dist/javadoc/pom.xml index 841a18b8c..59b4cd356 100644 --- a/odata2-dist/javadoc/pom.xml +++ b/odata2-dist/javadoc/pom.xml @@ -17,7 +17,7 @@ org.apache.olingo olingo-odata2-dist - 2.0.13 + 3.0.0-SNAPSHOT .. diff --git a/odata2-dist/jpa/pom.xml b/odata2-dist/jpa/pom.xml index 6264163fe..32cae72c0 100644 --- a/odata2-dist/jpa/pom.xml +++ b/odata2-dist/jpa/pom.xml @@ -17,7 +17,7 @@ org.apache.olingo olingo-odata2-dist - 2.0.13 + 3.0.0-SNAPSHOT .. @@ -99,11 +99,5 @@ ${project.version} compile - - org.eclipse.persistence - javax.persistence - ${version.javax.persistence} - compile - diff --git a/odata2-dist/jpa/src/main/assembly/jpa-assembly.xml b/odata2-dist/jpa/src/main/assembly/jpa-assembly.xml index 9c0c7b8d5..4b89c4734 100644 --- a/odata2-dist/jpa/src/main/assembly/jpa-assembly.xml +++ b/odata2-dist/jpa/src/main/assembly/jpa-assembly.xml @@ -28,7 +28,7 @@ org.apache.olingo:olingo-odata2-api-annotation org.apache.olingo:olingo-odata2-jpa-processor-api org.apache.olingo:olingo-odata2-jpa-processor-core - org.eclipse.persistence:javax.persistence + jakarta.persistence:jakarta.persistence-api diff --git a/odata2-dist/jpa/src/main/resources/LICENSE b/odata2-dist/jpa/src/main/resources/LICENSE index e2f9f31ad..765b0c157 100644 --- a/odata2-dist/jpa/src/main/resources/LICENSE +++ b/odata2-dist/jpa/src/main/resources/LICENSE @@ -204,8 +204,8 @@ ===================================================================== - - javax.ws.rs-api (http://jax-rs-spec.java.net) - javax.ws.rs:javax.ws.rs-api:jar:2.0-m10 + - jakarta.ws.rs-api (http://jax-rs-spec.java.net) + jakarta.ws.rs:jakarta.ws.rs-api:jar:2.0-m10 License: CDDL 1.1 (https://glassfish.java.net/public/CDDL+GPL_1_1.html) ===================================================================== @@ -587,7 +587,7 @@ ===================================================================== - Javax Persistence (http://www.eclipse.org/eclipselink) - org.eclipse.persistence:javax.persistence:jar:2.0.5 + jakarta.persistence:jakarta.persistence-api:jar:2.0.5 License: Eclipse Public License v1.0 (http://www.eclipse.org/legal/epl-v10.html) License: Eclipse Distribution License v. 1.0 (http://www.eclipse.org/org/documents/edl-v10.php) diff --git a/odata2-dist/lib/pom.xml b/odata2-dist/lib/pom.xml index 012687cd8..e8e23da8d 100644 --- a/odata2-dist/lib/pom.xml +++ b/odata2-dist/lib/pom.xml @@ -17,7 +17,7 @@ org.apache.olingo olingo-odata2-dist - 2.0.13 + 3.0.0-SNAPSHOT .. diff --git a/odata2-dist/lib/src/main/resources/LICENSE b/odata2-dist/lib/src/main/resources/LICENSE index 932a86ec0..d832967ef 100644 --- a/odata2-dist/lib/src/main/resources/LICENSE +++ b/odata2-dist/lib/src/main/resources/LICENSE @@ -205,8 +205,8 @@ ===================================================================== - - javax.ws.rs-api (http://jax-rs-spec.java.net) - javax.ws.rs:javax.ws.rs-api:jar:2.0-m10 + - jakarta.ws.rs-api (http://jax-rs-spec.java.net) + jakarta.ws.rs:jakarta.ws.rs-api:jar:2.0-m10 License: CDDL 1.1 (https://glassfish.java.net/public/CDDL+GPL_1_1.html) ===================================================================== diff --git a/odata2-dist/pom.xml b/odata2-dist/pom.xml index 3aa08424f..d0ab591b3 100644 --- a/odata2-dist/pom.xml +++ b/odata2-dist/pom.xml @@ -17,7 +17,7 @@ org.apache.olingo olingo-odata2-parent - 2.0.13 + 3.0.0-SNAPSHOT .. diff --git a/odata2-dist/ref/pom.xml b/odata2-dist/ref/pom.xml index 199f6e89a..5e2c5473f 100644 --- a/odata2-dist/ref/pom.xml +++ b/odata2-dist/ref/pom.xml @@ -17,7 +17,7 @@ org.apache.olingo olingo-odata2-dist - 2.0.13 + 3.0.0-SNAPSHOT .. @@ -117,7 +117,6 @@ org.slf4j slf4j-log4j12 - 1.7.1 diff --git a/odata2-dist/ref/src/main/resources/LICENSE b/odata2-dist/ref/src/main/resources/LICENSE index 00b68b503..c99a4b6d1 100644 --- a/odata2-dist/ref/src/main/resources/LICENSE +++ b/odata2-dist/ref/src/main/resources/LICENSE @@ -497,8 +497,8 @@ ===================================================================== - - javax.ws.rs-api (http://jax-rs-spec.java.net) - javax.ws.rs:javax.ws.rs-api:jar:2.0-m10 + - jakarta.ws.rs-api (http://jax-rs-spec.java.net) + jakarta.ws.rs:jakarta.ws.rs-api:jar:2.0-m10 - JAXB Reference Implementation (http://jaxb.java.net/) com.sun.xml.bind:jaxb-impl:jar:2.2.6 License: CDDL 1.1 (https://glassfish.java.net/public/CDDL+GPL_1_1.html) @@ -917,7 +917,7 @@ - EclipseLink (non-OSGi) (http://www.eclipse.org/eclipselink) org.eclipse.persistence:eclipselink:jar:2.5.0 - Javax Persistence (http://www.eclipse.org/eclipselink) - org.eclipse.persistence:javax.persistence:jar:2.0.5 + jakarta.persistence:jakarta.persistence-api:jar:2.0.5 License: Eclipse Public License v1.0 (http://www.eclipse.org/legal/epl-v10.html) License: Eclipse Distribution License v. 1.0 (http://www.eclipse.org/org/documents/edl-v10.php) diff --git a/odata2-jpa-processor/jpa-api/pom.xml b/odata2-jpa-processor/jpa-api/pom.xml index 872f2ae90..5db331aed 100644 --- a/odata2-jpa-processor/jpa-api/pom.xml +++ b/odata2-jpa-processor/jpa-api/pom.xml @@ -17,28 +17,30 @@ specific language governing permissions and limitations under the License. --> - 4.0.0 org.apache.olingo olingo-odata2-jpa-processor - 2.0.13 + 3.0.0-SNAPSHOT ../ olingo-odata2-jpa-processor-api jar ${project.artifactId} - + maven-jar-plugin - ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF @@ -72,13 +74,16 @@ - + + + jakarta.xml.bind + jakarta.xml.bind-api + - org.eclipse.persistence - javax.persistence - ${version.javax.persistence} + jakarta.persistence + jakarta.persistence-api diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAContext.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAContext.java index 7cb54d9f6..1c98759f8 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAContext.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAContext.java @@ -18,8 +18,8 @@ ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api; -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; +import jakarta.persistence.EntityManager; +import jakarta.persistence.EntityManagerFactory; import org.apache.olingo.odata2.api.edm.provider.EdmProvider; import org.apache.olingo.odata2.api.processor.ODataContext; @@ -111,7 +111,7 @@ public interface ODataJPAContext { * context. * * @param emf - * is of type {@link javax.persistence.EntityManagerFactory} + * is of type {@link jakarta.persistence.EntityManagerFactory} * */ public void setEntityManagerFactory(EntityManagerFactory emf); @@ -159,7 +159,7 @@ public interface ODataJPAContext { * Hence all entities that are accessed within JPA processor are managed by * single entity manager. * - * @return an instance of type {@link javax.persistence.EntityManager} + * @return an instance of type {@link jakarta.persistence.EntityManager} */ public EntityManager getEntityManager(); diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java index 0c355f566..7a6690255 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java @@ -18,7 +18,7 @@ ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api; -import javax.persistence.EntityManager; +import jakarta.persistence.EntityManager; import org.apache.olingo.odata2.api.processor.ODataSingleProcessor; import org.apache.olingo.odata2.jpa.processor.api.access.JPAProcessor; diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAQueryExtensionEntityListener.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAQueryExtensionEntityListener.java index e2c09d5b6..892267dec 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAQueryExtensionEntityListener.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAQueryExtensionEntityListener.java @@ -21,8 +21,8 @@ import java.util.List; import java.util.Locale; -import javax.persistence.EntityManager; -import javax.persistence.Query; +import jakarta.persistence.EntityManager; +import jakarta.persistence.Query; import org.apache.olingo.odata2.api.exception.ODataApplicationException; import org.apache.olingo.odata2.api.uri.info.DeleteUriInfo; @@ -41,8 +41,8 @@ public abstract class ODataJPAQueryExtensionEntityListener extends ODataJPATombs /** * Override this method to build JPA Query for OData request - GetEntitySet; SELECT * * @param uriInfo is a reference to OData request - * @param em is a reference to {@link javax.persistence.EntityManager} - * @return an instance of type {@link javax.persistence.Query} + * @param em is a reference to {@link jakarta.persistence.EntityManager} + * @return an instance of type {@link jakarta.persistence.Query} */ public Query getQuery(GetEntitySetUriInfo uriInfo, EntityManager em) throws ODataJPARuntimeException { return null; @@ -52,8 +52,8 @@ public Query getQuery(GetEntitySetUriInfo uriInfo, EntityManager em) throws ODat * Override this method to build JPA Query for OData request - GetEntity; SELECT SINGLE with key in WHERE * clause * @param uriInfo is a reference to OData request - * @param em is a reference to {@link javax.persistence.EntityManager} - * @return an instance of type {@link javax.persistence.Query} + * @param em is a reference to {@link jakarta.persistence.EntityManager} + * @return an instance of type {@link jakarta.persistence.Query} */ public Query getQuery(GetEntityUriInfo uriInfo, EntityManager em) throws ODataJPARuntimeException { return null; @@ -63,8 +63,8 @@ public Query getQuery(GetEntityUriInfo uriInfo, EntityManager em) throws ODataJP * Override this method to build JPA Query for OData request - GetEntity Count; SELECT SINGLE with key in WHERE * clause * @param uriInfo is a reference to OData request - * @param em is a reference to {@link javax.persistence.EntityManager} - * @return an instance of type {@link javax.persistence.Query} + * @param em is a reference to {@link jakarta.persistence.EntityManager} + * @return an instance of type {@link jakarta.persistence.Query} */ public Query getQuery(GetEntityCountUriInfo uriInfo, EntityManager em) throws ODataJPARuntimeException { return null; @@ -73,8 +73,8 @@ public Query getQuery(GetEntityCountUriInfo uriInfo, EntityManager em) throws OD /** * Override this method to build JPA Query for OData request - GetEntitySet Count; SELECT COUNT(*) * @param uriInfo is a reference to OData request - * @param em is a reference to {@link javax.persistence.EntityManager} - * @return an instance of type {@link javax.persistence.Query} + * @param em is a reference to {@link jakarta.persistence.EntityManager} + * @return an instance of type {@link jakarta.persistence.Query} */ public Query getQuery(GetEntitySetCountUriInfo uriInfo, EntityManager em) throws ODataJPARuntimeException { return null; @@ -84,8 +84,8 @@ public Query getQuery(GetEntitySetCountUriInfo uriInfo, EntityManager em) throws * Override this method to build JPA Query for OData request - Update; SELECT SINGLE with key in WHERE * clause * @param uriInfo is a reference to OData request - * @param em is a reference to {@link javax.persistence.EntityManager} - * @return an instance of type {@link javax.persistence.Query} + * @param em is a reference to {@link jakarta.persistence.EntityManager} + * @return an instance of type {@link jakarta.persistence.Query} */ public Query getQuery(PutMergePatchUriInfo uriInfo, EntityManager em) throws ODataJPARuntimeException { return null; @@ -95,8 +95,8 @@ public Query getQuery(PutMergePatchUriInfo uriInfo, EntityManager em) throws ODa * Override this method to build JPA Query for OData request - Delete; SELECT SINGLE with key in WHERE * clause * @param uriInfo is a reference to OData request - * @param em is a reference to {@link javax.persistence.EntityManager} - * @return an instance of type {@link javax.persistence.Query} + * @param em is a reference to {@link jakarta.persistence.EntityManager} + * @return an instance of type {@link jakarta.persistence.Query} */ public Query getQuery(DeleteUriInfo uriInfo, EntityManager em) throws ODataJPARuntimeException { return null; diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAServiceFactory.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAServiceFactory.java index 6089be080..9a56135f8 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAServiceFactory.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAServiceFactory.java @@ -59,7 +59,7 @@ * ReferenceScenarioServlet * org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet * - * javax.ws.rs.Application + * jakarta.ws.rs.Application * org.apache.olingo.odata2.core.rest.ODataApplication * * @@ -85,7 +85,7 @@ public abstract class ODataJPAServiceFactory extends ODataServiceFactory { /** * Implement this method and initialize OData JPA Context. It is mandatory - * to set an instance of type {@link javax.persistence.EntityManagerFactory} into the context. An exception of type + * to set an instance of type {@link jakarta.persistence.EntityManagerFactory} into the context. An exception of type * {@link org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException} is thrown if * EntityManagerFactory is not initialized. * diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPATombstoneEntityListener.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPATombstoneEntityListener.java index 0dfc93564..a19804a18 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPATombstoneEntityListener.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPATombstoneEntityListener.java @@ -20,8 +20,8 @@ import java.util.List; -import javax.persistence.EntityManager; -import javax.persistence.Query; +import jakarta.persistence.EntityManager; +import jakarta.persistence.Query; import org.apache.olingo.odata2.api.uri.info.GetEntitySetUriInfo; import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException; @@ -40,20 +40,20 @@ protected final void addToDelta(final Object entity, final String entityName) { } /** - * Implement this method to create a {@link javax.persistence.Query} object. The Query object can be created from + * Implement this method to create a {@link jakarta.persistence.Query} object. The Query object can be created from * OData requests. The query instance thus created can be used for handling delta JPA entities. The delta token passed * from OData request can * be accessed from {@link com.sap.core.odata.processor.api.jpa.ODataJPATombstoneContext}. * @param resultsView is a reference to OData request - * @param em is a reference to {@link javax.persistence.EntityManager} - * @return an instance of type {@link javax.persistence.Query} + * @param em is a reference to {@link jakarta.persistence.EntityManager} + * @return an instance of type {@link jakarta.persistence.Query} */ public abstract Query getQuery(GetEntitySetUriInfo resultsView, EntityManager em) throws ODataJPARuntimeException; /** * Implement this method to create a delta token. * @param deltas is list of delta JPA Entities - * @param query is an instance of type {@link javax.persistence.Query} that was used for handling delta entites + * @param query is an instance of type {@link jakarta.persistence.Query} that was used for handling delta entites * @return a delta token of type String */ public abstract String generateDeltaToken(List deltas, Query query); diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/JPAEdmBaseView.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/JPAEdmBaseView.java index 56aa8b301..82fa48c80 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/JPAEdmBaseView.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/JPAEdmBaseView.java @@ -18,7 +18,7 @@ ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model; -import javax.persistence.metamodel.Metamodel; +import jakarta.persistence.metamodel.Metamodel; import org.apache.olingo.odata2.jpa.processor.api.access.JPAEdmBuilder; import org.apache.olingo.odata2.jpa.processor.api.access.JPAEdmMappingModelAccess; @@ -46,7 +46,7 @@ public interface JPAEdmBaseView { /** * The method returns the Java Persistence MetaModel * - * @return a meta model of type {@link javax.persistence.metamodel.Metamodel} + * @return a meta model of type {@link jakarta.persistence.metamodel.Metamodel} */ public Metamodel getJPAMetaModel(); diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/JPAEdmComplexTypeView.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/JPAEdmComplexTypeView.java index 3b5a88403..6f53d0638 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/JPAEdmComplexTypeView.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/JPAEdmComplexTypeView.java @@ -58,9 +58,9 @@ public interface JPAEdmComplexTypeView extends JPAEdmBaseView { * The method returns an JPA embeddable type that is currently being * processed. * - * @return an instance of type {@link javax.persistence.metamodel.EmbeddableType} + * @return an instance of type {@link jakarta.persistence.metamodel.EmbeddableType} */ - public javax.persistence.metamodel.EmbeddableType> getJPAEmbeddableType(); + public jakarta.persistence.metamodel.EmbeddableType> getJPAEmbeddableType(); /** * The method returns a consistent list of EDM complex types. diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/JPAEdmEntityTypeView.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/JPAEdmEntityTypeView.java index 80de08482..17a2563e1 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/JPAEdmEntityTypeView.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/JPAEdmEntityTypeView.java @@ -1,76 +1,69 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model; import java.util.List; - import org.apache.olingo.odata2.api.edm.provider.EntityType; /** - * A view on Java Persistence entity types and EDM entity types. Java - * persistence entity types are converted into EDM entity types. + * A view on Java Persistence entity types and EDM entity types. Java persistence entity types are + * converted into EDM entity types. * - * The implementation of the view provides access to EDM entity types for the - * given JPA EDM model. The view acts as a container for consistent list of EDM - * entity types. An EDM entity type is said to be consistent only if it has at - * least one consistent EDM property and at least one consistent EDM key. - * - * + * The implementation of the view provides access to EDM entity types for the given JPA EDM model. + * The view acts as a container for consistent list of EDM entity types. An EDM entity type is said + * to be consistent only if it has at least one consistent EDM property and at least one consistent + * EDM key. + * + * * + * * @org.apache.olingo.odata2.DoNotImplement * @see org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmPropertyView * @see org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmKeyView * @see org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmNavigationPropertyView - * + * */ public interface JPAEdmEntityTypeView extends JPAEdmBaseView { - /** - * The method returns an EDM entity currently being processed. - * - * @return an instance of type {@link org.apache.olingo.odata2.api.edm.provider.EntityType} - */ - public EntityType getEdmEntityType(); + /** + * The method returns an EDM entity currently being processed. + * + * @return an instance of type {@link org.apache.olingo.odata2.api.edm.provider.EntityType} + */ + EntityType getEdmEntityType(); - /** - * The method returns java persistence Entity type currently being - * processed. - * - * @return an instance of type {@link javax.persistence.metamodel.EntityType} - */ - public javax.persistence.metamodel.EntityType> getJPAEntityType(); + /** + * The method returns java persistence Entity type currently being processed. + * + * @return an instance of type {@link javax.persistence.metamodel.EntityType} + */ + jakarta.persistence.metamodel.EntityType> getJPAEntityType(); - /** - * The method returns a consistent list of EDM entity types for a given java - * persistence meta model. - * - * @return a list of {@link org.apache.olingo.odata2.api.edm.provider.EntityType} - */ - public List getConsistentEdmEntityTypes(); + /** + * The method returns a consistent list of EDM entity types for a given java persistence meta model. + * + * @return a list of {@link org.apache.olingo.odata2.api.edm.provider.EntityType} + */ + List getConsistentEdmEntityTypes(); - /** - * The method searches in the consistent list of EDM entity types for the - * given EDM entity type's name. - * - * @param jpaEntityTypeName - * is the name of EDM entity type - * @return a reference to EDM entity type if found else null - */ - public EntityType searchEdmEntityType(String jpaEntityTypeName); + /** + * The method searches in the consistent list of EDM entity types for the given EDM entity type's + * name. + * + * @param jpaEntityTypeName is the name of EDM entity type + * @return a reference to EDM entity type if found else null + */ + EntityType searchEdmEntityType(String jpaEntityTypeName); } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/JPAEdmPropertyView.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/JPAEdmPropertyView.java index 3ce66d648..1eca444e3 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/JPAEdmPropertyView.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/JPAEdmPropertyView.java @@ -20,7 +20,7 @@ import java.util.List; -import javax.persistence.metamodel.Attribute; +import jakarta.persistence.metamodel.Attribute; import org.apache.olingo.odata2.api.edm.provider.Property; import org.apache.olingo.odata2.api.edm.provider.SimpleProperty; @@ -74,16 +74,16 @@ public interface JPAEdmPropertyView extends JPAEdmBaseView { /** * The method returns a JPA Attribute for the given JPA entity type. * - * @return an instance of type {@link javax.persistence.metamodel.Attribute + * @return an instance of type {@link jakarta.persistence.metamodel.Attribute * , ?>} */ Attribute, ?> getJPAAttribute(); /** - * The method returns a JPA Attribute referenced by a JPA Attribute in the {@link javax.persistence.JoinColumn} + * The method returns a JPA Attribute referenced by a JPA Attribute in the {@link jakarta.persistence.JoinColumn} * annotation for the given JPA entity type . * - * @return an instance of type {@link javax.persistence.metamodel.Attribute + * @return an instance of type {@link jakarta.persistence.metamodel.Attribute * , ?>} */ Attribute, ?> getJPAReferencedAttribute(); diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAAttributeMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAAttributeMapType.java index e7bcbe97b..cb899a42a 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAAttributeMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAAttributeMapType.java @@ -1,45 +1,40 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; import java.util.ArrayList; import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlValue; /** - * - * The default name for EDM - * property is derived from JPA attribute name. This can be overriden - * using + * + * The default name for EDM property is derived from JPA attribute name. This can be overriden using * JPAAttributeMapType. - * - * - * Java class for JPAAttributeMapType complex type. - * - * The following schema fragment specifies the expected content contained within this class. - * + * + * + * + * Java class for JPAAttributeMapType complex type. + * + * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAAttributeMapType"> * <complexContent> @@ -60,143 +55,139 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAAttributeMapType", propOrder = { "jpaAttribute" }) +@XmlType(name = "JPAAttributeMapType", propOrder = {"jpaAttribute"}) public class JPAAttributeMapType { - @XmlElement(name = "JPAAttribute") - protected List jpaAttribute; - - /** - * Gets the value of the jpaAttribute property. - * - * - * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the jpaAttribute property. - * - * - * For example, to add a new item, do as follows: - * - * getJPAAttribute().add(newItem); - * - * - * - * - * Objects of the following type(s) are allowed in the list {@link JPAAttributeMapType.JPAAttribute } - * - * - */ - public List getJPAAttribute() { - if (jpaAttribute == null) { - jpaAttribute = new ArrayList(); - } - return jpaAttribute; - } - - /** - * Java class for anonymous complex type. - * - * The following schema fragment specifies the expected content contained within this class. - * - * - * <complexType> - * <simpleContent> - * <extension base="<http://www.w3.org/2001/XMLSchema>string"> - * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * <attribute name="exclude" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /> - * </extension> - * </simpleContent> - * </complexType> - * - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { "value" }) - public static class JPAAttribute { - - @XmlValue - protected String value; - @XmlAttribute(name = "name", required = true) - protected String name; - @XmlAttribute(name = "exclude") - protected Boolean exclude; + @XmlElement(name = "JPAAttribute") + protected List jpaAttribute; /** - * Gets the value of the value property. + * Gets the value of the jpaAttribute property. * - * @return - * possible object is {@link String } + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaAttribute property. * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. + * + * For example, to add a new item, do as follows: + * + * + * getJPAAttribute().add(newItem); + * * - * @param value - * allowed object is {@link String } * - */ - public void setValue(final String value) { - this.value = value; - } - - /** - * Gets the value of the name property. + * + * Objects of the following type(s) are allowed in the list + * {@link JPAAttributeMapType.JPAAttribute } * - * @return - * possible object is {@link String } * */ - public String getName() { - return name; + public List getJPAAttribute() { + if (jpaAttribute == null) { + jpaAttribute = new ArrayList(); + } + return jpaAttribute; } /** - * Sets the value of the name property. + * + * Java class for anonymous complex type. * - * @param value - * allowed object is {@link String } + * + * The following schema fragment specifies the expected content contained within this class. * - */ - public void setName(final String value) { - name = value; - } - - /** - * Gets the value of the exclude property. + * + * <complexType> + * <simpleContent> + * <extension base="<http://www.w3.org/2001/XMLSchema>string"> + * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute name="exclude" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /> + * </extension> + * </simpleContent> + * </complexType> + * * - * @return - * possible object is {@link Boolean } * */ - public boolean isExclude() { - if (exclude == null) { - return false; - } else { - return exclude; - } - } + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"value"}) + public static class JPAAttribute { - /** - * Sets the value of the exclude property. - * - * @param value - * allowed object is {@link Boolean } - * - */ - public void setExclude(final Boolean value) { - exclude = value; - } + @XmlValue + protected String value; + @XmlAttribute(name = "name", required = true) + protected String name; + @XmlAttribute(name = "exclude") + protected Boolean exclude; - } + /** + * Gets the value of the value property. + * + * @return possible object is {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value allowed object is {@link String } + * + */ + public void setValue(final String value) { + this.value = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } + + /** + * Gets the value of the exclude property. + * + * @return possible object is {@link Boolean } + * + */ + public boolean isExclude() { + if (exclude == null) { + return false; + } + return exclude; + } + + /** + * Sets the value of the exclude property. + * + * @param value allowed object is {@link Boolean } + * + */ + public void setExclude(final Boolean value) { + exclude = value; + } + + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModel.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModel.java index a4175d481..b2b255cbe 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModel.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModel.java @@ -1,37 +1,32 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; /** * * Java class for anonymous complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType> * <complexContent> @@ -44,36 +39,35 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { "persistenceUnit" }) +@XmlType(name = "", propOrder = {"persistenceUnit"}) @XmlRootElement(name = "JPAEDMMappingModel") public class JPAEdmMappingModel { - @XmlElement(name = "PersistenceUnit", required = true) - protected JPAPersistenceUnitMapType persistenceUnit; + @XmlElement(name = "PersistenceUnit", required = true) + protected JPAPersistenceUnitMapType persistenceUnit; - /** - * Gets the value of the persistenceUnit property. - * - * @return possible object is {@link JPAPersistenceUnitMapType } - * - */ - public JPAPersistenceUnitMapType getPersistenceUnit() { - return persistenceUnit; - } + /** + * Gets the value of the persistenceUnit property. + * + * @return possible object is {@link JPAPersistenceUnitMapType } + * + */ + public JPAPersistenceUnitMapType getPersistenceUnit() { + return persistenceUnit; + } - /** - * Sets the value of the persistenceUnit property. - * - * @param value - * allowed object is {@link JPAPersistenceUnitMapType } - * - */ - public void setPersistenceUnit(final JPAPersistenceUnitMapType value) { - persistenceUnit = value; - } + /** + * Sets the value of the persistenceUnit property. + * + * @param value allowed object is {@link JPAPersistenceUnitMapType } + * + */ + public void setPersistenceUnit(final JPAPersistenceUnitMapType value) { + persistenceUnit = value; + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModelFactory.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModelFactory.java index 84f8b282b..5ab4991bc 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModelFactory.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModelFactory.java @@ -1,85 +1,83 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlRegistry; +import jakarta.xml.bind.annotation.XmlRegistry; /** - * This object contains factory methods for each Java content interface and Java - * element interface generated in the - * org.apache.olingo.odata2.processor.api.jpa.model.mapping package. + * This object contains factory methods for each Java content interface and Java element interface + * generated in the org.apache.olingo.odata2.processor.api.jpa.model.mapping package. * - * An ObjectFactory allows you to programatically construct new instances of the - * Java representation for XML content. The Java representation of XML content - * can consist of schema derived interfaces and classes representing the binding - * of schema type definitions, element declarations and model groups. Factory - * methods for each of these are provided in this class. - * + * An ObjectFactory allows you to programatically construct new instances of the Java representation + * for XML content. The Java representation of XML content can consist of schema derived interfaces + * and classes representing the binding of schema type definitions, element declarations and model + * groups. Factory methods for each of these are provided in this class. + * */ @XmlRegistry public class JPAEdmMappingModelFactory { - /** - * Create a new ObjectFactory that can be used to create new instances of - * schema derived classes for package: - * org.apache.olingo.odata2.processor.api.jpa.model.mapping - * - */ - public JPAEdmMappingModelFactory() {} + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for + * package: org.apache.olingo.odata2.processor.api.jpa.model.mapping + * + */ + public JPAEdmMappingModelFactory() {} - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPARelationshipMapType } - * - */ - public JPARelationshipMapType createJPARelationshipMapType() { - return new JPARelationshipMapType(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPARelationshipMapType } + * + */ + public JPARelationshipMapType createJPARelationshipMapType() { + return new JPARelationshipMapType(); + } - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAAttributeMapType } - * - */ - public JPAAttributeMapType createJPAAttributeMapType() { - return new JPAAttributeMapType(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAAttributeMapType } + * + */ + public JPAAttributeMapType createJPAAttributeMapType() { + return new JPAAttributeMapType(); + } - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEdmMappingModel } - * - */ - public JPAEdmMappingModel createJPAEDMMappingModel() { - return new JPAEdmMappingModel(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEdmMappingModel } + * + */ + public JPAEdmMappingModel createJPAEDMMappingModel() { + return new JPAEdmMappingModel(); + } - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAPersistenceUnitMapType } - * - */ - public JPAPersistenceUnitMapType createJPAPersistenceUnitMapType() { - return new JPAPersistenceUnitMapType(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAPersistenceUnitMapType } + * + */ + public JPAPersistenceUnitMapType createJPAPersistenceUnitMapType() { + return new JPAPersistenceUnitMapType(); + } - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEmbeddableTypeMapType } - * - */ - public JPAEmbeddableTypeMapType createJPAEmbeddableTypeMapType() { - return new JPAEmbeddableTypeMapType(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEmbeddableTypeMapType } + * + */ + public JPAEmbeddableTypeMapType createJPAEmbeddableTypeMapType() { + return new JPAEmbeddableTypeMapType(); + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypeMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypeMapType.java index e64067387..47803af26 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypeMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypeMapType.java @@ -1,40 +1,37 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** - * - * The default name for EDM - * complex type is derived from JPA Embeddable type name. This can be + * + * The default name for EDM complex type is derived from JPA Embeddable type name. This can be * overriden using JPAEmbeddableTypeMapType. - * - * - * Java class for JPAEmbeddableTypeMapType complex type. - * - * The following schema fragment specifies the expected content contained within this class. - * + * + * + * + * Java class for JPAEmbeddableTypeMapType complex type. + * + * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAEmbeddableTypeMapType"> * <complexContent> @@ -50,112 +47,103 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAEmbeddableTypeMapType", propOrder = { "edmComplexType", "jpaAttributes" }) +@XmlType(name = "JPAEmbeddableTypeMapType", propOrder = {"edmComplexType", "jpaAttributes"}) public class JPAEmbeddableTypeMapType { - @XmlElement(name = "EDMComplexType") - protected String edmComplexType; - @XmlElement(name = "JPAAttributes", required = true) - protected JPAAttributeMapType jpaAttributes; - @XmlAttribute(name = "name", required = true) - protected String name; - @XmlAttribute(name = "exclude") - protected Boolean exclude; + @XmlElement(name = "EDMComplexType") + protected String edmComplexType; + @XmlElement(name = "JPAAttributes", required = true) + protected JPAAttributeMapType jpaAttributes; + @XmlAttribute(name = "name", required = true) + protected String name; + @XmlAttribute(name = "exclude") + protected Boolean exclude; - /** - * Gets the value of the edmComplexType property. - * - * @return - * possible object is {@link String } - * - */ - public String getEDMComplexType() { - return edmComplexType; - } + /** + * Gets the value of the edmComplexType property. + * + * @return possible object is {@link String } + * + */ + public String getEDMComplexType() { + return edmComplexType; + } - /** - * Sets the value of the edmComplexType property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMComplexType(final String value) { - edmComplexType = value; - } + /** + * Sets the value of the edmComplexType property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMComplexType(final String value) { + edmComplexType = value; + } - /** - * Gets the value of the jpaAttributes property. - * - * @return - * possible object is {@link JPAAttributeMapType } - * - */ - public JPAAttributeMapType getJPAAttributes() { - return jpaAttributes; - } + /** + * Gets the value of the jpaAttributes property. + * + * @return possible object is {@link JPAAttributeMapType } + * + */ + public JPAAttributeMapType getJPAAttributes() { + return jpaAttributes; + } - /** - * Sets the value of the jpaAttributes property. - * - * @param value - * allowed object is {@link JPAAttributeMapType } - * - */ - public void setJPAAttributes(final JPAAttributeMapType value) { - jpaAttributes = value; - } + /** + * Sets the value of the jpaAttributes property. + * + * @param value allowed object is {@link JPAAttributeMapType } + * + */ + public void setJPAAttributes(final JPAAttributeMapType value) { + jpaAttributes = value; + } - /** - * Gets the value of the name property. - * - * @return - * possible object is {@link String } - * - */ - public String getName() { - return name; - } + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } - /** - * Sets the value of the name property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setName(final String value) { - name = value; - } + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } - /** - * Gets the value of the exclude property. - * - * @return - * possible object is {@link Boolean } - * - */ - public boolean isExclude() { - if (exclude == null) { - return false; - } else { - return exclude; + /** + * Gets the value of the exclude property. + * + * @return possible object is {@link Boolean } + * + */ + public boolean isExclude() { + if (exclude == null) { + return false; + } + return exclude; } - } - /** - * Sets the value of the exclude property. - * - * @param value - * allowed object is {@link Boolean } - * - */ - public void setExclude(final Boolean value) { - exclude = value; - } + /** + * Sets the value of the exclude property. + * + * @param value allowed object is {@link Boolean } + * + */ + public void setExclude(final Boolean value) { + exclude = value; + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypesMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypesMapType.java index 629312444..6bec5a120 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypesMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypesMapType.java @@ -1,39 +1,33 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; import java.util.ArrayList; import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** * * Java class for JPAEmbeddableTypesMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAEmbeddableTypesMapType"> * <complexContent> @@ -47,43 +41,42 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAEmbeddableTypesMapType", propOrder = { "jpaEmbeddableType" }) +@XmlType(name = "JPAEmbeddableTypesMapType", propOrder = {"jpaEmbeddableType"}) public class JPAEmbeddableTypesMapType { - @XmlElement(name = "JPAEmbeddableType") - protected List jpaEmbeddableType; + @XmlElement(name = "JPAEmbeddableType") + protected List jpaEmbeddableType; - /** - * Gets the value of the jpaEmbeddableType property. - * - * - * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the jpaEmbeddableType property. - * - * - * For example, to add a new item, do as follows: - * - * - * getJPAEmbeddableType().add(newItem); - * - * - * - * - * Objects of the following type(s) are allowed in the list {@link JPAEmbeddableTypeMapType } - * - * - */ - public List getJPAEmbeddableType() { - if (jpaEmbeddableType == null) { - jpaEmbeddableType = new ArrayList(); + /** + * Gets the value of the jpaEmbeddableType property. + * + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaEmbeddableType property. + * + * + * For example, to add a new item, do as follows: + * + * + * getJPAEmbeddableType().add(newItem); + * + * + * + * + * Objects of the following type(s) are allowed in the list {@link JPAEmbeddableTypeMapType } + * + * + */ + public List getJPAEmbeddableType() { + if (jpaEmbeddableType == null) { + jpaEmbeddableType = new ArrayList(); + } + return jpaEmbeddableType; } - return jpaEmbeddableType; - } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java index 22e181922..8c989234d 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java @@ -1,40 +1,37 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** - * - * The default name for EDM - * entity type is derived from JPA entity type name. This can be - * overriden using JPAEntityTypeMapType. - * - * - * Java class for JPAEntityTypeMapType complex type. - * - * The following schema fragment specifies the expected content contained within this class. - * + * + * The default name for EDM entity type is derived from JPA entity type name. This can be overriden + * using JPAEntityTypeMapType. + * + * + * + * Java class for JPAEntityTypeMapType complex type. + * + * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAEntityTypeMapType"> * <complexContent> @@ -53,161 +50,147 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAEntityTypeMapType", propOrder = { "edmEntityType", "edmEntitySet", "jpaAttributes", - "jpaRelationships" }) +@XmlType(name = "JPAEntityTypeMapType", propOrder = {"edmEntityType", "edmEntitySet", "jpaAttributes", "jpaRelationships"}) public class JPAEntityTypeMapType { - @XmlElement(name = "EDMEntityType") - protected String edmEntityType; - @XmlElement(name = "EDMEntitySet") - protected String edmEntitySet; - @XmlElement(name = "JPAAttributes", required = true) - protected JPAAttributeMapType jpaAttributes; - @XmlElement(name = "JPARelationships", required = true) - protected JPARelationshipMapType jpaRelationships; - @XmlAttribute(name = "name", required = true) - protected String name; - @XmlAttribute(name = "exclude") - protected Boolean exclude; - - /** - * Gets the value of the edmEntityType property. - * - * @return - * possible object is {@link String } - * - */ - public String getEDMEntityType() { - return edmEntityType; - } - - /** - * Sets the value of the edmEntityType property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMEntityType(final String value) { - edmEntityType = value; - } - - /** - * Gets the value of the edmEntitySet property. - * - * @return - * possible object is {@link String } - * - */ - public String getEDMEntitySet() { - return edmEntitySet; - } - - /** - * Sets the value of the edmEntitySet property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMEntitySet(final String value) { - edmEntitySet = value; - } - - /** - * Gets the value of the jpaAttributes property. - * - * @return - * possible object is {@link JPAAttributeMapType } - * - */ - public JPAAttributeMapType getJPAAttributes() { - return jpaAttributes; - } - - /** - * Sets the value of the jpaAttributes property. - * - * @param value - * allowed object is {@link JPAAttributeMapType } - * - */ - public void setJPAAttributes(final JPAAttributeMapType value) { - jpaAttributes = value; - } - - /** - * Gets the value of the jpaRelationships property. - * - * @return - * possible object is {@link JPARelationshipMapType } - * - */ - public JPARelationshipMapType getJPARelationships() { - return jpaRelationships; - } - - /** - * Sets the value of the jpaRelationships property. - * - * @param value - * allowed object is {@link JPARelationshipMapType } - * - */ - public void setJPARelationships(final JPARelationshipMapType value) { - jpaRelationships = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is {@link String } - * - */ - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setName(final String value) { - name = value; - } - - /** - * Gets the value of the exclude property. - * - * @return - * possible object is {@link Boolean } - * - */ - public boolean isExclude() { - if (exclude == null) { - return false; - } else { - return exclude; + @XmlElement(name = "EDMEntityType") + protected String edmEntityType; + @XmlElement(name = "EDMEntitySet") + protected String edmEntitySet; + @XmlElement(name = "JPAAttributes", required = true) + protected JPAAttributeMapType jpaAttributes; + @XmlElement(name = "JPARelationships", required = true) + protected JPARelationshipMapType jpaRelationships; + @XmlAttribute(name = "name", required = true) + protected String name; + @XmlAttribute(name = "exclude") + protected Boolean exclude; + + /** + * Gets the value of the edmEntityType property. + * + * @return possible object is {@link String } + * + */ + public String getEDMEntityType() { + return edmEntityType; + } + + /** + * Sets the value of the edmEntityType property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMEntityType(final String value) { + edmEntityType = value; + } + + /** + * Gets the value of the edmEntitySet property. + * + * @return possible object is {@link String } + * + */ + public String getEDMEntitySet() { + return edmEntitySet; + } + + /** + * Sets the value of the edmEntitySet property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMEntitySet(final String value) { + edmEntitySet = value; + } + + /** + * Gets the value of the jpaAttributes property. + * + * @return possible object is {@link JPAAttributeMapType } + * + */ + public JPAAttributeMapType getJPAAttributes() { + return jpaAttributes; + } + + /** + * Sets the value of the jpaAttributes property. + * + * @param value allowed object is {@link JPAAttributeMapType } + * + */ + public void setJPAAttributes(final JPAAttributeMapType value) { + jpaAttributes = value; + } + + /** + * Gets the value of the jpaRelationships property. + * + * @return possible object is {@link JPARelationshipMapType } + * + */ + public JPARelationshipMapType getJPARelationships() { + return jpaRelationships; + } + + /** + * Sets the value of the jpaRelationships property. + * + * @param value allowed object is {@link JPARelationshipMapType } + * + */ + public void setJPARelationships(final JPARelationshipMapType value) { + jpaRelationships = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } + + /** + * Gets the value of the exclude property. + * + * @return possible object is {@link Boolean } + * + */ + public boolean isExclude() { + if (exclude == null) { + return false; + } + return exclude; + } + + /** + * Sets the value of the exclude property. + * + * @param value allowed object is {@link Boolean } + * + */ + public void setExclude(final Boolean value) { + exclude = value; } - } - - /** - * Sets the value of the exclude property. - * - * @param value - * allowed object is {@link Boolean } - * - */ - public void setExclude(final Boolean value) { - exclude = value; - } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java index 7a72e0848..afacaceca 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java @@ -1,39 +1,33 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; import java.util.ArrayList; import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** * * Java class for JPAEntityTypesMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAEntityTypesMapType"> * <complexContent> @@ -47,43 +41,42 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAEntityTypesMapType", propOrder = { "jpaEntityType" }) +@XmlType(name = "JPAEntityTypesMapType", propOrder = {"jpaEntityType"}) public class JPAEntityTypesMapType { - @XmlElement(name = "JPAEntityType") - protected List jpaEntityType; + @XmlElement(name = "JPAEntityType") + protected List jpaEntityType; - /** - * Gets the value of the jpaEntityType property. - * - * - * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the jpaEntityType property. - * - * - * For example, to add a new item, do as follows: - * - * - * getJPAEntityType().add(newItem); - * - * - * - * - * Objects of the following type(s) are allowed in the list {@link JPAEntityTypeMapType } - * - * - */ - public List getJPAEntityType() { - if (jpaEntityType == null) { - jpaEntityType = new ArrayList(); + /** + * Gets the value of the jpaEntityType property. + * + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaEntityType property. + * + * + * For example, to add a new item, do as follows: + * + * + * getJPAEntityType().add(newItem); + * + * + * + * + * Objects of the following type(s) are allowed in the list {@link JPAEntityTypeMapType } + * + * + */ + public List getJPAEntityType() { + if (jpaEntityType == null) { + jpaEntityType = new ArrayList(); + } + return jpaEntityType; } - return jpaEntityType; - } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java index 22260eac1..7ce8c0aa0 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java @@ -1,42 +1,37 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** - * - * By default Java Persistence Unit name is taken as EDM schema name. This can - * be overriden using JPAPersistenceUnitMapType. - * - * + * + * By default Java Persistence Unit name is taken as EDM schema name. This can be overriden using + * JPAPersistenceUnitMapType. + * + * * * Java class for JPAPersistenceUnitMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAPersistenceUnitMapType"> * <complexContent> @@ -53,105 +48,100 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAPersistenceUnitMapType", - propOrder = { "edmSchemaNamespace", "jpaEntityTypes", "jpaEmbeddableTypes" }) +@XmlType(name = "JPAPersistenceUnitMapType", propOrder = {"edmSchemaNamespace", "jpaEntityTypes", "jpaEmbeddableTypes"}) public class JPAPersistenceUnitMapType { - @XmlElement(name = "EDMSchemaNamespace") - protected String edmSchemaNamespace; - @XmlElement(name = "JPAEntityTypes", required = true) - protected JPAEntityTypesMapType jpaEntityTypes; - @XmlElement(name = "JPAEmbeddableTypes", required = true) - protected JPAEmbeddableTypesMapType jpaEmbeddableTypes; - @XmlAttribute(name = "name", required = true) - protected String name; + @XmlElement(name = "EDMSchemaNamespace") + protected String edmSchemaNamespace; + @XmlElement(name = "JPAEntityTypes", required = true) + protected JPAEntityTypesMapType jpaEntityTypes; + @XmlElement(name = "JPAEmbeddableTypes", required = true) + protected JPAEmbeddableTypesMapType jpaEmbeddableTypes; + @XmlAttribute(name = "name", required = true) + protected String name; - /** - * Gets the value of the edmSchemaNamespace property. - * - * @return possible object is {@link String } - * - */ - public String getEDMSchemaNamespace() { - return edmSchemaNamespace; - } + /** + * Gets the value of the edmSchemaNamespace property. + * + * @return possible object is {@link String } + * + */ + public String getEDMSchemaNamespace() { + return edmSchemaNamespace; + } - /** - * Sets the value of the edmSchemaNamespace property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMSchemaNamespace(final String value) { - edmSchemaNamespace = value; - } + /** + * Sets the value of the edmSchemaNamespace property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMSchemaNamespace(final String value) { + edmSchemaNamespace = value; + } - /** - * Gets the value of the jpaEntityTypes property. - * - * @return possible object is {@link JPAEntityTypesMapType } - * - */ - public JPAEntityTypesMapType getJPAEntityTypes() { - return jpaEntityTypes; - } + /** + * Gets the value of the jpaEntityTypes property. + * + * @return possible object is {@link JPAEntityTypesMapType } + * + */ + public JPAEntityTypesMapType getJPAEntityTypes() { + return jpaEntityTypes; + } - /** - * Sets the value of the jpaEntityTypes property. - * - * @param value - * allowed object is {@link JPAEntityTypesMapType } - * - */ - public void setJPAEntityTypes(final JPAEntityTypesMapType value) { - jpaEntityTypes = value; - } + /** + * Sets the value of the jpaEntityTypes property. + * + * @param value allowed object is {@link JPAEntityTypesMapType } + * + */ + public void setJPAEntityTypes(final JPAEntityTypesMapType value) { + jpaEntityTypes = value; + } - /** - * Gets the value of the jpaEmbeddableTypes property. - * - * @return possible object is {@link JPAEmbeddableTypesMapType } - * - */ - public JPAEmbeddableTypesMapType getJPAEmbeddableTypes() { - return jpaEmbeddableTypes; - } + /** + * Gets the value of the jpaEmbeddableTypes property. + * + * @return possible object is {@link JPAEmbeddableTypesMapType } + * + */ + public JPAEmbeddableTypesMapType getJPAEmbeddableTypes() { + return jpaEmbeddableTypes; + } - /** - * Sets the value of the jpaEmbeddableTypes property. - * - * @param value - * allowed object is {@link JPAEmbeddableTypesMapType } - * - */ - public void setJPAEmbeddableTypes(final JPAEmbeddableTypesMapType value) { - jpaEmbeddableTypes = value; - } + /** + * Sets the value of the jpaEmbeddableTypes property. + * + * @param value allowed object is {@link JPAEmbeddableTypesMapType } + * + */ + public void setJPAEmbeddableTypes(final JPAEmbeddableTypesMapType value) { + jpaEmbeddableTypes = value; + } - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return name; - } + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } - /** - * Sets the value of the name property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setName(final String value) { - name = value; - } + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java index 25a2f9569..50970877e 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java @@ -1,46 +1,40 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; import java.util.ArrayList; import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlValue; /** - * - * The default name for EDM navigation property is derived from JPA relationship - * name. This can be overriden using JPARelationshipMapType. - * - * + * + * The default name for EDM navigation property is derived from JPA relationship name. This can be + * overriden using JPARelationshipMapType. + * + * * * Java class for JPARelationshipMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPARelationshipMapType"> * <complexContent> @@ -60,116 +54,113 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPARelationshipMapType", propOrder = { "jpaRelationship" }) +@XmlType(name = "JPARelationshipMapType", propOrder = {"jpaRelationship"}) public class JPARelationshipMapType { - @XmlElement(name = "JPARelationship") - protected List jpaRelationship; - - /** - * Gets the value of the jpaRelationship property. - * - * - * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the jpaRelationship property. - * - * - * For example, to add a new item, do as follows: - * - * - * getJPARelationship().add(newItem); - * - * - * - * - * Objects of the following type(s) are allowed in the list {@link JPARelationshipMapType.JPARelationship } - * - * - */ - public List getJPARelationship() { - if (jpaRelationship == null) { - jpaRelationship = new ArrayList(); - } - return jpaRelationship; - } - - /** - * - * Java class for anonymous complex type. - * - * - * The following schema fragment specifies the expected content contained - * within this class. - * - * - * <complexType> - * <simpleContent> - * <extension base="<http://www.w3.org/2001/XMLSchema>string"> - * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * </extension> - * </simpleContent> - * </complexType> - * - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { "value" }) - public static class JPARelationship { - - @XmlValue - protected String value; - @XmlAttribute(name = "name", required = true) - protected String name; + @XmlElement(name = "JPARelationship") + protected List jpaRelationship; /** - * Gets the value of the value property. + * Gets the value of the jpaRelationship property. * - * @return possible object is {@link String } + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaRelationship property. * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. + * + * For example, to add a new item, do as follows: * - * @param value - * allowed object is {@link String } + * + * getJPARelationship().add(newItem); + * * - */ - public void setValue(final String value) { - this.value = value; - } - - /** - * Gets the value of the name property. * - * @return possible object is {@link String } + * + * Objects of the following type(s) are allowed in the list + * {@link JPARelationshipMapType.JPARelationship } + * * */ - public String getName() { - return name; + public List getJPARelationship() { + if (jpaRelationship == null) { + jpaRelationship = new ArrayList(); + } + return jpaRelationship; } /** - * Sets the value of the name property. + * + * Java class for anonymous complex type. + * + * + * The following schema fragment specifies the expected content contained within this class. + * + * + * <complexType> + * <simpleContent> + * <extension base="<http://www.w3.org/2001/XMLSchema>string"> + * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * </extension> + * </simpleContent> + * </complexType> + * * - * @param value - * allowed object is {@link String } * */ - public void setName(final String value) { - name = value; - } + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"value"}) + public static class JPARelationship { + + @XmlValue + protected String value; + @XmlAttribute(name = "name", required = true) + protected String name; - } + /** + * Gets the value of the value property. + * + * @return possible object is {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value allowed object is {@link String } + * + */ + public void setValue(final String value) { + this.value = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } + + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java index 45a7c3f9b..ed06d3832 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java @@ -1,28 +1,24 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ /** - * OData JPA Processor API Library - Mapping Model - * The JPA EDM Mapping model (XML document) is represented as JAXB annotated Java Classes. - * - * + * OData JPA Processor API Library - Mapping Model The JPA EDM Mapping model (XML document) + * is represented as JAXB annotated Java Classes. + * + * */ -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping", - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +@jakarta.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping", + elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED) package org.apache.olingo.odata2.jpa.processor.api.model.mapping; diff --git a/odata2-jpa-processor/jpa-core/pom.xml b/odata2-jpa-processor/jpa-core/pom.xml index c8eb662a5..2c09c1faa 100644 --- a/odata2-jpa-processor/jpa-core/pom.xml +++ b/odata2-jpa-processor/jpa-core/pom.xml @@ -24,7 +24,7 @@ org.apache.olingo olingo-odata2-jpa-processor - 2.0.13 + 3.0.0-SNAPSHOT ../ @@ -68,10 +68,9 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 - 1.6 - 1.6 + 17 + 17 @@ -88,9 +87,8 @@ - org.eclipse.persistence - javax.persistence - ${version.javax.persistence} + jakarta.persistence + jakarta.persistence-api @@ -122,14 +120,13 @@ junit junit - 4.9 test - org.easymock - easymock - 3.1 - test + org.easymock + easymock + 5.2.0 + test @@ -138,7 +135,6 @@ org.slf4j slf4j-api - 1.7.2 test diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/ODataJPAContextImpl.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/ODataJPAContextImpl.java index 075d0a1c7..2d40bccd9 100644 --- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/ODataJPAContextImpl.java +++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/ODataJPAContextImpl.java @@ -18,8 +18,8 @@ ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.core; -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; +import jakarta.persistence.EntityManager; +import jakarta.persistence.EntityManagerFactory; import org.apache.olingo.odata2.api.edm.provider.EdmProvider; import org.apache.olingo.odata2.api.processor.ODataContext; diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/ODataJPATransactionLocalDefault.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/ODataJPATransactionLocalDefault.java index 532764c6a..fc032e101 100644 --- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/ODataJPATransactionLocalDefault.java +++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/ODataJPATransactionLocalDefault.java @@ -20,8 +20,8 @@ import org.apache.olingo.odata2.jpa.processor.api.ODataJPATransaction; -import javax.persistence.EntityManager; -import javax.persistence.EntityTransaction; +import jakarta.persistence.EntityManager; +import jakarta.persistence.EntityTransaction; public class ODataJPATransactionLocalDefault implements ODataJPATransaction { diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntity.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntity.java index a3f5495c6..3db5ab5b7 100644 --- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntity.java +++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntity.java @@ -1,20 +1,16 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.core.access.data; @@ -32,10 +28,6 @@ import java.util.List; import java.util.Map; import java.util.Set; - -import javax.xml.bind.annotation.adapters.XmlAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - import org.apache.olingo.odata2.api.edm.EdmEntitySet; import org.apache.olingo.odata2.api.edm.EdmEntityType; import org.apache.olingo.odata2.api.edm.EdmException; @@ -43,9 +35,9 @@ import org.apache.olingo.odata2.api.edm.EdmProperty; import org.apache.olingo.odata2.api.edm.EdmSimpleType; import org.apache.olingo.odata2.api.edm.EdmStructuralType; +import org.apache.olingo.odata2.api.edm.EdmType; import org.apache.olingo.odata2.api.edm.EdmTypeKind; import org.apache.olingo.odata2.api.edm.EdmTyped; -import org.apache.olingo.odata2.api.edm.EdmType; import org.apache.olingo.odata2.api.ep.entry.EntryMetadata; import org.apache.olingo.odata2.api.ep.entry.ODataEntry; import org.apache.olingo.odata2.api.ep.feed.ODataFeed; @@ -55,511 +47,487 @@ import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException; import org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmMapping; import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmMappingImpl; +import jakarta.xml.bind.annotation.adapters.XmlAdapter; +import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter; public class JPAEntity { - private Object jpaEntity = null; - private JPAEntity parentJPAEntity = null; - private EdmEntityType oDataEntityType = null; - private EdmEntitySet oDataEntitySet = null; - private Class> jpaType = null; - private HashMap accessModifiersWrite = null; - private JPAEntityParser jpaEntityParser = null; - private ODataJPAContext oDataJPAContext; - private OnJPAWriteContent onJPAWriteContent = null; - private List relatedJPAEntityLink = new ArrayList(); - private HashMap> relatedJPAEntityMap = null; - private EdmNavigationProperty viaNavigationProperty; - - public JPAEntity(final EdmEntityType oDataEntityType, final EdmEntitySet oDataEntitySet, - final ODataJPAContext context) { - this.oDataEntityType = oDataEntityType; - this.oDataEntitySet = oDataEntitySet; - oDataJPAContext = context; - try { - JPAEdmMapping mapping = (JPAEdmMapping) oDataEntityType.getMapping(); - jpaType = mapping.getJPAType(); - } catch (EdmException e) { - return; + private Object jpaEntity = null; + private JPAEntity parentJPAEntity = null; + private EdmEntityType oDataEntityType = null; + private EdmEntitySet oDataEntitySet = null; + private Class> jpaType = null; + private HashMap accessModifiersWrite = null; + private JPAEntityParser jpaEntityParser = null; + private ODataJPAContext oDataJPAContext; + private OnJPAWriteContent onJPAWriteContent = null; + private final List relatedJPAEntityLink = new ArrayList(); + private HashMap> relatedJPAEntityMap = null; + private EdmNavigationProperty viaNavigationProperty; + + public JPAEntity(final EdmEntityType oDataEntityType, final EdmEntitySet oDataEntitySet, final ODataJPAContext context) { + this.oDataEntityType = oDataEntityType; + this.oDataEntitySet = oDataEntitySet; + oDataJPAContext = context; + try { + JPAEdmMapping mapping = (JPAEdmMapping) oDataEntityType.getMapping(); + jpaType = mapping.getJPAType(); + } catch (EdmException e) { + return; + } + jpaEntityParser = new JPAEntityParser(); + onJPAWriteContent = oDataJPAContext.getODataContext() + .getServiceFactory() + .getCallback(OnJPAWriteContent.class); + } + + public void setAccessModifersWrite(final HashMap accessModifiersWrite) { + this.accessModifiersWrite = accessModifiersWrite; } - jpaEntityParser = new JPAEntityParser(); - onJPAWriteContent = oDataJPAContext.getODataContext().getServiceFactory().getCallback(OnJPAWriteContent.class); - } - public void setAccessModifersWrite(final HashMap accessModifiersWrite) { - this.accessModifiersWrite = accessModifiersWrite; - } + public void setParentJPAEntity(final JPAEntity jpaEntity) { + parentJPAEntity = jpaEntity; + } - public void setParentJPAEntity(final JPAEntity jpaEntity) { - parentJPAEntity = jpaEntity; - } + public JPAEntity getParentJPAEntity() { + return parentJPAEntity; + } - public JPAEntity getParentJPAEntity() { - return parentJPAEntity; - } + public Object getJPAEntity() { + return jpaEntity; + } - public Object getJPAEntity() { - return jpaEntity; - } + public void setViaNavigationProperty(EdmNavigationProperty viaNavigationProperty) { + this.viaNavigationProperty = viaNavigationProperty; + } - public void setViaNavigationProperty(EdmNavigationProperty viaNavigationProperty) { - this.viaNavigationProperty = viaNavigationProperty; - } + public EdmNavigationProperty getViaNavigationProperty() { + return viaNavigationProperty; + } - public EdmNavigationProperty getViaNavigationProperty() { - return viaNavigationProperty; - } + public void create(final ODataEntry oDataEntry) throws ODataJPARuntimeException { - public void create(final ODataEntry oDataEntry) throws ODataJPARuntimeException { + if (oDataEntry == null) { + throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL, null); + } + try { + EntryMetadata entryMetadata = oDataEntry.getMetadata(); + Map oDataEntryProperties = oDataEntry.getProperties(); + if (oDataEntry.containsInlineEntry()) { + normalizeInlineEntries(oDataEntryProperties); + } - if (oDataEntry == null) { - throw ODataJPARuntimeException - .throwException(ODataJPARuntimeException.GENERAL, null); + if (oDataEntry.getProperties() + .size() > 0) { + + write(oDataEntryProperties, true); + + for (String navigationPropertyName : oDataEntityType.getNavigationPropertyNames()) { + EdmNavigationProperty navProperty = (EdmNavigationProperty) oDataEntityType.getProperty(navigationPropertyName); + if (relatedJPAEntityMap != null && relatedJPAEntityMap.containsKey(navigationPropertyName)) { + oDataEntry.getProperties() + .get(navigationPropertyName); + JPALink.linkJPAEntities(relatedJPAEntityMap.get(navigationPropertyName), jpaEntity, navProperty); + continue; + } + // The second condition is required to ensure that there is an explicit request to link + // two entities. Else the third condition will always be true for cases where two navigations + // point to same entity types. + if (parentJPAEntity != null && navProperty.getRelationship() + .equals(getViaNavigationProperty().getRelationship())) { + List targetJPAEntities = new ArrayList(); + targetJPAEntities.add(parentJPAEntity.getJPAEntity()); + JPALink.linkJPAEntities(targetJPAEntities, jpaEntity, navProperty); + } else if (!entryMetadata.getAssociationUris(navigationPropertyName) + .isEmpty()) { + if (!relatedJPAEntityLink.contains(navigationPropertyName)) { + relatedJPAEntityLink.add(navigationPropertyName); + } + } + } + } + if (!relatedJPAEntityLink.isEmpty()) { + JPALink link = new JPALink(oDataJPAContext); + link.setSourceJPAEntity(jpaEntity); + link.create(oDataEntitySet, oDataEntry, relatedJPAEntityLink); + } + } catch (EdmException | ODataJPAModelException e) { + throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()), e); + } } - try { - EntryMetadata entryMetadata = oDataEntry.getMetadata(); - Map oDataEntryProperties = oDataEntry.getProperties(); - if (oDataEntry.containsInlineEntry()) { - normalizeInlineEntries(oDataEntryProperties); - } - if (oDataEntry.getProperties().size() > 0) { + public EdmEntitySet getEdmEntitySet() { + return oDataEntitySet; + } + public void create(final Map oDataEntryProperties) throws ODataJPARuntimeException { + normalizeInlineEntries(oDataEntryProperties); write(oDataEntryProperties, true); + } - for (String navigationPropertyName : oDataEntityType.getNavigationPropertyNames()) { - EdmNavigationProperty navProperty = - (EdmNavigationProperty) oDataEntityType.getProperty(navigationPropertyName); - if (relatedJPAEntityMap != null && relatedJPAEntityMap.containsKey(navigationPropertyName)) { - oDataEntry.getProperties().get(navigationPropertyName); - JPALink.linkJPAEntities(relatedJPAEntityMap.get(navigationPropertyName), jpaEntity, - navProperty); - continue; - } - // The second condition is required to ensure that there is an explicit request to link - // two entities. Else the third condition will always be true for cases where two navigations - // point to same entity types. - if (parentJPAEntity != null - && navProperty.getRelationship().equals(getViaNavigationProperty().getRelationship())) { - List targetJPAEntities = new ArrayList(); - targetJPAEntities.add(parentJPAEntity.getJPAEntity()); - JPALink.linkJPAEntities(targetJPAEntities, jpaEntity, navProperty); - } else if (!entryMetadata.getAssociationUris(navigationPropertyName).isEmpty()) { - if (!relatedJPAEntityLink.contains(navigationPropertyName)) { - relatedJPAEntityLink.add(navigationPropertyName); - } - } + public void update(final ODataEntry oDataEntry) throws ODataJPARuntimeException { + if (oDataEntry == null) { + throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL, null); } - } - if (!relatedJPAEntityLink.isEmpty()) { + Map oDataEntryProperties = oDataEntry.getProperties(); + if (oDataEntry.containsInlineEntry()) { + normalizeInlineEntries(oDataEntryProperties); + } + write(oDataEntryProperties, false); JPALink link = new JPALink(oDataJPAContext); link.setSourceJPAEntity(jpaEntity); - link.create(oDataEntitySet, oDataEntry, relatedJPAEntityLink); - } - } catch (EdmException e) { - throw ODataJPARuntimeException - .throwException(ODataJPARuntimeException.GENERAL - .addContent(e.getMessage()), e); - } catch (ODataJPAModelException e) { - throw ODataJPARuntimeException - .throwException(ODataJPARuntimeException.GENERAL - .addContent(e.getMessage()), e); + try { + link.create(oDataEntitySet, oDataEntry, oDataEntityType.getNavigationPropertyNames()); + } catch (EdmException | ODataJPAModelException e) { + throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()), e); + } } - } - public EdmEntitySet getEdmEntitySet() { - return oDataEntitySet; - } - - public void create(final Map oDataEntryProperties) throws ODataJPARuntimeException { - normalizeInlineEntries(oDataEntryProperties); - write(oDataEntryProperties, true); - } - - public void update(final ODataEntry oDataEntry) throws ODataJPARuntimeException { - if (oDataEntry == null) { - throw ODataJPARuntimeException - .throwException(ODataJPARuntimeException.GENERAL, null); - } - Map oDataEntryProperties = oDataEntry.getProperties(); - if (oDataEntry.containsInlineEntry()) { - normalizeInlineEntries(oDataEntryProperties); + public void update(final Map oDataEntryProperties) throws ODataJPARuntimeException { + normalizeInlineEntries(oDataEntryProperties); + write(oDataEntryProperties, false); } - write(oDataEntryProperties, false); - JPALink link = new JPALink(oDataJPAContext); - link.setSourceJPAEntity(jpaEntity); - try { - link.create(oDataEntitySet, oDataEntry, oDataEntityType.getNavigationPropertyNames()); - } catch (EdmException e) { - throw ODataJPARuntimeException - .throwException(ODataJPARuntimeException.GENERAL - .addContent(e.getMessage()), e); - } catch (ODataJPAModelException e) { - throw ODataJPARuntimeException - .throwException(ODataJPARuntimeException.GENERAL - .addContent(e.getMessage()), e); + + public void setJPAEntity(final Object jpaEntity) { + this.jpaEntity = jpaEntity; } - } - - public void update(final Map oDataEntryProperties) throws ODataJPARuntimeException { - normalizeInlineEntries(oDataEntryProperties); - write(oDataEntryProperties, false); - } - - public void setJPAEntity(final Object jpaEntity) { - this.jpaEntity = jpaEntity; - } - - protected void setComplexProperty(Method accessModifier, final Object jpaEntity, - final EdmStructuralType edmComplexType, final HashMap propertyValue) - throws EdmException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, - InstantiationException, ODataJPARuntimeException, NoSuchMethodException, SecurityException, SQLException { - - setComplexProperty(accessModifier, jpaEntity, edmComplexType, propertyValue, null); - } - - protected void setProperty(final Method method, final Object entity, final Object entityPropertyValue, - final EdmSimpleType type, boolean isNullable) throws - IllegalAccessException, IllegalArgumentException, InvocationTargetException, ODataJPARuntimeException, - EdmException { - - setProperty(method, entity, entityPropertyValue, type, null, isNullable); - } - - protected void setEmbeddableKeyProperty(final HashMap embeddableKeys, - final List oDataEntryKeyProperties, - final Map oDataEntryProperties, final Object entity) - throws ODataJPARuntimeException, EdmException, IllegalAccessException, IllegalArgumentException, - InvocationTargetException, InstantiationException { - - HashMap embeddableObjMap = new HashMap(); - List leftODataEntryKeyProperties = new ArrayList(); - HashMap leftEmbeddableKeys = new HashMap(); - - for (EdmProperty edmProperty : oDataEntryKeyProperties) { - if (oDataEntryProperties.containsKey(edmProperty.getName()) == false) { - continue; - } - - String edmPropertyName = edmProperty.getName(); - String embeddableKeyNameComposite = embeddableKeys.get(edmPropertyName); - if (embeddableKeyNameComposite == null) { - continue; - } - String embeddableKeyNameSplit[] = embeddableKeyNameComposite.split("\\."); - String methodPartName = null; - Method method = null; - Object embeddableObj = null; - - if (embeddableObjMap.containsKey(embeddableKeyNameSplit[0]) == false) { - methodPartName = embeddableKeyNameSplit[0]; - method = jpaEntityParser.getAccessModifierSet(entity, methodPartName); - embeddableObj = method.getParameterTypes()[0].newInstance(); - method.invoke(entity, embeddableObj); - embeddableObjMap.put(embeddableKeyNameSplit[0], embeddableObj); - } else { - embeddableObj = embeddableObjMap.get(embeddableKeyNameSplit[0]); - } - - if (embeddableKeyNameSplit.length == 2) { - methodPartName = embeddableKeyNameSplit[1]; - method = jpaEntityParser.getAccessModifierSet(embeddableObj, methodPartName); - Object simpleObj = oDataEntryProperties.get(edmProperty.getName()); - method.invoke(embeddableObj, simpleObj); - } else if (embeddableKeyNameSplit.length > 2) { // Deeply nested - leftODataEntryKeyProperties.add(edmProperty); - leftEmbeddableKeys - .put(edmPropertyName, embeddableKeyNameComposite.split(embeddableKeyNameSplit[0] + ".", 2)[1]); - } + + protected void setComplexProperty(Method accessModifier, final Object jpaEntity, final EdmStructuralType edmComplexType, + final HashMap propertyValue) + throws EdmException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, + ODataJPARuntimeException, NoSuchMethodException, SecurityException, SQLException { + + setComplexProperty(accessModifier, jpaEntity, edmComplexType, propertyValue, null); } - } - protected Object instantiateJPAEntity() throws InstantiationException, IllegalAccessException { - if (jpaType == null) { - throw new InstantiationException(); + protected void setProperty(final Method method, final Object entity, final Object entityPropertyValue, final EdmSimpleType type, + boolean isNullable) + throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, ODataJPARuntimeException, EdmException { + + setProperty(method, entity, entityPropertyValue, type, null, isNullable); } - return jpaType.newInstance(); - } - - private void normalizeInlineEntries(final Map oDataEntryProperties) throws ODataJPARuntimeException { - List entries = null; - try { - for (String navigationPropertyName : oDataEntityType.getNavigationPropertyNames()) { - Object inline = oDataEntryProperties.get(navigationPropertyName); - if (inline instanceof ODataFeed) { - entries = ((ODataFeed) inline).getEntries(); - } else if (inline instanceof ODataEntry) { - entries = new ArrayList(); - entries.add((ODataEntry) inline); - } - if (entries != null) { - oDataEntryProperties.put(navigationPropertyName, entries); - entries = null; + protected void setEmbeddableKeyProperty(final HashMap embeddableKeys, final List oDataEntryKeyProperties, + final Map oDataEntryProperties, final Object entity) throws ODataJPARuntimeException, EdmException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException { + + HashMap embeddableObjMap = new HashMap(); + List leftODataEntryKeyProperties = new ArrayList(); + HashMap leftEmbeddableKeys = new HashMap(); + + for (EdmProperty edmProperty : oDataEntryKeyProperties) { + if (!oDataEntryProperties.containsKey(edmProperty.getName())) { + continue; + } + + String edmPropertyName = edmProperty.getName(); + String embeddableKeyNameComposite = embeddableKeys.get(edmPropertyName); + if (embeddableKeyNameComposite == null) { + continue; + } + String embeddableKeyNameSplit[] = embeddableKeyNameComposite.split("\\."); + String methodPartName = null; + Method method = null; + Object embeddableObj = null; + + if (!embeddableObjMap.containsKey(embeddableKeyNameSplit[0])) { + methodPartName = embeddableKeyNameSplit[0]; + method = jpaEntityParser.getAccessModifierSet(entity, methodPartName); + embeddableObj = method.getParameterTypes()[0].newInstance(); + method.invoke(entity, embeddableObj); + embeddableObjMap.put(embeddableKeyNameSplit[0], embeddableObj); + } else { + embeddableObj = embeddableObjMap.get(embeddableKeyNameSplit[0]); + } + + if (embeddableKeyNameSplit.length == 2) { + methodPartName = embeddableKeyNameSplit[1]; + method = jpaEntityParser.getAccessModifierSet(embeddableObj, methodPartName); + Object simpleObj = oDataEntryProperties.get(edmProperty.getName()); + method.invoke(embeddableObj, simpleObj); + } else if (embeddableKeyNameSplit.length > 2) { // Deeply nested + leftODataEntryKeyProperties.add(edmProperty); + leftEmbeddableKeys.put(edmPropertyName, embeddableKeyNameComposite.split(embeddableKeyNameSplit[0] + ".", 2)[1]); + } } - } - } catch (EdmException e) { - throw ODataJPARuntimeException - .throwException(ODataJPARuntimeException.GENERAL - .addContent(e.getMessage()), e); } - } - - @SuppressWarnings("unchecked") - private void write(final Map oDataEntryProperties, - final boolean isCreate) - throws ODataJPARuntimeException { - try { - - EdmStructuralType structuralType = null; - final List keyNames = oDataEntityType.getKeyPropertyNames(); - - if (isCreate) { - jpaEntity = instantiateJPAEntity(); - } else if (jpaEntity == null) { - throw ODataJPARuntimeException - .throwException(ODataJPARuntimeException.RESOURCE_NOT_FOUND, null); - } - - if (accessModifiersWrite == null) { - accessModifiersWrite = - jpaEntityParser.getAccessModifiers(jpaEntity, oDataEntityType, JPAEntityParser.ACCESS_MODIFIER_SET); - } - - if (oDataEntityType == null || oDataEntryProperties == null) { - throw ODataJPARuntimeException - .throwException(ODataJPARuntimeException.GENERAL, null); - } - - final HashMap embeddableKeys = - jpaEntityParser.getJPAEmbeddableKeyMap(jpaEntity.getClass().getName()); - Set propertyNames = null; - if (embeddableKeys != null) { - setEmbeddableKeyProperty(embeddableKeys, oDataEntityType.getKeyProperties(), oDataEntryProperties, - jpaEntity); - - propertyNames = new HashSet(); - propertyNames.addAll(oDataEntryProperties.keySet()); - for (String key : embeddableKeys.keySet()) { - propertyNames.remove(key); + + protected Object instantiateJPAEntity() throws InstantiationException, IllegalAccessException { + if (jpaType == null) { + throw new InstantiationException(); } - } else { - propertyNames = oDataEntryProperties.keySet(); - } - - boolean isVirtual = false; - for (String propertyName : propertyNames) { - EdmTyped edmTyped = (EdmTyped) oDataEntityType.getProperty(propertyName); - if (edmTyped instanceof EdmProperty) { - isVirtual = ((JPAEdmMappingImpl)((EdmProperty) edmTyped).getMapping()).isVirtualAccess(); - } else { - isVirtual = false; + + return jpaType.newInstance(); + } + + private void normalizeInlineEntries(final Map oDataEntryProperties) throws ODataJPARuntimeException { + List entries = null; + try { + for (String navigationPropertyName : oDataEntityType.getNavigationPropertyNames()) { + Object inline = oDataEntryProperties.get(navigationPropertyName); + if (inline instanceof ODataFeed) { + entries = ((ODataFeed) inline).getEntries(); + } else if (inline instanceof ODataEntry) { + entries = new ArrayList(); + entries.add((ODataEntry) inline); + } + if (entries != null) { + oDataEntryProperties.put(navigationPropertyName, entries); + entries = null; + } + } + } catch (EdmException e) { + throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()), e); } - Method accessModifier = null; + } + + @SuppressWarnings("unchecked") + private void write(final Map oDataEntryProperties, final boolean isCreate) throws ODataJPARuntimeException { + try { - switch (edmTyped.getType().getKind()) { - case SIMPLE: - if (isCreate == false) { - if (keyNames.contains(edmTyped.getName())) { - continue; + EdmStructuralType structuralType = null; + final List keyNames = oDataEntityType.getKeyPropertyNames(); + + if (isCreate) { + jpaEntity = instantiateJPAEntity(); + } else if (jpaEntity == null) { + throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.RESOURCE_NOT_FOUND, null); } - } - accessModifier = accessModifiersWrite.get(propertyName); - EdmProperty edmProperty = (EdmProperty)oDataEntityType.getProperty(propertyName); - boolean isNullable = edmProperty.getFacets() == null ? (keyNames.contains(propertyName)? false : true) - : edmProperty.getFacets().isNullable() == null ? true : edmProperty.getFacets().isNullable(); - if (isVirtual) { - setProperty(accessModifier, jpaEntity, oDataEntryProperties.get(propertyName), (EdmSimpleType) edmTyped - .getType(), isNullable); - } else { - setProperty(accessModifier, jpaEntity, oDataEntryProperties.get(propertyName), (EdmSimpleType) edmTyped - .getType(), isNullable); - } - break; - case COMPLEX: - structuralType = (EdmStructuralType) edmTyped.getType(); - accessModifier = accessModifiersWrite.get(propertyName); - if (isVirtual) { - setComplexProperty(accessModifier, jpaEntity, - structuralType, - (HashMap) oDataEntryProperties.get(propertyName), propertyName); - } else { - setComplexProperty(accessModifier, jpaEntity, - structuralType, - (HashMap) oDataEntryProperties.get(propertyName)); - } - break; - case NAVIGATION: - case ENTITY: - if (isCreate) { - structuralType = (EdmStructuralType) edmTyped.getType(); - EdmNavigationProperty navProperty = (EdmNavigationProperty) edmTyped; - EdmEntitySet edmRelatedEntitySet = oDataEntitySet.getRelatedEntitySet(navProperty); - List relatedEntries = (List) oDataEntryProperties.get(propertyName); - if (relatedJPAEntityMap == null) { - relatedJPAEntityMap = new HashMap>(); + + if (accessModifiersWrite == null) { + accessModifiersWrite = jpaEntityParser.getAccessModifiers(jpaEntity, oDataEntityType, JPAEntityParser.ACCESS_MODIFIER_SET); + } + + if (oDataEntityType == null || oDataEntryProperties == null) { + throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL, null); + } + + final HashMap embeddableKeys = jpaEntityParser.getJPAEmbeddableKeyMap(jpaEntity.getClass() + .getName()); + Set propertyNames = null; + if (embeddableKeys != null) { + setEmbeddableKeyProperty(embeddableKeys, oDataEntityType.getKeyProperties(), oDataEntryProperties, jpaEntity); + + propertyNames = new HashSet(); + propertyNames.addAll(oDataEntryProperties.keySet()); + for (String key : embeddableKeys.keySet()) { + propertyNames.remove(key); + } + } else { + propertyNames = oDataEntryProperties.keySet(); } - List relatedJPAEntities = new ArrayList(); - for (ODataEntry oDataEntry : relatedEntries) { - JPAEntity relatedEntity = - new JPAEntity((EdmEntityType) structuralType, edmRelatedEntitySet, oDataJPAContext); - relatedEntity.setParentJPAEntity(this); - relatedEntity.setViaNavigationProperty(navProperty); - relatedEntity.create(oDataEntry); - if (oDataEntry.getProperties().size() == 0) { - if (!oDataEntry.getMetadata().getUri().isEmpty() - && !relatedJPAEntityLink.contains(navProperty.getName())) { - relatedJPAEntityLink.add(navProperty.getName()); + + boolean isVirtual = false; + for (String propertyName : propertyNames) { + EdmTyped edmTyped = oDataEntityType.getProperty(propertyName); + if (edmTyped instanceof EdmProperty) { + isVirtual = ((JPAEdmMappingImpl) ((EdmProperty) edmTyped).getMapping()).isVirtualAccess(); + } else { + isVirtual = false; + } + Method accessModifier = null; + + switch (edmTyped.getType() + .getKind()) { + case SIMPLE: + if (!isCreate) { + if (keyNames.contains(edmTyped.getName())) { + continue; + } + } + accessModifier = accessModifiersWrite.get(propertyName); + EdmProperty edmProperty = (EdmProperty) oDataEntityType.getProperty(propertyName); + boolean isNullable = edmProperty.getFacets() == null ? (keyNames.contains(propertyName) ? false : true) + : edmProperty.getFacets() + .isNullable() == null ? true + : edmProperty.getFacets() + .isNullable(); + if (isVirtual) { + setProperty(accessModifier, jpaEntity, oDataEntryProperties.get(propertyName), + (EdmSimpleType) edmTyped.getType(), isNullable); + } else { + setProperty(accessModifier, jpaEntity, oDataEntryProperties.get(propertyName), + (EdmSimpleType) edmTyped.getType(), isNullable); + } + break; + case COMPLEX: + structuralType = (EdmStructuralType) edmTyped.getType(); + accessModifier = accessModifiersWrite.get(propertyName); + if (isVirtual) { + setComplexProperty(accessModifier, jpaEntity, structuralType, + (HashMap) oDataEntryProperties.get(propertyName), propertyName); + } else { + setComplexProperty(accessModifier, jpaEntity, structuralType, + (HashMap) oDataEntryProperties.get(propertyName)); + } + break; + case NAVIGATION: + case ENTITY: + if (isCreate) { + structuralType = (EdmStructuralType) edmTyped.getType(); + EdmNavigationProperty navProperty = (EdmNavigationProperty) edmTyped; + EdmEntitySet edmRelatedEntitySet = oDataEntitySet.getRelatedEntitySet(navProperty); + List relatedEntries = (List) oDataEntryProperties.get(propertyName); + if (relatedJPAEntityMap == null) { + relatedJPAEntityMap = new HashMap>(); + } + List relatedJPAEntities = new ArrayList(); + for (ODataEntry oDataEntry : relatedEntries) { + JPAEntity relatedEntity = + new JPAEntity((EdmEntityType) structuralType, edmRelatedEntitySet, oDataJPAContext); + relatedEntity.setParentJPAEntity(this); + relatedEntity.setViaNavigationProperty(navProperty); + relatedEntity.create(oDataEntry); + if (oDataEntry.getProperties() + .size() == 0) { + if (!oDataEntry.getMetadata() + .getUri() + .isEmpty() + && !relatedJPAEntityLink.contains(navProperty.getName())) { + relatedJPAEntityLink.add(navProperty.getName()); + } + } else { + relatedJPAEntities.add(relatedEntity.getJPAEntity()); + } + } + if (!relatedJPAEntities.isEmpty()) { + relatedJPAEntityMap.put(navProperty.getName(), relatedJPAEntities); + } + } + default: } - } else { - relatedJPAEntities.add(relatedEntity.getJPAEntity()); - } } - if (!relatedJPAEntities.isEmpty()) { - relatedJPAEntityMap.put(navProperty.getName(), relatedJPAEntities); + } catch (Exception e) { + if (e instanceof ODataJPARuntimeException) { + throw (ODataJPARuntimeException) e; } - } - default: - continue; + throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()), e); } - } - } catch (Exception e) { - if (e instanceof ODataJPARuntimeException) { - throw (ODataJPARuntimeException) e; - } - throw ODataJPARuntimeException - .throwException(ODataJPARuntimeException.GENERAL - .addContent(e.getMessage()), e); - } - } - - @SuppressWarnings("unchecked") - protected void setComplexProperty(Method accessModifier, final Object jpaEntity, - final EdmStructuralType edmComplexType, final HashMap propertyValue, String propertyName) - throws EdmException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, - InstantiationException, ODataJPARuntimeException, NoSuchMethodException, SecurityException, SQLException { - - JPAEdmMapping mapping = (JPAEdmMapping) edmComplexType.getMapping(); - Object embeddableObject = mapping.getJPAType().newInstance(); - if (propertyName != null) { - accessModifier.invoke(jpaEntity, propertyName, embeddableObject); - } else { - accessModifier.invoke(jpaEntity, embeddableObject); } - HashMap accessModifiers = - jpaEntityParser.getAccessModifiers(embeddableObject, edmComplexType, - JPAEntityParser.ACCESS_MODIFIER_SET); - - for (String edmPropertyName : edmComplexType.getPropertyNames()) { - if (propertyValue != null) { - EdmTyped edmTyped = edmComplexType.getProperty(edmPropertyName); - accessModifier = accessModifiers.get(edmPropertyName); - EdmType type = edmTyped.getType(); - if (type.getKind().toString().equals(EdmTypeKind.COMPLEX.toString())) { - setComplexProperty(accessModifier, embeddableObject, (EdmStructuralType) type, - (HashMap) propertyValue.get(edmPropertyName), propertyName); + @SuppressWarnings("unchecked") + protected void setComplexProperty(Method accessModifier, final Object jpaEntity, final EdmStructuralType edmComplexType, + final HashMap propertyValue, String propertyName) + throws EdmException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, + ODataJPARuntimeException, NoSuchMethodException, SecurityException, SQLException { + + JPAEdmMapping mapping = (JPAEdmMapping) edmComplexType.getMapping(); + Object embeddableObject = mapping.getJPAType() + .newInstance(); + if (propertyName != null) { + accessModifier.invoke(jpaEntity, propertyName, embeddableObject); } else { - EdmSimpleType simpleType = (EdmSimpleType) type; - EdmProperty edmProperty = (EdmProperty)edmComplexType.getProperty(edmPropertyName); - boolean isNullable = edmProperty.getFacets() == null ? true - : edmProperty.getFacets().isNullable() == null ? true : edmProperty.getFacets().isNullable(); - if (propertyName != null) { - setProperty(accessModifier, embeddableObject, propertyValue.get(edmPropertyName), - simpleType, isNullable); - } else { - setProperty(accessModifier, embeddableObject, propertyValue.get(edmPropertyName), - simpleType, isNullable); - } + accessModifier.invoke(jpaEntity, embeddableObject); } - } - } - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - protected void setProperty(final Method method, final Object entity, final Object entityPropertyValue, - final EdmSimpleType type, String propertyName, boolean isNullable) throws - IllegalAccessException, IllegalArgumentException, InvocationTargetException, ODataJPARuntimeException, - EdmException { - if (entityPropertyValue != null || isNullable) { - if (propertyName != null) { - method.invoke(entity, propertyName, entityPropertyValue); - return; - } - Class> parameterType = method.getParameterTypes()[0]; - if (type != null && type.getDefaultType().equals(String.class)) { - if (parameterType.equals(String.class)) { - method.invoke(entity, entityPropertyValue); - } else if (parameterType.equals(char[].class)) { - char[] characters = entityPropertyValue != null ? ((String) entityPropertyValue).toCharArray() : null; - method.invoke(entity, characters); - } else if (parameterType.equals(char.class)) { - char c = entityPropertyValue != null ? ((String) entityPropertyValue).charAt(0) : '\u0000'; - method.invoke(entity, c); - } else if (parameterType.equals(Character[].class)) { - Character[] characters = entityPropertyValue != null ? - JPAEntityParser.toCharacterArray((String) entityPropertyValue) : null; - method.invoke(entity, (Object) characters); - } else if (parameterType.equals(Character.class)) { - Character c = entityPropertyValue != null ? - Character.valueOf(((String) entityPropertyValue).charAt(0)) : null; - method.invoke(entity, c); - } else if (parameterType.isEnum()) { - Enum e = entityPropertyValue != null ? - Enum.valueOf((Class) parameterType, (String) entityPropertyValue) : null; - method.invoke(entity, e); - } else { - String setterName = method.getName(); - String getterName = setterName.replace("set", "get"); - try { - Method getMethod = entity.getClass().getDeclaredMethod(getterName); - if(getMethod.isAnnotationPresent(XmlJavaTypeAdapter.class)) { - XmlAdapter xmlAdapter = getMethod.getAnnotation(XmlJavaTypeAdapter.class) - .value().newInstance(); - method.invoke(entity, xmlAdapter.unmarshal(entityPropertyValue)); + + HashMap accessModifiers = + jpaEntityParser.getAccessModifiers(embeddableObject, edmComplexType, JPAEntityParser.ACCESS_MODIFIER_SET); + + for (String edmPropertyName : edmComplexType.getPropertyNames()) { + if (propertyValue != null) { + EdmTyped edmTyped = edmComplexType.getProperty(edmPropertyName); + accessModifier = accessModifiers.get(edmPropertyName); + EdmType type = edmTyped.getType(); + if (type.getKind() + .toString() + .equals(EdmTypeKind.COMPLEX.toString())) { + setComplexProperty(accessModifier, embeddableObject, (EdmStructuralType) type, + (HashMap) propertyValue.get(edmPropertyName), propertyName); + } else { + EdmSimpleType simpleType = (EdmSimpleType) type; + EdmProperty edmProperty = (EdmProperty) edmComplexType.getProperty(edmPropertyName); + boolean isNullable = edmProperty.getFacets() == null ? true + : edmProperty.getFacets() + .isNullable() == null ? true + : edmProperty.getFacets() + .isNullable(); + if (propertyName != null) { + setProperty(accessModifier, embeddableObject, propertyValue.get(edmPropertyName), simpleType, isNullable); + } else { + setProperty(accessModifier, embeddableObject, propertyValue.get(edmPropertyName), simpleType, isNullable); + } + } } - } catch (Exception e) { - throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL, e); - } } - } else if (parameterType.equals(Blob.class)) { - if (onJPAWriteContent == null) { - throw ODataJPARuntimeException - .throwException(ODataJPARuntimeException.ERROR_JPA_BLOB_NULL, null); - } else { - method.invoke(entity, entityPropertyValue != null ? - onJPAWriteContent.getJPABlob((byte[]) entityPropertyValue) : null); - } - } else if (parameterType.equals(Clob.class)) { - if (onJPAWriteContent == null) { - throw ODataJPARuntimeException - .throwException(ODataJPARuntimeException.ERROR_JPA_CLOB_NULL, null); - } else { - method.invoke(entity, entityPropertyValue != null ? - onJPAWriteContent.getJPAClob(((String) entityPropertyValue).toCharArray()) : null); + } + + @SuppressWarnings({"unchecked", "rawtypes"}) + protected void setProperty(final Method method, final Object entity, final Object entityPropertyValue, final EdmSimpleType type, + String propertyName, boolean isNullable) + throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, ODataJPARuntimeException, EdmException { + if (entityPropertyValue != null || isNullable) { + if (propertyName != null) { + method.invoke(entity, propertyName, entityPropertyValue); + return; + } + Class> parameterType = method.getParameterTypes()[0]; + if (type != null && type.getDefaultType() + .equals(String.class)) { + if (parameterType.equals(String.class)) { + method.invoke(entity, entityPropertyValue); + } else if (parameterType.equals(char[].class)) { + char[] characters = entityPropertyValue != null ? ((String) entityPropertyValue).toCharArray() : null; + method.invoke(entity, characters); + } else if (parameterType.equals(char.class)) { + char c = entityPropertyValue != null ? ((String) entityPropertyValue).charAt(0) : '\u0000'; + method.invoke(entity, c); + } else if (parameterType.equals(Character[].class)) { + Character[] characters = + entityPropertyValue != null ? JPAEntityParser.toCharacterArray((String) entityPropertyValue) : null; + method.invoke(entity, (Object) characters); + } else if (parameterType.equals(Character.class)) { + Character c = entityPropertyValue != null ? Character.valueOf(((String) entityPropertyValue).charAt(0)) : null; + method.invoke(entity, c); + } else if (parameterType.isEnum()) { + Enum e = entityPropertyValue != null ? Enum.valueOf((Class) parameterType, (String) entityPropertyValue) : null; + method.invoke(entity, e); + } else { + String setterName = method.getName(); + String getterName = setterName.replace("set", "get"); + try { + Method getMethod = entity.getClass() + .getDeclaredMethod(getterName); + if (getMethod.isAnnotationPresent(XmlJavaTypeAdapter.class)) { + XmlAdapter xmlAdapter = getMethod.getAnnotation(XmlJavaTypeAdapter.class) + .value() + .newInstance(); + method.invoke(entity, xmlAdapter.unmarshal(entityPropertyValue)); + } + } catch (Exception e) { + throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL, e); + } + } + } else if (parameterType.equals(Blob.class)) { + if (onJPAWriteContent == null) { + throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.ERROR_JPA_BLOB_NULL, null); + } + method.invoke(entity, entityPropertyValue != null ? onJPAWriteContent.getJPABlob((byte[]) entityPropertyValue) : null); + } else if (parameterType.equals(Clob.class)) { + if (onJPAWriteContent == null) { + throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.ERROR_JPA_CLOB_NULL, null); + } + method.invoke(entity, + entityPropertyValue != null ? onJPAWriteContent.getJPAClob(((String) entityPropertyValue).toCharArray()) : null); + } else if (parameterType.equals(Timestamp.class)) { + Timestamp ts = entityPropertyValue != null ? new Timestamp(((Calendar) entityPropertyValue).getTimeInMillis()) : null; + method.invoke(entity, ts); + } else if (parameterType.equals(java.util.Date.class)) { + Date d = entityPropertyValue != null ? ((Calendar) entityPropertyValue).getTime() : null; + method.invoke(entity, d); + } else if (parameterType.equals(java.sql.Date.class)) { + java.sql.Date d = + entityPropertyValue != null ? new java.sql.Date(((Calendar) entityPropertyValue).getTimeInMillis()) : null; + method.invoke(entity, d); + } else if (parameterType.equals(java.sql.Time.class)) { + java.sql.Time t = + entityPropertyValue != null ? new java.sql.Time(((Calendar) entityPropertyValue).getTimeInMillis()) : null; + method.invoke(entity, t); + } else if (parameterType.equals(byte.class)) { + byte b = entityPropertyValue != null ? Byte.parseByte(entityPropertyValue.toString()) : 0; + method.invoke(entity, b); + } else { + method.invoke(entity, entityPropertyValue); + } } - } else if (parameterType.equals(Timestamp.class)) { - Timestamp ts = entityPropertyValue != null ? - new Timestamp(((Calendar) entityPropertyValue).getTimeInMillis()) : null; - method.invoke(entity, ts); - } else if (parameterType.equals(java.util.Date.class)) { - Date d = entityPropertyValue != null ? ((Calendar) entityPropertyValue).getTime(): null; - method.invoke(entity, d); - } else if (parameterType.equals(java.sql.Date.class)) { - java.sql.Date d = entityPropertyValue != null ? - new java.sql.Date(((Calendar) entityPropertyValue).getTimeInMillis()) : null; - method.invoke(entity, d); - } else if (parameterType.equals(java.sql.Time.class)) { - java.sql.Time t = entityPropertyValue != null ? - new java.sql.Time(((Calendar) entityPropertyValue).getTimeInMillis()) : null; - method.invoke(entity, t); - } else if (parameterType.equals(byte.class)) { - byte b = entityPropertyValue != null ? - Byte.parseByte(entityPropertyValue.toString()) : 0; - method.invoke(entity, b); - } else { - method.invoke(entity, entityPropertyValue); - } } - } -} \ No newline at end of file +} diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPALink.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPALink.java index c8a439438..a657b9ebf 100644 --- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPALink.java +++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPALink.java @@ -26,7 +26,7 @@ import java.util.HashMap; import java.util.List; -import javax.persistence.EntityManager; +import jakarta.persistence.EntityManager; import org.apache.olingo.odata2.api.edm.EdmEntitySet; import org.apache.olingo.odata2.api.edm.EdmException; diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAPage.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAPage.java index 4f95e51e0..16ff82d3a 100644 --- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAPage.java +++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAPage.java @@ -21,7 +21,7 @@ import java.util.ArrayList; import java.util.List; -import javax.persistence.Query; +import jakarta.persistence.Query; import org.apache.olingo.odata2.jpa.processor.api.access.JPAPaging; diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAProcessorImpl.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAProcessorImpl.java index 2aaef0d68..d498ed08b 100644 --- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAProcessorImpl.java +++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAProcessorImpl.java @@ -25,9 +25,9 @@ import java.util.List; import java.util.Map; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceException; -import javax.persistence.Query; +import jakarta.persistence.EntityManager; +import jakarta.persistence.PersistenceException; +import jakarta.persistence.Query; import org.apache.olingo.odata2.api.commons.InlineCount; import org.apache.olingo.odata2.api.edm.EdmEntitySet; diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAQueryBuilder.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAQueryBuilder.java index 24290bf81..9dd2f6bc9 100644 --- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAQueryBuilder.java +++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAQueryBuilder.java @@ -29,11 +29,11 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.persistence.EntityManager; -import javax.persistence.Query; -import javax.persistence.TemporalType; -import javax.persistence.metamodel.Attribute; -import javax.persistence.metamodel.EntityType; +import jakarta.persistence.EntityManager; +import jakarta.persistence.Query; +import jakarta.persistence.TemporalType; +import jakarta.persistence.metamodel.Attribute; +import jakarta.persistence.metamodel.EntityType; import org.apache.olingo.odata2.api.edm.EdmException; import org.apache.olingo.odata2.api.uri.UriInfo; diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPAEdmMappingModelService.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPAEdmMappingModelService.java index 69153ec1f..adf260473 100644 --- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPAEdmMappingModelService.java +++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPAEdmMappingModelService.java @@ -1,31 +1,22 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.core.access.model; import java.io.IOException; import java.io.InputStream; import java.util.List; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; - import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; import org.apache.olingo.odata2.jpa.processor.api.access.JPAEdmMappingModelAccess; import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPAModelException; @@ -36,235 +27,251 @@ import org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEntityTypeMapType; import org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAPersistenceUnitMapType; import org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPARelationshipMapType.JPARelationship; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; +import jakarta.xml.bind.Unmarshaller; public class JPAEdmMappingModelService implements JPAEdmMappingModelAccess { - boolean mappingModelExists = true; - private JPAEdmMappingModel mappingModel; - private InputStream mappingModelStream = null; - private String mappingModelName; - - public JPAEdmMappingModelService(final ODataJPAContext ctx) { - JPAEdmExtension ext = null; - mappingModelName = ctx.getJPAEdmMappingModel(); - if (mappingModelName == null) { - ext = ctx.getJPAEdmExtension(); - if (ext != null) { - mappingModelStream = ext.getJPAEdmMappingModelStream(); - } - } - - mappingModelExists = mappingModelName != null || mappingModelStream != null; - } - - @Override - public void loadMappingModel() { - InputStream is = null; - if (mappingModelExists) { - JAXBContext context; - try { - context = JAXBContext.newInstance(JPAEdmMappingModel.class); - - Unmarshaller unmarshaller = context.createUnmarshaller(); - is = loadMappingModelInputStream(); - if (is == null) { - mappingModelExists = false; - return; + boolean mappingModelExists = true; + private JPAEdmMappingModel mappingModel; + private InputStream mappingModelStream = null; + private final String mappingModelName; + + public JPAEdmMappingModelService(final ODataJPAContext ctx) { + JPAEdmExtension ext = null; + mappingModelName = ctx.getJPAEdmMappingModel(); + if (mappingModelName == null) { + ext = ctx.getJPAEdmExtension(); + if (ext != null) { + mappingModelStream = ext.getJPAEdmMappingModelStream(); + } } - mappingModel = (JPAEdmMappingModel) unmarshaller.unmarshal(is); + mappingModelExists = mappingModelName != null || mappingModelStream != null; + } - if (mappingModel != null) { - mappingModelExists = true; + @Override + public void loadMappingModel() { + InputStream is = null; + if (mappingModelExists) { + JAXBContext context; + try { + context = JAXBContext.newInstance(JPAEdmMappingModel.class); + + Unmarshaller unmarshaller = context.createUnmarshaller(); + is = loadMappingModelInputStream(); + if (is == null) { + mappingModelExists = false; + return; + } + + mappingModel = (JPAEdmMappingModel) unmarshaller.unmarshal(is); + + if (mappingModel != null) { + mappingModelExists = true; + } + + } catch (JAXBException e) { + mappingModelExists = false; + ODataJPAModelException ex = ODataJPAModelException.throwException(ODataJPAModelException.GENERAL, e); + throw new IllegalStateException("Failed to load model", ex); + } finally { + try { + if (is != null) { + is.close(); + } + } catch (IOException e) { + // do nothing + } + } } + } - } catch (JAXBException e) { - mappingModelExists = false; - ODataJPAModelException.throwException(ODataJPAModelException.GENERAL, e); - } finally { - try { - if (is != null) { - is.close(); - } - } catch (IOException e) { - // do nothing - } - } + @Override + public boolean isMappingModelExists() { + return mappingModelExists; } - } - @Override - public boolean isMappingModelExists() { - return mappingModelExists; - } + @Override + public JPAEdmMappingModel getJPAEdmMappingModel() { + return mappingModel; + } - @Override - public JPAEdmMappingModel getJPAEdmMappingModel() { - return mappingModel; - } + @Override + public String mapJPAPersistenceUnit(final String persistenceUnitName) { - @Override - public String mapJPAPersistenceUnit(final String persistenceUnitName) { + JPAPersistenceUnitMapType persistenceUnit = mappingModel.getPersistenceUnit(); + if (persistenceUnit.getName() + .equals(persistenceUnitName)) { + return persistenceUnit.getEDMSchemaNamespace(); + } - JPAPersistenceUnitMapType persistenceUnit = mappingModel.getPersistenceUnit(); - if (persistenceUnit.getName().equals(persistenceUnitName)) { - return persistenceUnit.getEDMSchemaNamespace(); + return null; } - return null; - } + @Override + public String mapJPAEntityType(final String jpaEntityTypeName) { - @Override - public String mapJPAEntityType(final String jpaEntityTypeName) { - - JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); - if (jpaEntityTypeMap != null) { - return jpaEntityTypeMap.getEDMEntityType(); - } else { - return null; + JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); + if (jpaEntityTypeMap != null) { + return jpaEntityTypeMap.getEDMEntityType(); + } + return null; } - } - @Override - public String mapJPAEntitySet(final String jpaEntityTypeName) { - JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); - if (jpaEntityTypeMap != null) { - return jpaEntityTypeMap.getEDMEntitySet(); - } else { - return null; + @Override + public String mapJPAEntitySet(final String jpaEntityTypeName) { + JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); + if (jpaEntityTypeMap != null) { + return jpaEntityTypeMap.getEDMEntitySet(); + } + return null; } - } - @Override - public String mapJPAAttribute(final String jpaEntityTypeName, final String jpaAttributeName) { - JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); - if (jpaEntityTypeMap != null && jpaEntityTypeMap.getJPAAttributes() != null) { - // fixing attributes - // removal issue - // from mapping - for (JPAAttribute jpaAttribute : jpaEntityTypeMap.getJPAAttributes().getJPAAttribute()) { - if (jpaAttribute.getName().equals(jpaAttributeName)) { - return jpaAttribute.getValue(); + @Override + public String mapJPAAttribute(final String jpaEntityTypeName, final String jpaAttributeName) { + JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); + if (jpaEntityTypeMap != null && jpaEntityTypeMap.getJPAAttributes() != null) { + // fixing attributes + // removal issue + // from mapping + for (JPAAttribute jpaAttribute : jpaEntityTypeMap.getJPAAttributes() + .getJPAAttribute()) { + if (jpaAttribute.getName() + .equals(jpaAttributeName)) { + return jpaAttribute.getValue(); + } + } } - } - } - return null; - } + return null; + } - @Override - public String mapJPARelationship(final String jpaEntityTypeName, final String jpaRelationshipName) { - JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); - if (jpaEntityTypeMap != null && jpaEntityTypeMap.getJPARelationships() != null) { - for (JPARelationship jpaRealtionship : jpaEntityTypeMap.getJPARelationships().getJPARelationship()) { - if (jpaRealtionship.getName().equals(jpaRelationshipName)) { - return jpaRealtionship.getValue(); + @Override + public String mapJPARelationship(final String jpaEntityTypeName, final String jpaRelationshipName) { + JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); + if (jpaEntityTypeMap != null && jpaEntityTypeMap.getJPARelationships() != null) { + for (JPARelationship jpaRealtionship : jpaEntityTypeMap.getJPARelationships() + .getJPARelationship()) { + if (jpaRealtionship.getName() + .equals(jpaRelationshipName)) { + return jpaRealtionship.getValue(); + } + } } - } - } - return null; - } + return null; + } - @Override - public String mapJPAEmbeddableType(final String jpaEmbeddableTypeName) { - JPAEmbeddableTypeMapType jpaEmbeddableType = searchJPAEmbeddableTypeMapType(jpaEmbeddableTypeName); - if (jpaEmbeddableType != null) { - return jpaEmbeddableType.getEDMComplexType(); - } else { - return null; + @Override + public String mapJPAEmbeddableType(final String jpaEmbeddableTypeName) { + JPAEmbeddableTypeMapType jpaEmbeddableType = searchJPAEmbeddableTypeMapType(jpaEmbeddableTypeName); + if (jpaEmbeddableType != null) { + return jpaEmbeddableType.getEDMComplexType(); + } + return null; } - } - @Override - public String mapJPAEmbeddableTypeAttribute(final String jpaEmbeddableTypeName, final String jpaAttributeName) { - JPAEmbeddableTypeMapType jpaEmbeddableType = searchJPAEmbeddableTypeMapType(jpaEmbeddableTypeName); - if (jpaEmbeddableType != null && jpaEmbeddableType.getJPAAttributes() != null) { - for (JPAAttribute jpaAttribute : jpaEmbeddableType.getJPAAttributes().getJPAAttribute()) { - if (jpaAttribute.getName().equals(jpaAttributeName)) { - return jpaAttribute.getValue(); + @Override + public String mapJPAEmbeddableTypeAttribute(final String jpaEmbeddableTypeName, final String jpaAttributeName) { + JPAEmbeddableTypeMapType jpaEmbeddableType = searchJPAEmbeddableTypeMapType(jpaEmbeddableTypeName); + if (jpaEmbeddableType != null && jpaEmbeddableType.getJPAAttributes() != null) { + for (JPAAttribute jpaAttribute : jpaEmbeddableType.getJPAAttributes() + .getJPAAttribute()) { + if (jpaAttribute.getName() + .equals(jpaAttributeName)) { + return jpaAttribute.getValue(); + } + } } - } + return null; } - return null; - } - private JPAEntityTypeMapType searchJPAEntityTypeMapType(final String jpaEntityTypeName) { - if (mappingModel != null) { - List types = mappingModel.getPersistenceUnit().getJPAEntityTypes().getJPAEntityType(); - for (JPAEntityTypeMapType jpaEntityType : types) { - if (jpaEntityType.getName().equals(jpaEntityTypeName)) { - return jpaEntityType; + private JPAEntityTypeMapType searchJPAEntityTypeMapType(final String jpaEntityTypeName) { + if (mappingModel != null) { + List types = mappingModel.getPersistenceUnit() + .getJPAEntityTypes() + .getJPAEntityType(); + for (JPAEntityTypeMapType jpaEntityType : types) { + if (jpaEntityType.getName() + .equals(jpaEntityTypeName)) { + return jpaEntityType; + } + } } - } + return null; } - return null; - } - private JPAEmbeddableTypeMapType searchJPAEmbeddableTypeMapType(final String jpaEmbeddableTypeName) { - if (null != mappingModel.getPersistenceUnit() && - null != mappingModel.getPersistenceUnit().getJPAEmbeddableTypes()) { - for (JPAEmbeddableTypeMapType jpaEmbeddableType : mappingModel.getPersistenceUnit().getJPAEmbeddableTypes() - .getJPAEmbeddableType()) { - if (jpaEmbeddableType.getName().equals(jpaEmbeddableTypeName)) { - return jpaEmbeddableType; + private JPAEmbeddableTypeMapType searchJPAEmbeddableTypeMapType(final String jpaEmbeddableTypeName) { + if (null != mappingModel.getPersistenceUnit() && null != mappingModel.getPersistenceUnit() + .getJPAEmbeddableTypes()) { + for (JPAEmbeddableTypeMapType jpaEmbeddableType : mappingModel.getPersistenceUnit() + .getJPAEmbeddableTypes() + .getJPAEmbeddableType()) { + if (jpaEmbeddableType.getName() + .equals(jpaEmbeddableTypeName)) { + return jpaEmbeddableType; + } + } } - } + return null; } - return null; - } - protected InputStream loadMappingModelInputStream() { - if (mappingModelStream != null) { - return mappingModelStream; + protected InputStream loadMappingModelInputStream() { + if (mappingModelStream != null) { + return mappingModelStream; + } + ClassLoader classLoader = JPAEdmMappingModelService.class.getClassLoader(); + InputStream modelStream = classLoader.getResourceAsStream("../../" + mappingModelName); + return (modelStream != null) ? modelStream : classLoader.getResourceAsStream(mappingModelName); } - ClassLoader classLoader = JPAEdmMappingModelService.class.getClassLoader(); - InputStream modelStream = classLoader.getResourceAsStream("../../" + mappingModelName); - return (modelStream != null) ? modelStream : classLoader.getResourceAsStream(mappingModelName); - } - @Override - public boolean checkExclusionOfJPAEntityType(final String jpaEntityTypeName) { - JPAEntityTypeMapType type = searchJPAEntityTypeMapType(jpaEntityTypeName); - if (type != null) { - return type.isExclude(); + @Override + public boolean checkExclusionOfJPAEntityType(final String jpaEntityTypeName) { + JPAEntityTypeMapType type = searchJPAEntityTypeMapType(jpaEntityTypeName); + if (type != null) { + return type.isExclude(); + } + return false; } - return false; - } - @Override - public boolean checkExclusionOfJPAAttributeType(final String jpaEntityTypeName, final String jpaAttributeName) { - JPAEntityTypeMapType type = searchJPAEntityTypeMapType(jpaEntityTypeName); - if (type != null && type.getJPAAttributes() != null) { - for (JPAAttribute jpaAttribute : type.getJPAAttributes().getJPAAttribute()) { - if (jpaAttribute.getName().equals(jpaAttributeName)) { - return jpaAttribute.isExclude(); + @Override + public boolean checkExclusionOfJPAAttributeType(final String jpaEntityTypeName, final String jpaAttributeName) { + JPAEntityTypeMapType type = searchJPAEntityTypeMapType(jpaEntityTypeName); + if (type != null && type.getJPAAttributes() != null) { + for (JPAAttribute jpaAttribute : type.getJPAAttributes() + .getJPAAttribute()) { + if (jpaAttribute.getName() + .equals(jpaAttributeName)) { + return jpaAttribute.isExclude(); + } + } } - } + return false; } - return false; - } - @Override - public boolean checkExclusionOfJPAEmbeddableType(final String jpaEmbeddableTypeName) { - JPAEmbeddableTypeMapType type = searchJPAEmbeddableTypeMapType(jpaEmbeddableTypeName); - if (type != null) { - return type.isExclude(); + @Override + public boolean checkExclusionOfJPAEmbeddableType(final String jpaEmbeddableTypeName) { + JPAEmbeddableTypeMapType type = searchJPAEmbeddableTypeMapType(jpaEmbeddableTypeName); + if (type != null) { + return type.isExclude(); + } + return false; } - return false; - } - @Override - public boolean checkExclusionOfJPAEmbeddableAttributeType(final String jpaEmbeddableTypeName, - final String jpaAttributeName) { - JPAEmbeddableTypeMapType type = searchJPAEmbeddableTypeMapType(jpaEmbeddableTypeName); - if (type != null && type.getJPAAttributes() != null) { - for (JPAAttribute jpaAttribute : type.getJPAAttributes().getJPAAttribute()) { - if (jpaAttribute.getName().equals(jpaAttributeName)) { - return jpaAttribute.isExclude(); + @Override + public boolean checkExclusionOfJPAEmbeddableAttributeType(final String jpaEmbeddableTypeName, final String jpaAttributeName) { + JPAEmbeddableTypeMapType type = searchJPAEmbeddableTypeMapType(jpaEmbeddableTypeName); + if (type != null && type.getJPAAttributes() != null) { + for (JPAAttribute jpaAttribute : type.getJPAAttributes() + .getJPAAttribute()) { + if (jpaAttribute.getName() + .equals(jpaAttributeName)) { + return jpaAttribute.isExclude(); + } + } } - } + return false; } - return false; - } } diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPAEdmNameBuilder.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPAEdmNameBuilder.java index 675cfc0a3..0be8adb30 100644 --- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPAEdmNameBuilder.java +++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPAEdmNameBuilder.java @@ -21,10 +21,10 @@ import java.lang.reflect.AnnotatedElement; import java.lang.reflect.Field; -import javax.persistence.Column; -import javax.persistence.metamodel.Attribute; -import javax.persistence.metamodel.ManagedType; -import javax.persistence.metamodel.PluralAttribute; +import jakarta.persistence.Column; +import jakarta.persistence.metamodel.Attribute; +import jakarta.persistence.metamodel.ManagedType; +import jakarta.persistence.metamodel.PluralAttribute; import org.apache.olingo.odata2.api.edm.EdmMultiplicity; import org.apache.olingo.odata2.api.edm.FullQualifiedName; diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPATypeConverter.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPATypeConverter.java index ec3b49398..579a1f595 100644 --- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPATypeConverter.java +++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPATypeConverter.java @@ -29,12 +29,12 @@ import java.util.Calendar; import java.util.UUID; -import javax.persistence.Lob; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; -import javax.persistence.metamodel.Attribute; -import javax.xml.bind.annotation.adapters.XmlAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import jakarta.persistence.Lob; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; +import jakarta.persistence.metamodel.Attribute; +import jakarta.xml.bind.annotation.adapters.XmlAdapter; +import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind; import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPAModelException; diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationEnd.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationEnd.java index c2cbd114b..a3ff88926 100644 --- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationEnd.java +++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationEnd.java @@ -28,11 +28,11 @@ import org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmPropertyView; import org.apache.olingo.odata2.jpa.processor.core.access.model.JPAEdmNameBuilder; -import javax.persistence.ManyToMany; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.OneToOne; -import javax.persistence.metamodel.Attribute.PersistentAttributeType; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.OneToOne; +import jakarta.persistence.metamodel.Attribute.PersistentAttributeType; import java.lang.reflect.AnnotatedElement; import java.lang.reflect.Array; import java.util.List; diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmBaseViewImpl.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmBaseViewImpl.java index 80d9d75a7..3af7b37fc 100644 --- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmBaseViewImpl.java +++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmBaseViewImpl.java @@ -18,7 +18,7 @@ ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.core.model; -import javax.persistence.metamodel.Metamodel; +import jakarta.persistence.metamodel.Metamodel; import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; import org.apache.olingo.odata2.jpa.processor.api.access.JPAEdmBuilder; diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmComplexType.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmComplexType.java index c033494e5..940adb5ff 100644 --- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmComplexType.java +++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmComplexType.java @@ -24,8 +24,8 @@ import java.util.List; import java.util.Set; -import javax.persistence.metamodel.Attribute; -import javax.persistence.metamodel.EmbeddableType; +import jakarta.persistence.metamodel.Attribute; +import jakarta.persistence.metamodel.EmbeddableType; import org.apache.olingo.odata2.api.edm.FullQualifiedName; import org.apache.olingo.odata2.api.edm.provider.ComplexProperty; diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityType.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityType.java index 0e98cd6a6..6b84d1ae4 100644 --- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityType.java +++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityType.java @@ -26,7 +26,7 @@ import java.util.ListIterator; import java.util.Set; -import javax.persistence.EntityListeners; +import jakarta.persistence.EntityListeners; import org.apache.olingo.odata2.api.edm.provider.EntityType; import org.apache.olingo.odata2.jpa.processor.api.ODataJPATombstoneEntityListener; @@ -46,7 +46,7 @@ public class JPAEdmEntityType extends JPAEdmBaseViewImpl implements JPAEdmEntity private JPAEdmSchemaView schemaView = null; private EntityType currentEdmEntityType = null; - private javax.persistence.metamodel.EntityType> currentJPAEntityType = null; + private jakarta.persistence.metamodel.EntityType> currentJPAEntityType = null; private EntityTypeList consistentEntityTypes = null; private HashMap consistentEntityTypeMap; @@ -72,7 +72,7 @@ public EntityType getEdmEntityType() { } @Override - public javax.persistence.metamodel.EntityType> getJPAEntityType() { + public jakarta.persistence.metamodel.EntityType> getJPAEntityType() { return currentJPAEntityType; } @@ -92,7 +92,7 @@ private class JPAEdmEntityTypeBuilder implements JPAEdmBuilder { @Override public void build() throws ODataJPAModelException, ODataJPARuntimeException { - Collection> jpaEntityTypes = metaModel.getEntities(); + Collection> jpaEntityTypes = metaModel.getEntities(); if (jpaEntityTypes == null || jpaEntityTypes.isEmpty() == true) { return; @@ -102,7 +102,7 @@ public void build() throws ODataJPAModelException, ODataJPARuntimeException { } jpaEntityTypes = sortJPAEntityTypes(jpaEntityTypes); - for (javax.persistence.metamodel.EntityType> jpaEntityType : jpaEntityTypes) { + for (jakarta.persistence.metamodel.EntityType> jpaEntityType : jpaEntityTypes) { currentEdmEntityType = new EntityType(); currentJPAEntityType = jpaEntityType; @@ -144,15 +144,15 @@ public void build() throws ODataJPAModelException, ODataJPARuntimeException { } - private List> sortJPAEntityTypes( - final Collection> entities) { + private List> sortJPAEntityTypes( + final Collection> entities) { - List> entityTypeList = - new ArrayList>(entities.size()); + List> entityTypeList = + new ArrayList>(entities.size()); - Iterator> itr; - javax.persistence.metamodel.EntityType> smallestJpaEntity; - javax.persistence.metamodel.EntityType> currentJpaEntity; + Iterator> itr; + jakarta.persistence.metamodel.EntityType> smallestJpaEntity; + jakarta.persistence.metamodel.EntityType> currentJpaEntity; while (!entities.isEmpty()) { itr = entities.iterator(); smallestJpaEntity = itr.next(); diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmFacets.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmFacets.java index 04c795ea8..abf1ed094 100644 --- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmFacets.java +++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmFacets.java @@ -20,8 +20,8 @@ import java.lang.reflect.AnnotatedElement; -import javax.persistence.Column; -import javax.persistence.metamodel.Attribute; +import jakarta.persistence.Column; +import jakarta.persistence.metamodel.Attribute; import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind; import org.apache.olingo.odata2.api.edm.provider.Facets; diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmModel.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmModel.java index 966bdd0b1..568c52088 100644 --- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmModel.java +++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmModel.java @@ -18,7 +18,7 @@ ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.core.model; -import javax.persistence.metamodel.Metamodel; +import jakarta.persistence.metamodel.Metamodel; import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; import org.apache.olingo.odata2.jpa.processor.api.access.JPAEdmBuilder; diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmProperty.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmProperty.java index 2e2c2be4e..e1cdd3ecd 100644 --- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmProperty.java +++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmProperty.java @@ -26,17 +26,17 @@ import java.util.Map; import java.util.Set; -import javax.persistence.AttributeOverride; -import javax.persistence.AttributeOverrides; -import javax.persistence.Column; -import javax.persistence.JoinColumn; -import javax.persistence.JoinColumns; -import javax.persistence.metamodel.Attribute; -import javax.persistence.metamodel.Attribute.PersistentAttributeType; -import javax.persistence.metamodel.EmbeddableType; -import javax.persistence.metamodel.EntityType; -import javax.persistence.metamodel.PluralAttribute; -import javax.persistence.metamodel.SingularAttribute; +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.AttributeOverrides; +import jakarta.persistence.Column; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinColumns; +import jakarta.persistence.metamodel.Attribute; +import jakarta.persistence.metamodel.Attribute.PersistentAttributeType; +import jakarta.persistence.metamodel.EmbeddableType; +import jakarta.persistence.metamodel.EntityType; +import jakarta.persistence.metamodel.PluralAttribute; +import jakarta.persistence.metamodel.SingularAttribute; import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind; import org.apache.olingo.odata2.api.edm.FullQualifiedName; diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintRole.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintRole.java index 9c3c89ea3..c66290e2f 100644 --- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintRole.java +++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintRole.java @@ -23,7 +23,7 @@ import java.util.ArrayList; import java.util.List; -import javax.persistence.metamodel.Attribute; +import jakarta.persistence.metamodel.Attribute; import org.apache.olingo.odata2.api.edm.provider.Association; import org.apache.olingo.odata2.api.edm.provider.AssociationEnd; diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/ODataJPAContextImplTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/ODataJPAContextImplTest.java index 83952d0da..46bd5a1d1 100644 --- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/ODataJPAContextImplTest.java +++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/ODataJPAContextImplTest.java @@ -24,8 +24,8 @@ import java.util.List; import java.util.Locale; -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; +import jakarta.persistence.EntityManager; +import jakarta.persistence.EntityManagerFactory; import org.apache.olingo.odata2.api.edm.provider.EdmProvider; import org.apache.olingo.odata2.api.processor.ODataContext; diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/ODataJPADefaultProcessorTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/ODataJPADefaultProcessorTest.java index f607151c7..ceb52ec53 100644 --- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/ODataJPADefaultProcessorTest.java +++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/ODataJPADefaultProcessorTest.java @@ -1,26 +1,21 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.core; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; - import java.io.ByteArrayInputStream; import java.io.InputStream; import java.net.URI; @@ -29,15 +24,8 @@ import java.util.ArrayList; import java.util.HashSet; import java.util.List; +import java.util.Objects; import java.util.Set; - -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; -import javax.persistence.EntityTransaction; -import javax.persistence.Query; -import javax.persistence.metamodel.EntityType; -import javax.persistence.metamodel.Metamodel; - import org.apache.olingo.odata2.api.commons.HttpContentType; import org.apache.olingo.odata2.api.commons.InlineCount; import org.apache.olingo.odata2.api.edm.EdmConcurrencyMode; @@ -69,7 +57,6 @@ import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; import org.apache.olingo.odata2.jpa.processor.api.ODataJPADefaultProcessor; import org.apache.olingo.odata2.jpa.processor.api.ODataJPATransaction; -import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPAModelException; import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException; import org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmMapping; import org.apache.olingo.odata2.jpa.processor.core.common.ODataJPATestConstants; @@ -82,508 +69,617 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import jakarta.persistence.EntityManager; +import jakarta.persistence.EntityManagerFactory; +import jakarta.persistence.EntityTransaction; +import jakarta.persistence.Query; +import jakarta.persistence.metamodel.EntityType; +import jakarta.persistence.metamodel.Metamodel; public class ODataJPADefaultProcessorTest extends JPAEdmTestModelView { - private ODataJPADefaultProcessor objODataJPAProcessorDefault; - - private static final String STR_LOCAL_URI = "http://localhost:8080/org.apache.olingo.odata2.processor.ref.web/"; - private static final String SALESORDERPROCESSING_CONTAINER = "salesorderprocessingContainer"; - private static final String SO_ID = "SoId"; - private static final String SALES_ORDER = "SalesOrder"; - private static final String SALES_ORDER_HEADERS = "SalesOrderHeaders"; - private static final String STR_CONTENT_TYPE = "Content-Type"; - - @Before - public void setUp() { - objODataJPAProcessorDefault = new ODataJPADefaultProcessor(getLocalmockODataJPAContext()) { }; - } - - @Test - public void testReadEntitySetGetEntitySetUriInfoString() { - try { - GetEntityUriInfo getEntityView = getEntityUriInfo(); - Assert.assertNotNull(objODataJPAProcessorDefault.readEntity(getEntityView, HttpContentType.APPLICATION_XML)); - } catch (ODataJPAModelException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } catch (ODataJPARuntimeException e1) {// Expected - assertTrue(true); - } catch (ODataException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - - } - - @Test - public void testcountEntitySet() { - try { - ODataResponse countEntitySet = - objODataJPAProcessorDefault.countEntitySet(getEntitySetCountUriInfo(), HttpContentType.APPLICATION_XML); - Assert.assertNotNull(countEntitySet); - Object entity = countEntitySet.getEntity(); - Assert.assertNotNull(entity); - - byte[] b = new byte[2]; - ((ByteArrayInputStream) entity).read(b); - Assert.assertEquals("11", new String(b, Charset.forName("utf-8"))); - } catch (ODataException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } catch (Exception e) { - assertTrue(true); - } - } - - @Test - public void testExistsEntity() { - try { - Assert.assertNotNull(objODataJPAProcessorDefault.existsEntity(getEntityCountUriInfo(), - HttpContentType.APPLICATION_XML)); - Assert.assertNull("ContentType MUST NOT set by entity provider", objODataJPAProcessorDefault.existsEntity( - getEntityCountUriInfo(), HttpContentType.APPLICATION_XML).getHeader(STR_CONTENT_TYPE)); - } catch (ODataException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } catch (Exception e) { - assertTrue(true); - } - } - - @Test - public void testDeleteEntity() { - try { - Assert.assertNotNull(objODataJPAProcessorDefault.deleteEntity(getDeletetUriInfo(), - HttpContentType.APPLICATION_XML)); - } catch (ODataException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - } - - @Test - public void testCreateEntity() { - try { - Assert.assertNotNull(objODataJPAProcessorDefault.createEntity(getPostUriInfo(), getMockedInputStreamContent(), - HttpContentType.APPLICATION_XML, HttpContentType.APPLICATION_XML)); - } catch (ODataException e) { - Assert.assertTrue(true); // Expected TODO - need to revisit - } - } - - @Test - public void testUpdateEntity() { - try { - Assert.assertNotNull(objODataJPAProcessorDefault.updateEntity(getPutUriInfo(), getMockedInputStreamContent(), - HttpContentType.APPLICATION_XML, false, HttpContentType.APPLICATION_XML)); - } catch (ODataException e) { - Assert.assertTrue(true); // Expected TODO - need to revisit - } - } - - private PutMergePatchUriInfo getPutUriInfo() { - return (PutMergePatchUriInfo) getDeletetUriInfo(); - } - - private PostUriInfo getPostUriInfo() { - return (PostUriInfo) getDeletetUriInfo(); - } - - private InputStream getMockedInputStreamContent() { - return new ByteArrayInputStream(getEntityBody().getBytes()); - } - - private String getEntityBody() { - return "" - + "" - + "" - + "2" - + "2013-01-02T00:00:00" - + "Code_555" - + "" - + "Test_Street_Name_055" - + "2" - + "Test_Country_2" - + "Test_City_2" - + "" - + "0.0" - + "2" - + "true" - + "buyerName_2" - + "0.0" + "" + "" + ""; - } - - private GetEntitySetCountUriInfo getEntitySetCountUriInfo() { - return getLocalUriInfo(); - } - - private GetEntityCountUriInfo getEntityCountUriInfo() { - return getLocalUriInfo(); - } - - private DeleteUriInfo getDeletetUriInfo() { - UriInfo objUriInfo = EasyMock.createMock(UriInfo.class); - EasyMock.expect(objUriInfo.getStartEntitySet()).andStubReturn(getLocalEdmEntitySet()); - List navSegments = new ArrayList(); - EasyMock.expect(objUriInfo.getNavigationSegments()).andReturn(navSegments).anyTimes(); - EasyMock.expect(objUriInfo.getTargetEntitySet()).andStubReturn(getLocalEdmEntitySet()); - EasyMock.expect(objUriInfo.getSelect()).andStubReturn(null); - EasyMock.expect(objUriInfo.getOrderBy()).andStubReturn(getOrderByExpression()); - EasyMock.expect(objUriInfo.getTop()).andStubReturn(getTop()); - EasyMock.expect(objUriInfo.getSkip()).andStubReturn(getSkip()); - EasyMock.expect(objUriInfo.getInlineCount()).andStubReturn(getInlineCount()); - EasyMock.expect(objUriInfo.getFilter()).andStubReturn(getFilter()); - EasyMock.expect(objUriInfo.getKeyPredicates()).andStubReturn(getKeyPredicates()); - EasyMock.expect(objUriInfo.isLinks()).andStubReturn(false); - EasyMock.replay(objUriInfo); - return objUriInfo; - } - - private List getKeyPredicates() { - List keyPredicates = new ArrayList(); - return keyPredicates; - } - - /** - * @return - */ - private UriInfo getLocalUriInfo() { - UriInfo objUriInfo = EasyMock.createMock(UriInfo.class); - EasyMock.expect(objUriInfo.getStartEntitySet()).andStubReturn(getLocalEdmEntitySet()); - List navSegments = new ArrayList(); - EasyMock.expect(objUriInfo.getNavigationSegments()).andReturn(navSegments).anyTimes(); - EasyMock.expect(objUriInfo.getTargetEntitySet()).andStubReturn(getLocalEdmEntitySet()); - EasyMock.expect(objUriInfo.getSelect()).andStubReturn(null); - EasyMock.expect(objUriInfo.getOrderBy()).andStubReturn(getOrderByExpression()); - EasyMock.expect(objUriInfo.getTop()).andStubReturn(getTop()); - EasyMock.expect(objUriInfo.getSkip()).andStubReturn(getSkip()); - EasyMock.expect(objUriInfo.getInlineCount()).andStubReturn(getInlineCount()); - EasyMock.expect(objUriInfo.getFilter()).andStubReturn(getFilter()); - EasyMock.expect(objUriInfo.getFunctionImport()).andStubReturn(null); - EasyMock.replay(objUriInfo); - return objUriInfo; - } - - /** - * @return - * @throws EdmException - */ - private EdmEntitySet getLocalEdmEntitySet() { - EdmEntitySet edmEntitySet = EasyMock.createMock(EdmEntitySet.class); - try { - EasyMock.expect(edmEntitySet.getName()).andStubReturn(SALES_ORDER_HEADERS); - EasyMock.expect(edmEntitySet.getEntityContainer()).andStubReturn(getLocalEdmEntityContainer()); - EasyMock.expect(edmEntitySet.getEntityType()).andStubReturn(getLocalEdmEntityType()); - EasyMock.replay(edmEntitySet); - } catch (EdmException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - return edmEntitySet; - } - - /** - * @return - * @throws EdmException - */ - private EdmEntityType getLocalEdmEntityType() { - EdmEntityType edmEntityType = EasyMock.createMock(EdmEntityType.class); - try { - EasyMock.expect(edmEntityType.getKeyProperties()).andStubReturn(new ArrayList()); - EasyMock.expect(edmEntityType.getPropertyNames()).andStubReturn(getLocalPropertyNames()); - EasyMock.expect(edmEntityType.getProperty(SO_ID)).andStubReturn(getEdmTypedMockedObj(SALES_ORDER)); - EasyMock.expect(edmEntityType.getKind()).andStubReturn(EdmTypeKind.SIMPLE); - EasyMock.expect(edmEntityType.getNamespace()).andStubReturn(SALES_ORDER_HEADERS); - EasyMock.expect(edmEntityType.getName()).andStubReturn(SALES_ORDER_HEADERS); - EasyMock.expect(edmEntityType.hasStream()).andStubReturn(false); - EasyMock.expect(edmEntityType.getNavigationPropertyNames()).andStubReturn(new ArrayList()); - EasyMock.expect(edmEntityType.getKeyPropertyNames()).andStubReturn(new ArrayList()); - EasyMock.expect(edmEntityType.getMapping()).andStubReturn((EdmMapping) getEdmMappingMockedObj(SALES_ORDER)); - EasyMock.replay(edmEntityType); - } catch (EdmException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - return edmEntityType; - } - - private InlineCount getInlineCount() { - return InlineCount.NONE; - } - - private FilterExpression getFilter() { - return null; - } - - private Integer getSkip() { - return null; - } - - private Integer getTop() { - return null; - } - - private OrderByExpression getOrderByExpression() { - return null; - } - - private ODataJPAContext getLocalmockODataJPAContext() { - ODataJPAContext odataJPAContext = EasyMock.createMock(ODataJPAContext.class); - EasyMock.expect(odataJPAContext.getPageSize()).andReturn(0).anyTimes(); - EasyMock.expect(odataJPAContext.getPersistenceUnitName()).andStubReturn("salesorderprocessing"); - EasyMock.expect(odataJPAContext.getEntityManagerFactory()).andStubReturn(mockEntityManagerFactory()); - EasyMock.expect(odataJPAContext.getODataJPATransaction()).andStubReturn(getLocalJpaTransaction()); - EasyMock.expect(odataJPAContext.getODataContext()).andStubReturn(getLocalODataContext()); - odataJPAContext.setODataContext((ODataContext) EasyMock.anyObject()); - EasyMock.expectLastCall().anyTimes(); - EasyMock.expect(odataJPAContext.getEntityManager()).andStubReturn(getLocalEntityManager()); - EasyMock.expect(odataJPAContext.isContainerManaged()).andReturn(false); - EasyMock.expectLastCall().anyTimes(); - EasyMock.replay(odataJPAContext); - return odataJPAContext; - } - - private ODataJPATransaction getLocalJpaTransaction() { - ODataJPATransaction tx = EasyMock.createMock(ODataJPATransaction.class); - tx.begin(); // testing void method - tx.commit();// testing void method - tx.rollback();// testing void method - EasyMock.expect(tx.isActive()).andReturn(false); - EasyMock.expect(tx.isActive()).andReturn(false); - EasyMock.replay(tx); - return tx; - } - - private EntityManagerFactory mockEntityManagerFactory() { - EntityManagerFactory emf = EasyMock.createMock(EntityManagerFactory.class); - EasyMock.expect(emf.getMetamodel()).andStubReturn(mockMetaModel()); - EasyMock.expect(emf.createEntityManager()).andStubReturn(getLocalEntityManager()); - EasyMock.replay(emf); - return emf; - } - - private EntityManagerFactory mockEntityManagerFactory2() {// For create, to avoid stackoverflow - EntityManagerFactory emf = EasyMock.createMock(EntityManagerFactory.class); - EasyMock.expect(emf.getMetamodel()).andStubReturn(mockMetaModel()); - EasyMock.replay(emf); - return emf; - } - - private EntityManager getLocalEntityManager() { - EntityManager em = EasyMock.createMock(EntityManager.class); - EasyMock.expect(em.createQuery("SELECT E1 FROM SalesOrderHeaders E1")).andStubReturn(getQuery()); - EasyMock.expect(em.createQuery("SELECT COUNT ( E1 ) FROM SalesOrderHeaders E1")).andStubReturn( - getQueryForSelectCount()); - EasyMock.expect(em.getEntityManagerFactory()).andStubReturn(mockEntityManagerFactory2());// For create - EasyMock.expect(em.getTransaction()).andStubReturn(getLocalTransaction()); // For Delete - EasyMock.expect(em.isOpen()).andReturn(true).anyTimes(); - Address obj = new Address(); - em.remove(obj);// testing void method - em.flush(); - em.close(); - EasyMock.expectLastCall().anyTimes(); - EasyMock.replay(em); - return em; - } - - private EntityTransaction getLocalTransaction() { - EntityTransaction entityTransaction = EasyMock.createMock(EntityTransaction.class); - entityTransaction.begin(); // testing void method - entityTransaction.commit();// testing void method - entityTransaction.rollback();// testing void method - EasyMock.expect(entityTransaction.isActive()).andReturn(false); - EasyMock.replay(entityTransaction); - return entityTransaction; - } - - private Query getQuery() { - Query query = EasyMock.createMock(Query.class); - EasyMock.expect(query.getResultList()).andStubReturn(getResultList()); - EasyMock.replay(query); - return query; - } - - private Query getQueryForSelectCount() { - Query query = EasyMock.createMock(Query.class); - EasyMock.expect(query.getResultList()).andStubReturn(getResultListForSelectCount()); - EasyMock.replay(query); - return query; - } - - private List> getResultList() { - List list = new ArrayList(); - list.add(new Address()); - return list; - } - - private List> getResultListForSelectCount() { - List list = new ArrayList(); - list.add(new Long(11)); - return list; - } - - class Address { - private String soId = "12"; - - public String getSoId() { - return soId; - } - - @Override - public boolean equals(final Object obj) { - boolean isEqual = false; - if (obj instanceof Address) { - isEqual = getSoId().equalsIgnoreCase(((Address) obj).getSoId());// - } - return isEqual; - } - } - - private Metamodel mockMetaModel() { - Metamodel metaModel = EasyMock.createMock(Metamodel.class); - EasyMock.expect(metaModel.getEntities()).andStubReturn(getLocalEntities()); - EasyMock.replay(metaModel); - return metaModel; - } - - private Set> getLocalEntities() { - Set> entityTypeSet = new HashSet>(); - entityTypeSet.add(getLocalJPAEntityType()); - return entityTypeSet; - } - - @SuppressWarnings("rawtypes") - private EntityType getLocalJPAEntityType() { - @SuppressWarnings("unchecked") - EntityType entityType = EasyMock.createMock(EntityType.class); - EasyMock.expect(entityType.getJavaType()).andStubReturn(EntityType.class); - EasyMock.replay(entityType); - return entityType; - } - - private GetEntityUriInfo getEntityUriInfo() { - GetEntityUriInfo getEntityView = EasyMock.createMock(GetEntityUriInfo.class); - EdmEntitySet edmEntitySet = EasyMock.createMock(EdmEntitySet.class); - EdmEntityType edmEntityType = EasyMock.createMock(EdmEntityType.class); - try { - EasyMock.expect(getEntityView.getExpand()).andStubReturn(null); - EasyMock.expect(edmEntityType.getKeyProperties()).andStubReturn(new ArrayList()); - EasyMock.expect(edmEntitySet.getEntityType()).andStubReturn(edmEntityType); - EasyMock.expect(edmEntitySet.getName()).andStubReturn(SALES_ORDER_HEADERS); - - EasyMock.expect(getEntityView.getSelect()).andStubReturn(null); - EasyMock.expect(getEntityView.getTargetEntitySet()).andStubReturn(edmEntitySet); - EasyMock.expect(edmEntityType.getPropertyNames()).andStubReturn(getLocalPropertyNames()); - EasyMock.expect(edmEntityType.getProperty(SO_ID)).andStubReturn(getEdmTypedMockedObj(SO_ID)); - - EasyMock.expect(edmEntityType.getMapping()).andStubReturn((EdmMapping) getEdmMappingMockedObj(SALES_ORDER)); - - EasyMock.expect(edmEntityType.getKind()).andStubReturn(EdmTypeKind.SIMPLE); - EasyMock.expect(edmEntityType.getNamespace()).andStubReturn(SALES_ORDER_HEADERS); - EasyMock.expect(edmEntityType.getName()).andStubReturn(SALES_ORDER_HEADERS); - EasyMock.expect(edmEntityType.hasStream()).andStubReturn(false); - EasyMock.expect(edmEntityType.getNavigationPropertyNames()).andStubReturn(new ArrayList()); - EasyMock.expect(edmEntityType.getKeyPropertyNames()).andStubReturn(new ArrayList()); - - EasyMock.expect(edmEntitySet.getEntityContainer()).andStubReturn(getLocalEdmEntityContainer()); - - EasyMock.replay(edmEntityType, edmEntitySet); - EasyMock.expect(getEntityView.getKeyPredicates()).andStubReturn(new ArrayList()); - List navigationSegments = new ArrayList(); - EasyMock.expect(getEntityView.getNavigationSegments()).andReturn(navigationSegments); - EasyMock.expect(getEntityView.getStartEntitySet()).andReturn(edmEntitySet); - - EasyMock.replay(getEntityView); - } catch (EdmException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - return getEntityView; - } - - private EdmEntityContainer getLocalEdmEntityContainer() { - EdmEntityContainer edmEntityContainer = EasyMock.createMock(EdmEntityContainer.class); - EasyMock.expect(edmEntityContainer.isDefaultEntityContainer()).andStubReturn(true); - try { - EasyMock.expect(edmEntityContainer.getName()).andStubReturn(SALESORDERPROCESSING_CONTAINER); - } catch (EdmException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - - EasyMock.replay(edmEntityContainer); - return edmEntityContainer; - } - - private EdmTyped getEdmTypedMockedObj(final String propertyName) { - EdmProperty mockedEdmProperty = EasyMock.createMock(EdmProperty.class); - try { - EasyMock.expect(mockedEdmProperty.getMapping()).andStubReturn((EdmMapping) getEdmMappingMockedObj(propertyName)); - EdmType edmType = EasyMock.createMock(EdmType.class); - EasyMock.expect(edmType.getKind()).andStubReturn(EdmTypeKind.SIMPLE); - EasyMock.replay(edmType); - EasyMock.expect(mockedEdmProperty.getName()).andStubReturn("identifier"); - EasyMock.expect(mockedEdmProperty.getType()).andStubReturn(edmType); - EasyMock.expect(mockedEdmProperty.getFacets()).andStubReturn(getEdmFacetsMockedObj()); - - EasyMock.replay(mockedEdmProperty); - } catch (EdmException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - return mockedEdmProperty; - } - - private EdmFacets getEdmFacetsMockedObj() { - EdmFacets facets = EasyMock.createMock(EdmFacets.class); - EasyMock.expect(facets.getConcurrencyMode()).andStubReturn(EdmConcurrencyMode.Fixed); - - EasyMock.replay(facets); - return facets; - } - - private JPAEdmMapping getEdmMappingMockedObj(final String propertyName) { - JPAEdmMappingImpl mockedEdmMapping = EasyMock.createMock(JPAEdmMappingImpl.class); - if (propertyName.equalsIgnoreCase(SALES_ORDER)) { - EasyMock.expect(((EdmMapping) mockedEdmMapping).getInternalName()).andStubReturn(SALES_ORDER_HEADERS); - } else { - EasyMock.expect(((EdmMapping) mockedEdmMapping).getInternalName()).andStubReturn(propertyName); - } - EasyMock.expect(mockedEdmMapping.getODataJPATombstoneEntityListener()).andReturn(null); - EasyMock.> expect(mockedEdmMapping.getJPAType()).andReturn(SalesOrderHeader.class); - EasyMock.replay(mockedEdmMapping); - return mockedEdmMapping; - } - - private List getLocalPropertyNames() { - List list = new ArrayList(); - list.add(SO_ID); - return list; - } - - private ODataContext getLocalODataContext() { - ODataContext objODataContext = null; - try { - ODataContextMock contextMock = new ODataContextMock(); - contextMock.setODataService(new ODataServiceMock().mock()); - contextMock.setPathInfo(getLocalPathInfo()); - objODataContext = contextMock.mock(); - - } catch (ODataException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - return objODataContext; - } - - private PathInfo getLocalPathInfo() { - PathInfo pathInfo = EasyMock.createMock(PathInfo.class); - EasyMock.expect(pathInfo.getServiceRoot()).andStubReturn(getLocalURI()); - EasyMock.replay(pathInfo); - return pathInfo; - } - - private URI getLocalURI() { - URI uri = null; - try { - uri = new URI(STR_LOCAL_URI); - } catch (URISyntaxException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - return uri; - } + private ODataJPADefaultProcessor objODataJPAProcessorDefault; + + private static final String STR_LOCAL_URI = "http://localhost:8080/org.apache.olingo.odata2.processor.ref.web/"; + private static final String SALESORDERPROCESSING_CONTAINER = "salesorderprocessingContainer"; + private static final String SO_ID = "SoId"; + private static final String SALES_ORDER = "SalesOrder"; + private static final String SALES_ORDER_HEADERS = "SalesOrderHeaders"; + private static final String STR_CONTENT_TYPE = "Content-Type"; + + @Before + public void setUp() { + objODataJPAProcessorDefault = new ODataJPADefaultProcessor(getLocalmockODataJPAContext()) {}; + } + + @Test + public void testReadEntitySetGetEntitySetUriInfoString() { + try { + GetEntityUriInfo getEntityView = getEntityUriInfo(); + Assert.assertNotNull(objODataJPAProcessorDefault.readEntity(getEntityView, HttpContentType.APPLICATION_XML)); + } catch (ODataJPARuntimeException e1) {// Expected + assertTrue(true); + } catch (ODataException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + + } + + @Test + public void testcountEntitySet() { + try { + ODataResponse countEntitySet = + objODataJPAProcessorDefault.countEntitySet(getEntitySetCountUriInfo(), HttpContentType.APPLICATION_XML); + Assert.assertNotNull(countEntitySet); + Object entity = countEntitySet.getEntity(); + Assert.assertNotNull(entity); + + byte[] b = new byte[2]; + ((ByteArrayInputStream) entity).read(b); + Assert.assertEquals("11", new String(b, Charset.forName("utf-8"))); + } catch (ODataException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } catch (Exception e) { + assertTrue(true); + } + } + + @Test + public void testExistsEntity() { + try { + Assert.assertNotNull(objODataJPAProcessorDefault.existsEntity(getEntityCountUriInfo(), HttpContentType.APPLICATION_XML)); + Assert.assertNull("ContentType MUST NOT set by entity provider", + objODataJPAProcessorDefault.existsEntity(getEntityCountUriInfo(), HttpContentType.APPLICATION_XML) + .getHeader(STR_CONTENT_TYPE)); + } catch (ODataException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } catch (Exception e) { + assertTrue(true); + } + } + + @Test + public void testDeleteEntity() { + try { + Assert.assertNotNull(objODataJPAProcessorDefault.deleteEntity(getDeletetUriInfo(), HttpContentType.APPLICATION_XML)); + } catch (ODataException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + } + + @Test + public void testCreateEntity() { + try { + Assert.assertNotNull(objODataJPAProcessorDefault.createEntity(getPostUriInfo(), getMockedInputStreamContent(), + HttpContentType.APPLICATION_XML, HttpContentType.APPLICATION_XML)); + } catch (ODataException e) { + Assert.assertTrue(true); // Expected TODO - need to revisit + } + } + + @Test + public void testUpdateEntity() { + try { + Assert.assertNotNull(objODataJPAProcessorDefault.updateEntity(getPutUriInfo(), getMockedInputStreamContent(), + HttpContentType.APPLICATION_XML, false, HttpContentType.APPLICATION_XML)); + } catch (ODataException e) { + Assert.assertTrue(true); // Expected TODO - need to revisit + } + } + + private PutMergePatchUriInfo getPutUriInfo() { + return (PutMergePatchUriInfo) getDeletetUriInfo(); + } + + private PostUriInfo getPostUriInfo() { + return (PostUriInfo) getDeletetUriInfo(); + } + + private InputStream getMockedInputStreamContent() { + return new ByteArrayInputStream(getEntityBody().getBytes()); + } + + private String getEntityBody() { + return "" + + "" + "" + "2" + + "2013-01-02T00:00:00" + "Code_555" + + "" + "Test_Street_Name_055" + + "2" + "Test_Country_2" + "Test_City_2" + + "" + "0.0" + "2" + + "true" + "buyerName_2" + "0.0" + + "" + "" + ""; + } + + private GetEntitySetCountUriInfo getEntitySetCountUriInfo() { + return getLocalUriInfo(); + } + + private GetEntityCountUriInfo getEntityCountUriInfo() { + return getLocalUriInfo(); + } + + private DeleteUriInfo getDeletetUriInfo() { + UriInfo objUriInfo = EasyMock.createMock(UriInfo.class); + EasyMock.expect(objUriInfo.getStartEntitySet()) + .andStubReturn(getLocalEdmEntitySet()); + List navSegments = new ArrayList(); + EasyMock.expect(objUriInfo.getNavigationSegments()) + .andReturn(navSegments) + .anyTimes(); + EasyMock.expect(objUriInfo.getTargetEntitySet()) + .andStubReturn(getLocalEdmEntitySet()); + EasyMock.expect(objUriInfo.getSelect()) + .andStubReturn(null); + EasyMock.expect(objUriInfo.getOrderBy()) + .andStubReturn(getOrderByExpression()); + EasyMock.expect(objUriInfo.getTop()) + .andStubReturn(getTop()); + EasyMock.expect(objUriInfo.getSkip()) + .andStubReturn(getSkip()); + EasyMock.expect(objUriInfo.getInlineCount()) + .andStubReturn(getInlineCount()); + EasyMock.expect(objUriInfo.getFilter()) + .andStubReturn(getFilter()); + EasyMock.expect(objUriInfo.getKeyPredicates()) + .andStubReturn(getKeyPredicates()); + EasyMock.expect(objUriInfo.isLinks()) + .andStubReturn(false); + EasyMock.replay(objUriInfo); + return objUriInfo; + } + + private List getKeyPredicates() { + return new ArrayList(); + } + + /** + * @return + */ + private UriInfo getLocalUriInfo() { + UriInfo objUriInfo = EasyMock.createMock(UriInfo.class); + EasyMock.expect(objUriInfo.getStartEntitySet()) + .andStubReturn(getLocalEdmEntitySet()); + List navSegments = new ArrayList(); + EasyMock.expect(objUriInfo.getNavigationSegments()) + .andReturn(navSegments) + .anyTimes(); + EasyMock.expect(objUriInfo.getTargetEntitySet()) + .andStubReturn(getLocalEdmEntitySet()); + EasyMock.expect(objUriInfo.getSelect()) + .andStubReturn(null); + EasyMock.expect(objUriInfo.getOrderBy()) + .andStubReturn(getOrderByExpression()); + EasyMock.expect(objUriInfo.getTop()) + .andStubReturn(getTop()); + EasyMock.expect(objUriInfo.getSkip()) + .andStubReturn(getSkip()); + EasyMock.expect(objUriInfo.getInlineCount()) + .andStubReturn(getInlineCount()); + EasyMock.expect(objUriInfo.getFilter()) + .andStubReturn(getFilter()); + EasyMock.expect(objUriInfo.getFunctionImport()) + .andStubReturn(null); + EasyMock.replay(objUriInfo); + return objUriInfo; + } + + /** + * @return + * @throws EdmException + */ + private EdmEntitySet getLocalEdmEntitySet() { + EdmEntitySet edmEntitySet = EasyMock.createMock(EdmEntitySet.class); + try { + EasyMock.expect(edmEntitySet.getName()) + .andStubReturn(SALES_ORDER_HEADERS); + EasyMock.expect(edmEntitySet.getEntityContainer()) + .andStubReturn(getLocalEdmEntityContainer()); + EasyMock.expect(edmEntitySet.getEntityType()) + .andStubReturn(getLocalEdmEntityType()); + EasyMock.replay(edmEntitySet); + } catch (EdmException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + return edmEntitySet; + } + + /** + * @return + * @throws EdmException + */ + private EdmEntityType getLocalEdmEntityType() { + EdmEntityType edmEntityType = EasyMock.createMock(EdmEntityType.class); + try { + EasyMock.expect(edmEntityType.getKeyProperties()) + .andStubReturn(new ArrayList()); + EasyMock.expect(edmEntityType.getPropertyNames()) + .andStubReturn(getLocalPropertyNames()); + EasyMock.expect(edmEntityType.getProperty(SO_ID)) + .andStubReturn(getEdmTypedMockedObj(SALES_ORDER)); + EasyMock.expect(edmEntityType.getKind()) + .andStubReturn(EdmTypeKind.SIMPLE); + EasyMock.expect(edmEntityType.getNamespace()) + .andStubReturn(SALES_ORDER_HEADERS); + EasyMock.expect(edmEntityType.getName()) + .andStubReturn(SALES_ORDER_HEADERS); + EasyMock.expect(edmEntityType.hasStream()) + .andStubReturn(false); + EasyMock.expect(edmEntityType.getNavigationPropertyNames()) + .andStubReturn(new ArrayList()); + EasyMock.expect(edmEntityType.getKeyPropertyNames()) + .andStubReturn(new ArrayList()); + EasyMock.expect(edmEntityType.getMapping()) + .andStubReturn((EdmMapping) getEdmMappingMockedObj(SALES_ORDER)); + EasyMock.replay(edmEntityType); + } catch (EdmException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + return edmEntityType; + } + + private InlineCount getInlineCount() { + return InlineCount.NONE; + } + + private FilterExpression getFilter() { + return null; + } + + private Integer getSkip() { + return null; + } + + private Integer getTop() { + return null; + } + + private OrderByExpression getOrderByExpression() { + return null; + } + + private ODataJPAContext getLocalmockODataJPAContext() { + ODataJPAContext odataJPAContext = EasyMock.createMock(ODataJPAContext.class); + EasyMock.expect(odataJPAContext.getPageSize()) + .andReturn(0) + .anyTimes(); + EasyMock.expect(odataJPAContext.getPersistenceUnitName()) + .andStubReturn("salesorderprocessing"); + EasyMock.expect(odataJPAContext.getEntityManagerFactory()) + .andStubReturn(mockEntityManagerFactory()); + EasyMock.expect(odataJPAContext.getODataJPATransaction()) + .andStubReturn(getLocalJpaTransaction()); + EasyMock.expect(odataJPAContext.getODataContext()) + .andStubReturn(getLocalODataContext()); + odataJPAContext.setODataContext((ODataContext) EasyMock.anyObject()); + EasyMock.expectLastCall() + .anyTimes(); + EasyMock.expect(odataJPAContext.getEntityManager()) + .andStubReturn(getLocalEntityManager()); + EasyMock.expect(odataJPAContext.isContainerManaged()) + .andReturn(false); + EasyMock.expectLastCall() + .anyTimes(); + EasyMock.replay(odataJPAContext); + return odataJPAContext; + } + + private ODataJPATransaction getLocalJpaTransaction() { + ODataJPATransaction tx = EasyMock.createMock(ODataJPATransaction.class); + tx.begin(); // testing void method + tx.commit();// testing void method + tx.rollback();// testing void method + EasyMock.expect(tx.isActive()) + .andReturn(false); + EasyMock.expect(tx.isActive()) + .andReturn(false); + EasyMock.replay(tx); + return tx; + } + + private EntityManagerFactory mockEntityManagerFactory() { + EntityManagerFactory emf = EasyMock.createMock(EntityManagerFactory.class); + EasyMock.expect(emf.getMetamodel()) + .andStubReturn(mockMetaModel()); + EasyMock.expect(emf.createEntityManager()) + .andStubReturn(getLocalEntityManager()); + EasyMock.replay(emf); + return emf; + } + + private EntityManagerFactory mockEntityManagerFactory2() {// For create, to avoid stackoverflow + EntityManagerFactory emf = EasyMock.createMock(EntityManagerFactory.class); + EasyMock.expect(emf.getMetamodel()) + .andStubReturn(mockMetaModel()); + EasyMock.replay(emf); + return emf; + } + + private EntityManager getLocalEntityManager() { + EntityManager em = EasyMock.createMock(EntityManager.class); + EasyMock.expect(em.createQuery("SELECT E1 FROM SalesOrderHeaders E1")) + .andStubReturn(getQuery()); + EasyMock.expect(em.createQuery("SELECT COUNT ( E1 ) FROM SalesOrderHeaders E1")) + .andStubReturn(getQueryForSelectCount()); + EasyMock.expect(em.getEntityManagerFactory()) + .andStubReturn(mockEntityManagerFactory2());// For create + EasyMock.expect(em.getTransaction()) + .andStubReturn(getLocalTransaction()); // For Delete + EasyMock.expect(em.isOpen()) + .andReturn(true) + .anyTimes(); + Address obj = new Address(); + em.remove(obj);// testing void method + em.flush(); + em.close(); + EasyMock.expectLastCall() + .anyTimes(); + EasyMock.replay(em); + return em; + } + + private EntityTransaction getLocalTransaction() { + EntityTransaction entityTransaction = EasyMock.createMock(EntityTransaction.class); + entityTransaction.begin(); // testing void method + entityTransaction.commit();// testing void method + entityTransaction.rollback();// testing void method + EasyMock.expect(entityTransaction.isActive()) + .andReturn(false); + EasyMock.replay(entityTransaction); + return entityTransaction; + } + + private Query getQuery() { + Query query = EasyMock.createMock(Query.class); + EasyMock.expect(query.getResultList()) + .andStubReturn(getResultList()); + EasyMock.replay(query); + return query; + } + + private Query getQueryForSelectCount() { + Query query = EasyMock.createMock(Query.class); + EasyMock.expect(query.getResultList()) + .andStubReturn(getResultListForSelectCount()); + EasyMock.replay(query); + return query; + } + + private List> getResultList() { + List list = new ArrayList(); + list.add(new Address()); + return list; + } + + private List> getResultListForSelectCount() { + List list = new ArrayList(); + list.add(new Long(11)); + return list; + } + + class Address { + private final String soId = "12"; + + public String getSoId() { + return soId; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + getEnclosingInstance().hashCode(); + return prime * result + Objects.hash(soId); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + Address other = (Address) obj; + if (!getEnclosingInstance().equals(other.getEnclosingInstance())) { + return false; + } + return Objects.equals(soId, other.soId); + } + + private ODataJPADefaultProcessorTest getEnclosingInstance() { + return ODataJPADefaultProcessorTest.this; + } + + } + + private Metamodel mockMetaModel() { + Metamodel metaModel = EasyMock.createMock(Metamodel.class); + EasyMock.expect(metaModel.getEntities()) + .andStubReturn(getLocalEntities()); + EasyMock.replay(metaModel); + return metaModel; + } + + private Set> getLocalEntities() { + Set> entityTypeSet = new HashSet>(); + entityTypeSet.add(getLocalJPAEntityType()); + return entityTypeSet; + } + + @SuppressWarnings("rawtypes") + private EntityType getLocalJPAEntityType() { + @SuppressWarnings("unchecked") + EntityType entityType = EasyMock.createMock(EntityType.class); + EasyMock.expect(entityType.getJavaType()) + .andStubReturn(EntityType.class); + EasyMock.replay(entityType); + return entityType; + } + + private GetEntityUriInfo getEntityUriInfo() { + GetEntityUriInfo getEntityView = EasyMock.createMock(GetEntityUriInfo.class); + EdmEntitySet edmEntitySet = EasyMock.createMock(EdmEntitySet.class); + EdmEntityType edmEntityType = EasyMock.createMock(EdmEntityType.class); + try { + EasyMock.expect(getEntityView.getExpand()) + .andStubReturn(null); + EasyMock.expect(edmEntityType.getKeyProperties()) + .andStubReturn(new ArrayList()); + EasyMock.expect(edmEntitySet.getEntityType()) + .andStubReturn(edmEntityType); + EasyMock.expect(edmEntitySet.getName()) + .andStubReturn(SALES_ORDER_HEADERS); + + EasyMock.expect(getEntityView.getSelect()) + .andStubReturn(null); + EasyMock.expect(getEntityView.getTargetEntitySet()) + .andStubReturn(edmEntitySet); + EasyMock.expect(edmEntityType.getPropertyNames()) + .andStubReturn(getLocalPropertyNames()); + EasyMock.expect(edmEntityType.getProperty(SO_ID)) + .andStubReturn(getEdmTypedMockedObj(SO_ID)); + + EasyMock.expect(edmEntityType.getMapping()) + .andStubReturn((EdmMapping) getEdmMappingMockedObj(SALES_ORDER)); + + EasyMock.expect(edmEntityType.getKind()) + .andStubReturn(EdmTypeKind.SIMPLE); + EasyMock.expect(edmEntityType.getNamespace()) + .andStubReturn(SALES_ORDER_HEADERS); + EasyMock.expect(edmEntityType.getName()) + .andStubReturn(SALES_ORDER_HEADERS); + EasyMock.expect(edmEntityType.hasStream()) + .andStubReturn(false); + EasyMock.expect(edmEntityType.getNavigationPropertyNames()) + .andStubReturn(new ArrayList()); + EasyMock.expect(edmEntityType.getKeyPropertyNames()) + .andStubReturn(new ArrayList()); + + EasyMock.expect(edmEntitySet.getEntityContainer()) + .andStubReturn(getLocalEdmEntityContainer()); + + EasyMock.replay(edmEntityType, edmEntitySet); + EasyMock.expect(getEntityView.getKeyPredicates()) + .andStubReturn(new ArrayList()); + List navigationSegments = new ArrayList(); + EasyMock.expect(getEntityView.getNavigationSegments()) + .andReturn(navigationSegments); + EasyMock.expect(getEntityView.getStartEntitySet()) + .andReturn(edmEntitySet); + + EasyMock.replay(getEntityView); + } catch (EdmException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + return getEntityView; + } + + private EdmEntityContainer getLocalEdmEntityContainer() { + EdmEntityContainer edmEntityContainer = EasyMock.createMock(EdmEntityContainer.class); + EasyMock.expect(edmEntityContainer.isDefaultEntityContainer()) + .andStubReturn(true); + try { + EasyMock.expect(edmEntityContainer.getName()) + .andStubReturn(SALESORDERPROCESSING_CONTAINER); + } catch (EdmException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + + EasyMock.replay(edmEntityContainer); + return edmEntityContainer; + } + + private EdmTyped getEdmTypedMockedObj(final String propertyName) { + EdmProperty mockedEdmProperty = EasyMock.createMock(EdmProperty.class); + try { + EasyMock.expect(mockedEdmProperty.getMapping()) + .andStubReturn((EdmMapping) getEdmMappingMockedObj(propertyName)); + EdmType edmType = EasyMock.createMock(EdmType.class); + EasyMock.expect(edmType.getKind()) + .andStubReturn(EdmTypeKind.SIMPLE); + EasyMock.replay(edmType); + EasyMock.expect(mockedEdmProperty.getName()) + .andStubReturn("identifier"); + EasyMock.expect(mockedEdmProperty.getType()) + .andStubReturn(edmType); + EasyMock.expect(mockedEdmProperty.getFacets()) + .andStubReturn(getEdmFacetsMockedObj()); + + EasyMock.replay(mockedEdmProperty); + } catch (EdmException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + return mockedEdmProperty; + } + + private EdmFacets getEdmFacetsMockedObj() { + EdmFacets facets = EasyMock.createMock(EdmFacets.class); + EasyMock.expect(facets.getConcurrencyMode()) + .andStubReturn(EdmConcurrencyMode.Fixed); + + EasyMock.replay(facets); + return facets; + } + + private JPAEdmMapping getEdmMappingMockedObj(final String propertyName) { + JPAEdmMappingImpl mockedEdmMapping = EasyMock.createMock(JPAEdmMappingImpl.class); + if (propertyName.equalsIgnoreCase(SALES_ORDER)) { + EasyMock.expect(((EdmMapping) mockedEdmMapping).getInternalName()) + .andStubReturn(SALES_ORDER_HEADERS); + } else { + EasyMock.expect(((EdmMapping) mockedEdmMapping).getInternalName()) + .andStubReturn(propertyName); + } + EasyMock.expect(mockedEdmMapping.getODataJPATombstoneEntityListener()) + .andReturn(null); + EasyMock.>expect(mockedEdmMapping.getJPAType()) + .andReturn(SalesOrderHeader.class); + EasyMock.replay(mockedEdmMapping); + return mockedEdmMapping; + } + + private List getLocalPropertyNames() { + List list = new ArrayList(); + list.add(SO_ID); + return list; + } + + private ODataContext getLocalODataContext() { + ODataContext objODataContext = null; + try { + ODataContextMock contextMock = new ODataContextMock(); + contextMock.setODataService(new ODataServiceMock().mock()); + contextMock.setPathInfo(getLocalPathInfo()); + objODataContext = contextMock.mock(); + + } catch (ODataException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + return objODataContext; + } + + private PathInfo getLocalPathInfo() { + PathInfo pathInfo = EasyMock.createMock(PathInfo.class); + EasyMock.expect(pathInfo.getServiceRoot()) + .andStubReturn(getLocalURI()); + EasyMock.replay(pathInfo); + return pathInfo; + } + + private URI getLocalURI() { + URI uri = null; + try { + uri = new URI(STR_LOCAL_URI); + } catch (URISyntaxException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + return uri; + } } diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/ODataJPAResponseBuilderTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/ODataJPAResponseBuilderTest.java index 7105c3dbb..d94f8829b 100644 --- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/ODataJPAResponseBuilderTest.java +++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/ODataJPAResponseBuilderTest.java @@ -1,20 +1,16 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.core; @@ -22,7 +18,6 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; - import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URI; @@ -32,7 +27,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; - import org.apache.olingo.odata2.api.commons.InlineCount; import org.apache.olingo.odata2.api.edm.EdmEntityContainer; import org.apache.olingo.odata2.api.edm.EdmEntitySet; @@ -76,658 +70,719 @@ public class ODataJPAResponseBuilderTest extends JPAEdmTestModelView { - private ODataJPAResponseBuilder responseBuilder; - - @Before - public void init() { - responseBuilder = new ODataJPAResponseBuilderDefault(getODataJPAContext()); - } - - /* - * This Unit is supposed to test the building of Entity Provider Properties for query with $expand - */ - @Test - public void testGetEntityProviderPropertiesQuery() { - GetEntitySetUriInfo getEntitySetUriInfo = mockEntitySetUriInfoForExpand(); - ODataJPAContext oDataJPAContext = getODataJPAContext(); - // Building the edm entity - List> edmEntityList = new ArrayList>(); - Map edmEntity = new HashMap(); - edmEntity.put("ID", 1); - edmEntityList.add(edmEntity); - // Invoking the private static method using reflection - Class> clazz = ODataJPAResponseBuilderDefault.class; - Object[] actualParameters = { oDataJPAContext, getEntitySetUriInfo, edmEntityList }; - Class>[] formalParameters = { ODataJPAContext.class, GetEntitySetUriInfo.class, List.class }; - EntityProviderWriteProperties providerProperties = null; - try { - Method method = clazz.getDeclaredMethod("getEntityProviderProperties", formalParameters); - method.setAccessible(true); - providerProperties = (EntityProviderWriteProperties) method.invoke(responseBuilder, actualParameters); - assertEquals(1, providerProperties.getExpandSelectTree().getLinks().size()); - } catch (SecurityException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } catch (NoSuchMethodException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } catch (IllegalArgumentException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } catch (IllegalAccessException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } catch (InvocationTargetException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - } - - /* - * This Unit is supposed to test the building of Entity Provider Properties for read with $expand - */ - @Test - public void testGetEntityProviderPropertiesRead() { - - // Getting the EntityUriInfo - GetEntityUriInfo getEntityUriInfo = mockEntityUriInfoForExpand(); - ODataJPAContext oDataJPAContext = getODataJPAContext(); - Class> clazz = ODataJPAResponseBuilderDefault.class; - Object[] actualParameters = { oDataJPAContext, getEntityUriInfo }; - Class>[] formalParameters = { ODataJPAContext.class, GetEntityUriInfo.class }; - EntityProviderWriteProperties providerProperties = null; - try { - Method method = clazz.getDeclaredMethod("getEntityProviderProperties", formalParameters); - method.setAccessible(true); - providerProperties = (EntityProviderWriteProperties) method.invoke(responseBuilder, actualParameters); - assertEquals(1, providerProperties.getExpandSelectTree().getLinks().size()); - } catch (SecurityException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } catch (NoSuchMethodException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } catch (IllegalArgumentException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } catch (IllegalAccessException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } catch (InvocationTargetException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - - } - - @SuppressWarnings("unchecked") - @Test - public void testConstructListofNavProperty() { - List> expand = new ArrayList>(); - ArrayList navPropList1 = new ArrayList(); - navPropList1.add(getNavigationPropertySegment("DemoNavigationProperties11")); - navPropList1.add(getNavigationPropertySegment("DemoNavigationProperties12")); - expand.add(navPropList1); - ArrayList navPropList2 = new ArrayList(); - navPropList2.add(getNavigationPropertySegment("DemoNavigationProperties21")); - navPropList2.add(getNavigationPropertySegment("DemoNavigationProperties22")); - expand.add(navPropList2); - Class> clazz = ODataJPAResponseBuilderDefault.class; - Object[] actualParameters = { expand }; - Class>[] formalParameters = { List.class }; - List navigationProperties = null; - try { - Method method = clazz.getDeclaredMethod("constructListofNavProperty", formalParameters); - method.setAccessible(true); - navigationProperties = (List) method.invoke(responseBuilder, actualParameters); - assertEquals("DemoNavigationProperties21", navigationProperties.get(1).getName()); - assertEquals("DemoNavigationProperties11", navigationProperties.get(0).getName()); - } catch (SecurityException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } catch (NoSuchMethodException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } catch (IllegalArgumentException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } catch (IllegalAccessException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } catch (InvocationTargetException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } catch (EdmException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - - } - - @Test - public void testBuildListOfTGetEntitySetUriInfoStringODataJPAContext() { - try { - assertNotNull(responseBuilder.build(getResultsView(), getJPAEntities(), "application/xml")); - } catch (ODataJPARuntimeException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - - } - - @Test - public void testBuildNegatives() {// Bad content type - try { - EntityType entity = new EntityType(); - entity.setName("SalesOrderHeader"); - try { - assertNotNull(responseBuilder.build(getLocalGetURIInfo(), getEntity(), "xml")); - } catch (ODataNotFoundException e) { - assertTrue(true); - } - } catch (ODataJPARuntimeException e) { - assertTrue(true);// Nothing to do, Expected. - } - try {// Bad content type - assertNotNull(responseBuilder.build(getResultsView(), getJPAEntities(), "xml")); - } catch (ODataJPARuntimeException e) { - assertTrue(true);// Nothing to do, Expected. - } - - } - - @Test - public void testBuildObjectGetEntityUriInfoStringODataJPAContext() throws ODataNotFoundException { - try { - assertNotNull(responseBuilder.build(getLocalGetURIInfo(), (Object) new SalesOrderHeader(2, 10), - "application/xml")); - } catch (ODataJPARuntimeException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - } - - @Test - public void testBuildNullSelects() {// Bad content type - try { - responseBuilder.build(getResultsViewWithNullSelects(), getJPAEntities(), "xml"); - } catch (ODataJPARuntimeException e) { - assertTrue(true);// Nothing to do, Expected. - } catch (Exception e) { - assertTrue(true); - } - } - - @Test - public void testBuildGetCount() { - ODataResponse objODataResponse = null; - try { - objODataResponse = responseBuilder.build(1); - } catch (ODataJPARuntimeException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - assertNotNull(objODataResponse); - } - - private ODataJPAContext getODataJPAContext() { - ODataJPAContext objODataJPAContext = EasyMock.createMock(ODataJPAContext.class); - EasyMock.expect(objODataJPAContext.getODataContext()).andStubReturn(getLocalODataContext()); - EasyMock.expect(objODataJPAContext.getPageSize()).andReturn(10); - EasyMock.expect(objODataJPAContext.getPaging()).andReturn(mockJPAPaging()).anyTimes(); - EasyMock.replay(objODataJPAContext); - return objODataJPAContext; - } - - private ODataContext getLocalODataContext() { - ODataContext objODataContext = EasyMock.createMock(ODataContext.class); - try { - EasyMock.expect(objODataContext.getPathInfo()).andStubReturn(getLocalPathInfo()); - } catch (ODataException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - EasyMock.replay(objODataContext); - return objODataContext; - } - - private JPAPaging mockJPAPaging() { - JPAPaging paging = new JPAPaging() { - - @Override - public int getStartPage() { - return 0; - } - - @Override - public List getPagedEntities() { - return null; - } - - @Override - public int getPageSize() { - return 10; - } - - @Override - public int getNextPage() { - return 10; - } - }; - - return paging; - } - - private PathInfo getLocalPathInfo() { - PathInfo pathInfo = EasyMock.createMock(PathInfo.class); - EasyMock.expect(pathInfo.getServiceRoot()).andStubReturn(getLocalURI()); - EasyMock.expect(pathInfo.getRequestUri()).andStubReturn(getRequestURI()); - EasyMock.replay(pathInfo); - return pathInfo; - } - - private URI getRequestURI() { - URI uri = null; - try { - uri = new URI("SalesOrders"); - } catch (URISyntaxException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - return uri; - } - - private URI getLocalURI() { - URI uri = null; - try { - uri = new URI("http://localhost:8080/org.apache.olingo.odata2.processor.ref.web/"); - } catch (URISyntaxException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - return uri; - } - - private GetEntitySetUriInfo getResultsView() { - GetEntitySetUriInfo objGetEntitySetUriInfo = EasyMock.createMock(GetEntitySetUriInfo.class); - EasyMock.expect(objGetEntitySetUriInfo.getInlineCount()).andStubReturn(getLocalInlineCount()); - EasyMock.expect(objGetEntitySetUriInfo.getTargetEntitySet()).andStubReturn(getLocalTargetEntitySet()); - EasyMock.expect(objGetEntitySetUriInfo.getSelect()).andStubReturn(getSelectItemList()); - EasyMock.expect(objGetEntitySetUriInfo.getExpand()).andStubReturn(getExpandList()); - EasyMock.expect(objGetEntitySetUriInfo.getSkip()).andStubReturn(new Integer(1)); - EasyMock.replay(objGetEntitySetUriInfo); - return objGetEntitySetUriInfo; - } - - private List> getExpandList() { - List> expandList = new ArrayList>(); - return expandList; - } - - private GetEntitySetUriInfo getResultsViewWithNullSelects() { - GetEntitySetUriInfo objGetEntitySetUriInfo = EasyMock.createMock(GetEntitySetUriInfo.class); - EasyMock.expect(objGetEntitySetUriInfo.getInlineCount()).andStubReturn(getLocalInlineCount()); - EasyMock.expect(objGetEntitySetUriInfo.getTargetEntitySet()).andStubReturn(getLocalTargetEntitySet()); - EasyMock.expect(objGetEntitySetUriInfo.getSelect()).andStubReturn(null); - EasyMock.expect(objGetEntitySetUriInfo.getExpand()).andStubReturn(null); - EasyMock.expect(objGetEntitySetUriInfo.getSkip()).andStubReturn(new Integer(1)); - - EasyMock.replay(objGetEntitySetUriInfo); - return objGetEntitySetUriInfo; - } - - private GetEntityUriInfo getLocalGetURIInfo() { - GetEntityUriInfo objGetEntityUriInfo = EasyMock.createMock(GetEntityUriInfo.class); - EasyMock.expect(objGetEntityUriInfo.getSelect()).andStubReturn(getSelectItemList()); - EasyMock.expect(objGetEntityUriInfo.getTargetEntitySet()).andStubReturn(getLocalTargetEntitySet()); - EasyMock.expect(objGetEntityUriInfo.getExpand()).andStubReturn(getExpandList()); - EasyMock.replay(objGetEntityUriInfo); - return objGetEntityUriInfo; - } - - private List getSelectItemList() { - List selectItems = new ArrayList(); - selectItems.add(getSelectItem()); - return selectItems; - } - - private SelectItem getSelectItem() { - SelectItem selectItem = EasyMock.createMock(SelectItem.class); - EasyMock.expect(selectItem.getProperty()).andStubReturn(getEdmPropertyForSelect()); - List navigationSegmentList = new ArrayList(); - EasyMock.expect(selectItem.getNavigationPropertySegments()).andStubReturn(navigationSegmentList); - EasyMock.expect(selectItem.isStar()).andReturn(false).anyTimes(); - EasyMock.replay(selectItem); - return selectItem; - } - - private EdmProperty getEdmPropertyForSelect() { - EdmSimpleType edmType = EasyMock.createMock(EdmSimpleType.class); - EasyMock.expect(edmType.getKind()).andStubReturn(EdmTypeKind.SIMPLE); - Facets facets = new Facets().setNullable(false); - try { - EasyMock.expect(edmType.valueToString(new Integer(2), EdmLiteralKind.URI, facets)).andStubReturn("2"); - EasyMock.expect(edmType.valueToString(new Integer(2), EdmLiteralKind.DEFAULT, facets)).andStubReturn("2"); - } catch (EdmSimpleTypeException e1) { - fail("There is an exception in mocking EdmType object " + e1.getMessage()); - } - EasyMock.replay(edmType); - EdmProperty edmProperty = EasyMock.createMock(EdmProperty.class); - JPAEdmMappingImpl edmMapping = EasyMock.createMock(JPAEdmMappingImpl.class); - EasyMock.expect(edmMapping.getInternalName()).andStubReturn("soId"); - EasyMock.expect(edmMapping.getMediaResourceMimeTypeKey()).andReturn(null); - EasyMock.expect(((JPAEdmMappingImpl) edmMapping).isVirtualAccess()).andStubReturn(false); - EasyMock.replay(edmMapping); - try { - EasyMock.expect(edmProperty.getName()).andStubReturn("ID"); - EasyMock.expect(edmProperty.getType()).andStubReturn(edmType); - EasyMock.expect(edmProperty.getMapping()).andStubReturn(edmMapping); - EasyMock.expect(edmProperty.getFacets()).andStubReturn(facets); - EasyMock.expect(edmProperty.getCustomizableFeedMappings()).andStubReturn(null); - EasyMock.expect(edmProperty.getMimeType()).andStubReturn(null); - EasyMock.replay(edmProperty); - - } catch (EdmException e) { - fail("There is an exception in mocking some object " + e.getMessage()); - } - - return edmProperty; - - } - - private EdmEntitySet getLocalTargetEntitySet() { - EdmEntitySet objEdmEntitySet = EasyMock.createMock(EdmEntitySet.class); - try { - EasyMock.expect(objEdmEntitySet.getEntityType()).andStubReturn(getLocalEdmEntityType()); - EasyMock.expect(objEdmEntitySet.getName()).andStubReturn("SalesOderHeaders"); - EasyMock.expect(objEdmEntitySet.getEntityContainer()).andStubReturn(getLocalEdmEntityContainer()); - } catch (EdmException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - - EasyMock.replay(objEdmEntitySet); - return objEdmEntitySet; - } - - private EdmEntityContainer getLocalEdmEntityContainer() { - EdmEntityContainer edmEntityContainer = EasyMock.createMock(EdmEntityContainer.class); - EasyMock.expect(edmEntityContainer.isDefaultEntityContainer()).andStubReturn(true); - try { - EasyMock.expect(edmEntityContainer.getName()).andStubReturn("salesorderprocessingContainer"); - } catch (EdmException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - - EasyMock.replay(edmEntityContainer); - return edmEntityContainer; - } - - private EdmEntityType getLocalEdmEntityType() { - EdmEntityType objEdmEntityType = EasyMock.createMock(EdmEntityType.class); - try { - EasyMock.expect(objEdmEntityType.getName()).andStubReturn("SalesOderHeaders"); - EasyMock.expect(objEdmEntityType.getNamespace()).andStubReturn("SalesOderHeaders"); - EasyMock.expect(objEdmEntityType.getKind()).andStubReturn(EdmTypeKind.ENTITY); - EasyMock.expect(objEdmEntityType.hasStream()).andStubReturn(false); - EasyMock.expect(objEdmEntityType.hasStream()).andStubReturn(false); - ArrayList propertyNames = new ArrayList(); - propertyNames.add("ID"); - EasyMock.expect(objEdmEntityType.getProperty("ID")).andStubReturn(getEdmPropertyForSelect()); - EasyMock.expect(objEdmEntityType.getPropertyNames()).andStubReturn(propertyNames); - EasyMock.expect(objEdmEntityType.getNavigationPropertyNames()).andStubReturn(new ArrayList()); - EasyMock.expect(objEdmEntityType.getKeyPropertyNames()).andStubReturn(propertyNames); - EasyMock.expect(objEdmEntityType.getKeyProperties()).andStubReturn(getKeyProperties()); - } catch (EdmException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - EasyMock.replay(objEdmEntityType); - return objEdmEntityType; - } - - private List getKeyProperties() { - List edmProperties = new ArrayList(); - EdmType edmType = EasyMock.createMock(EdmType.class); - EasyMock.expect(edmType.getKind()).andStubReturn(EdmTypeKind.SIMPLE); - EasyMock.replay(edmType); - EdmProperty edmProperty = EasyMock.createMock(EdmProperty.class); - EdmMapping edmMapping = EasyMock.createMock(EdmMapping.class); - EasyMock.expect(edmMapping.getInternalName()).andStubReturn("soId"); - EasyMock.replay(edmMapping); - try { - EasyMock.expect(edmProperty.getName()).andStubReturn("ID"); - EasyMock.expect(edmProperty.getType()).andStubReturn(edmType); - EasyMock.expect(edmProperty.getMapping()).andStubReturn(edmMapping); - EasyMock.replay(edmProperty); - } catch (EdmException e) { - fail("There is an exception is mocking some object " + e.getMessage()); - } - - edmProperties.add(edmProperty); - return edmProperties; - } - - private InlineCount getLocalInlineCount() { - return InlineCount.NONE; - } - - class SalesOrderHeader { - private int soId; - private int Field1; - - public SalesOrderHeader(final int soId, final int field) { - this.soId = soId; - Field1 = field; - } - - public int getField1() { - return Field1; - } - - public void setField1(final int field1) { - Field1 = field1; - } - - public int getSoId() { - return soId; - } - - public void setSoId(final int soId) { - this.soId = soId; - } - - } - - private List getJPAEntities() { - List listJPAEntities = new ArrayList(); - SalesOrderHeader entity; - entity = new SalesOrderHeader(2, 10); - listJPAEntities.add(entity); - return listJPAEntities; - } - - private Object getEntity() { - SalesOrderHeader sHeader = new SalesOrderHeader(10, 34); - return sHeader; - } - - private GetEntityUriInfo mockEntityUriInfoForExpand() { - - List selectItemList = new ArrayList(); - List> expandList = new ArrayList>(); - ArrayList navigationPropertyList = new ArrayList(); - // Mocking the navigation property - EdmNavigationProperty navigationProperty = EasyMock.createMock(EdmNavigationProperty.class); - try { - EasyMock.expect(navigationProperty.getName()).andStubReturn("SalesOrderItemDetails"); - } catch (EdmException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - EasyMock.replay(navigationProperty); - // Mocking the navigation property segments and adding to expand list - NavigationPropertySegment navigationPropertySegment = EasyMock.createMock(NavigationPropertySegment.class); - EasyMock.expect(navigationPropertySegment.getNavigationProperty()).andStubReturn(navigationProperty); - EasyMock.expect(navigationPropertySegment.getTargetEntitySet()).andStubReturn(getTargetEntitySetForExpand()); - EasyMock.replay(navigationPropertySegment); - navigationPropertyList.add(navigationPropertySegment); - expandList.add(navigationPropertyList); - // Mocking EntityUriInfo - GetEntityUriInfo entityUriInfo = EasyMock.createMock(GetEntityUriInfo.class); - EasyMock.expect(entityUriInfo.getSelect()).andStubReturn(selectItemList); - EasyMock.expect(entityUriInfo.getExpand()).andStubReturn(expandList); - EasyMock.replay(entityUriInfo); - return entityUriInfo; - } - - private GetEntitySetUriInfo mockEntitySetUriInfoForExpand() { - - List selectItemList = new ArrayList(); - List> expandList = new ArrayList>(); - ArrayList navigationPropertyList = new ArrayList(); - // Mocking the navigation property - EdmNavigationProperty navigationProperty = EasyMock.createMock(EdmNavigationProperty.class); - try { - EasyMock.expect(navigationProperty.getName()).andStubReturn("SalesOrderItemDetails"); - } catch (EdmException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - EasyMock.replay(navigationProperty); - // Mocking the navigation property segments and adding to expand list - NavigationPropertySegment navigationPropertySegment = EasyMock.createMock(NavigationPropertySegment.class); - EasyMock.expect(navigationPropertySegment.getNavigationProperty()).andStubReturn(navigationProperty); - EasyMock.expect(navigationPropertySegment.getTargetEntitySet()).andStubReturn(getTargetEntitySetForExpand()); - EasyMock.replay(navigationPropertySegment); - navigationPropertyList.add(navigationPropertySegment); - expandList.add(navigationPropertyList); - // Mocking EntityUriInfo - UriInfoImpl entitySetUriInfo = EasyMock.createMock(UriInfoImpl.class); - EasyMock.expect(entitySetUriInfo.getSelect()).andStubReturn(selectItemList); - EasyMock.expect(entitySetUriInfo.getExpand()).andStubReturn(expandList); - EasyMock.expect(entitySetUriInfo.getInlineCount()).andStubReturn(InlineCount.ALLPAGES); - EasyMock.expect(entitySetUriInfo.getSkip()).andStubReturn(new Integer(1)); - EasyMock.expect(entitySetUriInfo.getTop()).andStubReturn(new Integer(2)); - Map customQuery = new HashMap(); - customQuery.put("count", "5"); - entitySetUriInfo.setCustomQueryOptions(null); - EasyMock.expectLastCall().times(1); - EasyMock.expect(entitySetUriInfo.getCustomQueryOptions()).andStubReturn(customQuery ); - EasyMock.replay(entitySetUriInfo); - return entitySetUriInfo; - } - - private EdmEntitySet getTargetEntitySetForExpand() { - EdmEntitySet entitySet = EasyMock.createMock(EdmEntitySet.class); - try { - EasyMock.expect(entitySet.getName()).andStubReturn("SalesOrderHeaders"); - EasyMock.expect(entitySet.getEntityType()).andStubReturn(null); - } catch (EdmException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - EasyMock.replay(entitySet); - return entitySet; - } - - private NavigationPropertySegment getNavigationPropertySegment(final String navPropertyName) { - EdmNavigationProperty navigationProperty = EasyMock.createMock(EdmNavigationProperty.class); - try { - EasyMock.expect(navigationProperty.getName()).andStubReturn(navPropertyName); - } catch (EdmException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - EasyMock.replay(navigationProperty); - NavigationPropertySegment navPropertySegment = EasyMock.createMock(NavigationPropertySegment.class); - EasyMock.expect(navPropertySegment.getNavigationProperty()).andStubReturn(navigationProperty); - EasyMock.replay(navPropertySegment); - return navPropertySegment; - } - - private GetFunctionImportUriInfo mockFunctionImportUriInfo() { - - List selectItemList = new ArrayList(); - List> expandList = new - ArrayList>(); - ArrayList navigationPropertyList = new ArrayList(); - // Mocking the navigation property - EdmNavigationProperty navigationProperty = EasyMock.createMock(EdmNavigationProperty.class); - try { - EasyMock.expect(navigationProperty.getName()).andStubReturn("SalesOrderItemDetails"); - } catch (EdmException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + - ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - EasyMock.replay(navigationProperty); - - // Mocking the navigation property segments and adding to expand list - NavigationPropertySegment navigationPropertySegment = EasyMock.createMock(NavigationPropertySegment.class); - EasyMock.expect(navigationPropertySegment.getNavigationProperty()).andStubReturn(navigationProperty); - EasyMock.expect(navigationPropertySegment.getTargetEntitySet()) - .andStubReturn(getTargetEntitySetForExpand()); - EasyMock.replay(navigationPropertySegment); - navigationPropertyList.add(navigationPropertySegment); - expandList.add(navigationPropertyList); - // Mocking EntityUriInfo - UriInfoImpl functionImportUriInfo = EasyMock.createMock(UriInfoImpl.class); - EasyMock.expect(functionImportUriInfo.getSelect()).andStubReturn(selectItemList); - EasyMock.expect(functionImportUriInfo.getExpand()).andStubReturn(expandList); - EasyMock.expect(functionImportUriInfo.getInlineCount()).andStubReturn(InlineCount.ALLPAGES); - EasyMock.expect(functionImportUriInfo.getFunctionImport()).andStubReturn(mockEdmFunctionImport()); - EasyMock.expect(functionImportUriInfo.getCustomQueryOptions()).andStubReturn(null); - EasyMock.replay(functionImportUriInfo); - return functionImportUriInfo; - } - - private EdmFunctionImport mockEdmFunctionImport() { - EdmFunctionImport funcImport = EasyMock.createMock(EdmFunctionImport.class); - try { - EasyMock.expect(funcImport.getName()).andStubReturn("FindAllSalesOrders"); - EasyMock.expect(funcImport.getEntitySet()).andStubReturn(getLocalTargetEntitySet()); - EasyMock.expect(funcImport.getParameterNames()).andStubReturn( - Arrays.asList("DeliveryStatusCode")); - EdmTyped typed = EasyMock.createMock(EdmTyped.class); - EasyMock.expect(typed.getName()).andStubReturn("SalesOrder"); - EasyMock.expect(typed.getMultiplicity()).andStubReturn(EdmMultiplicity.MANY); - EasyMock.expect(typed.getType()).andStubReturn(getLocalEdmEntityType()); - EasyMock.replay(typed); - EasyMock.expect(funcImport.getReturnType()).andStubReturn(typed); - } catch (EdmException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + - e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - EasyMock.replay(funcImport); - return funcImport; - } - /* - * This Unit is supposed to test the building of Entity Provider Properties for function import - */ - @Test - public void testFunctionImportProviderProperties() { - - // Getting the EntityUriInfo - GetFunctionImportUriInfo getfuncImportUriInfo = mockFunctionImportUriInfo(); - ODataJPAContext oDataJPAContext = getODataJPAContext(); - Class> clazz = ODataJPAResponseBuilderDefault.class; - // Building the edm entity - List> edmEntityList = new ArrayList>(); - Map edmEntity = new HashMap(); - edmEntity.put("ID", 1); - edmEntityList.add(edmEntity); - Object[] actualParameters = { oDataJPAContext, getfuncImportUriInfo, edmEntityList }; - Class>[] formalParameters = { ODataJPAContext.class, GetFunctionImportUriInfo.class, List.class }; - EntityProviderWriteProperties providerProperties = null; - try { - Method method = clazz.getDeclaredMethod("getEntityProviderProperties", formalParameters); - method.setAccessible(true); - providerProperties = (EntityProviderWriteProperties) method.invoke(responseBuilder, actualParameters); - assertEquals(1, providerProperties.getExpandSelectTree().getLinks().size()); - assertEquals(InlineCount.ALLPAGES, providerProperties.getInlineCountType()); - } catch (SecurityException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } catch (NoSuchMethodException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } catch (IllegalArgumentException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } catch (IllegalAccessException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } catch (InvocationTargetException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - - } - - @Test - public void testBuildListOfGetFunctionimportUriInfo() throws Exception { - try { - assertNotNull(responseBuilder.build(getFIResultsView(), getJPAEntities(), "application/xml")); - } catch (ODataJPARuntimeException e) { - fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); - } - - } - - private GetFunctionImportUriInfo getFIResultsView() { - GetFunctionImportUriInfo objGetFunctionImportUriInfo = EasyMock.createMock(GetFunctionImportUriInfo.class); - EasyMock.expect(objGetFunctionImportUriInfo.getInlineCount()).andStubReturn(getLocalInlineCount()); - EasyMock.expect(objGetFunctionImportUriInfo.getFunctionImport()).andStubReturn(mockEdmFunctionImport()); - EasyMock.expect(objGetFunctionImportUriInfo.getSelect()).andStubReturn(getSelectItemList()); - EasyMock.expect(objGetFunctionImportUriInfo.getExpand()).andStubReturn(getExpandList()); - EasyMock.replay(objGetFunctionImportUriInfo); - return objGetFunctionImportUriInfo; - } + private ODataJPAResponseBuilder responseBuilder; + + @Before + public void init() { + responseBuilder = new ODataJPAResponseBuilderDefault(getODataJPAContext()); + } + + /* + * This Unit is supposed to test the building of Entity Provider Properties for query with $expand + */ + @Test + public void testGetEntityProviderPropertiesQuery() { + GetEntitySetUriInfo getEntitySetUriInfo = mockEntitySetUriInfoForExpand(); + ODataJPAContext oDataJPAContext = getODataJPAContext(); + // Building the edm entity + List> edmEntityList = new ArrayList>(); + Map edmEntity = new HashMap(); + edmEntity.put("ID", 1); + edmEntityList.add(edmEntity); + // Invoking the private static method using reflection + Class> clazz = ODataJPAResponseBuilderDefault.class; + Object[] actualParameters = {oDataJPAContext, getEntitySetUriInfo, edmEntityList}; + Class>[] formalParameters = {ODataJPAContext.class, GetEntitySetUriInfo.class, List.class}; + EntityProviderWriteProperties providerProperties = null; + try { + Method method = clazz.getDeclaredMethod("getEntityProviderProperties", formalParameters); + method.setAccessible(true); + providerProperties = (EntityProviderWriteProperties) method.invoke(responseBuilder, actualParameters); + assertEquals(1, providerProperties.getExpandSelectTree() + .getLinks() + .size()); + } catch (SecurityException | NoSuchMethodException | IllegalArgumentException | IllegalAccessException + | InvocationTargetException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + } + + /* + * This Unit is supposed to test the building of Entity Provider Properties for read with $expand + */ + @Test + public void testGetEntityProviderPropertiesRead() { + + // Getting the EntityUriInfo + GetEntityUriInfo getEntityUriInfo = mockEntityUriInfoForExpand(); + ODataJPAContext oDataJPAContext = getODataJPAContext(); + Class> clazz = ODataJPAResponseBuilderDefault.class; + Object[] actualParameters = {oDataJPAContext, getEntityUriInfo}; + Class>[] formalParameters = {ODataJPAContext.class, GetEntityUriInfo.class}; + EntityProviderWriteProperties providerProperties = null; + try { + Method method = clazz.getDeclaredMethod("getEntityProviderProperties", formalParameters); + method.setAccessible(true); + providerProperties = (EntityProviderWriteProperties) method.invoke(responseBuilder, actualParameters); + assertEquals(1, providerProperties.getExpandSelectTree() + .getLinks() + .size()); + } catch (SecurityException | NoSuchMethodException | IllegalArgumentException | IllegalAccessException + | InvocationTargetException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + + } + + @SuppressWarnings("unchecked") + @Test + public void testConstructListofNavProperty() { + List> expand = new ArrayList>(); + ArrayList navPropList1 = new ArrayList(); + navPropList1.add(getNavigationPropertySegment("DemoNavigationProperties11")); + navPropList1.add(getNavigationPropertySegment("DemoNavigationProperties12")); + expand.add(navPropList1); + ArrayList navPropList2 = new ArrayList(); + navPropList2.add(getNavigationPropertySegment("DemoNavigationProperties21")); + navPropList2.add(getNavigationPropertySegment("DemoNavigationProperties22")); + expand.add(navPropList2); + Class> clazz = ODataJPAResponseBuilderDefault.class; + Object[] actualParameters = {expand}; + Class>[] formalParameters = {List.class}; + List navigationProperties = null; + try { + Method method = clazz.getDeclaredMethod("constructListofNavProperty", formalParameters); + method.setAccessible(true); + navigationProperties = (List) method.invoke(responseBuilder, actualParameters); + assertEquals("DemoNavigationProperties21", navigationProperties.get(1) + .getName()); + assertEquals("DemoNavigationProperties11", navigationProperties.get(0) + .getName()); + } catch (SecurityException | NoSuchMethodException | IllegalArgumentException | IllegalAccessException | InvocationTargetException + | EdmException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + + } + + @Test + public void testBuildListOfTGetEntitySetUriInfoStringODataJPAContext() { + try { + assertNotNull(responseBuilder.build(getResultsView(), getJPAEntities(), "application/xml")); + } catch (ODataJPARuntimeException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + + } + + @Test + public void testBuildNegatives() {// Bad content type + try { + EntityType entity = new EntityType(); + entity.setName("SalesOrderHeader"); + try { + assertNotNull(responseBuilder.build(getLocalGetURIInfo(), getEntity(), "xml")); + } catch (ODataNotFoundException e) { + assertTrue(true); + } + } catch (ODataJPARuntimeException e) { + assertTrue(true);// Nothing to do, Expected. + } + try {// Bad content type + assertNotNull(responseBuilder.build(getResultsView(), getJPAEntities(), "xml")); + } catch (ODataJPARuntimeException e) { + assertTrue(true);// Nothing to do, Expected. + } + + } + + @Test + public void testBuildObjectGetEntityUriInfoStringODataJPAContext() throws ODataNotFoundException { + try { + assertNotNull(responseBuilder.build(getLocalGetURIInfo(), new SalesOrderHeader(2, 10), "application/xml")); + } catch (ODataJPARuntimeException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + } + + @Test + public void testBuildNullSelects() {// Bad content type + try { + responseBuilder.build(getResultsViewWithNullSelects(), getJPAEntities(), "xml"); + } catch (Exception e) { + assertTrue(true); + } + } + + @Test + public void testBuildGetCount() { + ODataResponse objODataResponse = null; + try { + objODataResponse = responseBuilder.build(1); + } catch (ODataJPARuntimeException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + assertNotNull(objODataResponse); + } + + private ODataJPAContext getODataJPAContext() { + ODataJPAContext objODataJPAContext = EasyMock.createMock(ODataJPAContext.class); + EasyMock.expect(objODataJPAContext.getODataContext()) + .andStubReturn(getLocalODataContext()); + EasyMock.expect(objODataJPAContext.getPageSize()) + .andReturn(10); + EasyMock.expect(objODataJPAContext.getPaging()) + .andReturn(mockJPAPaging()) + .anyTimes(); + EasyMock.replay(objODataJPAContext); + return objODataJPAContext; + } + + private ODataContext getLocalODataContext() { + ODataContext objODataContext = EasyMock.createMock(ODataContext.class); + try { + EasyMock.expect(objODataContext.getPathInfo()) + .andStubReturn(getLocalPathInfo()); + } catch (ODataException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + EasyMock.replay(objODataContext); + return objODataContext; + } + + private JPAPaging mockJPAPaging() { + return new JPAPaging() { + + @Override + public int getStartPage() { + return 0; + } + + @Override + public List getPagedEntities() { + return null; + } + + @Override + public int getPageSize() { + return 10; + } + + @Override + public int getNextPage() { + return 10; + } + }; + } + + private PathInfo getLocalPathInfo() { + PathInfo pathInfo = EasyMock.createMock(PathInfo.class); + EasyMock.expect(pathInfo.getServiceRoot()) + .andStubReturn(getLocalURI()); + EasyMock.expect(pathInfo.getRequestUri()) + .andStubReturn(getRequestURI()); + EasyMock.replay(pathInfo); + return pathInfo; + } + + private URI getRequestURI() { + URI uri = null; + try { + uri = new URI("SalesOrders"); + } catch (URISyntaxException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + return uri; + } + + private URI getLocalURI() { + URI uri = null; + try { + uri = new URI("http://localhost:8080/org.apache.olingo.odata2.processor.ref.web/"); + } catch (URISyntaxException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + return uri; + } + + private GetEntitySetUriInfo getResultsView() { + GetEntitySetUriInfo objGetEntitySetUriInfo = EasyMock.createMock(GetEntitySetUriInfo.class); + EasyMock.expect(objGetEntitySetUriInfo.getInlineCount()) + .andStubReturn(getLocalInlineCount()); + EasyMock.expect(objGetEntitySetUriInfo.getTargetEntitySet()) + .andStubReturn(getLocalTargetEntitySet()); + EasyMock.expect(objGetEntitySetUriInfo.getSelect()) + .andStubReturn(getSelectItemList()); + EasyMock.expect(objGetEntitySetUriInfo.getExpand()) + .andStubReturn(getExpandList()); + EasyMock.expect(objGetEntitySetUriInfo.getSkip()) + .andStubReturn(new Integer(1)); + EasyMock.replay(objGetEntitySetUriInfo); + return objGetEntitySetUriInfo; + } + + private List> getExpandList() { + return new ArrayList>(); + } + + private GetEntitySetUriInfo getResultsViewWithNullSelects() { + GetEntitySetUriInfo objGetEntitySetUriInfo = EasyMock.createMock(GetEntitySetUriInfo.class); + EasyMock.expect(objGetEntitySetUriInfo.getInlineCount()) + .andStubReturn(getLocalInlineCount()); + EasyMock.expect(objGetEntitySetUriInfo.getTargetEntitySet()) + .andStubReturn(getLocalTargetEntitySet()); + EasyMock.expect(objGetEntitySetUriInfo.getSelect()) + .andStubReturn(null); + EasyMock.expect(objGetEntitySetUriInfo.getExpand()) + .andStubReturn(null); + EasyMock.expect(objGetEntitySetUriInfo.getSkip()) + .andStubReturn(new Integer(1)); + + EasyMock.replay(objGetEntitySetUriInfo); + return objGetEntitySetUriInfo; + } + + private GetEntityUriInfo getLocalGetURIInfo() { + GetEntityUriInfo objGetEntityUriInfo = EasyMock.createMock(GetEntityUriInfo.class); + EasyMock.expect(objGetEntityUriInfo.getSelect()) + .andStubReturn(getSelectItemList()); + EasyMock.expect(objGetEntityUriInfo.getTargetEntitySet()) + .andStubReturn(getLocalTargetEntitySet()); + EasyMock.expect(objGetEntityUriInfo.getExpand()) + .andStubReturn(getExpandList()); + EasyMock.replay(objGetEntityUriInfo); + return objGetEntityUriInfo; + } + + private List getSelectItemList() { + List selectItems = new ArrayList(); + selectItems.add(getSelectItem()); + return selectItems; + } + + private SelectItem getSelectItem() { + SelectItem selectItem = EasyMock.createMock(SelectItem.class); + EasyMock.expect(selectItem.getProperty()) + .andStubReturn(getEdmPropertyForSelect()); + List navigationSegmentList = new ArrayList(); + EasyMock.expect(selectItem.getNavigationPropertySegments()) + .andStubReturn(navigationSegmentList); + EasyMock.expect(selectItem.isStar()) + .andReturn(false) + .anyTimes(); + EasyMock.replay(selectItem); + return selectItem; + } + + private EdmProperty getEdmPropertyForSelect() { + EdmSimpleType edmType = EasyMock.createMock(EdmSimpleType.class); + EasyMock.expect(edmType.getKind()) + .andStubReturn(EdmTypeKind.SIMPLE); + Facets facets = new Facets().setNullable(false); + try { + EasyMock.expect(edmType.valueToString(new Integer(2), EdmLiteralKind.URI, facets)) + .andStubReturn("2"); + EasyMock.expect(edmType.valueToString(new Integer(2), EdmLiteralKind.DEFAULT, facets)) + .andStubReturn("2"); + } catch (EdmSimpleTypeException e1) { + fail("There is an exception in mocking EdmType object " + e1.getMessage()); + } + EasyMock.replay(edmType); + EdmProperty edmProperty = EasyMock.createMock(EdmProperty.class); + JPAEdmMappingImpl edmMapping = EasyMock.createMock(JPAEdmMappingImpl.class); + EasyMock.expect(edmMapping.getInternalName()) + .andStubReturn("soId"); + EasyMock.expect(edmMapping.getMediaResourceMimeTypeKey()) + .andReturn(null); + EasyMock.expect(edmMapping.isVirtualAccess()) + .andStubReturn(false); + EasyMock.replay(edmMapping); + try { + EasyMock.expect(edmProperty.getName()) + .andStubReturn("ID"); + EasyMock.expect(edmProperty.getType()) + .andStubReturn(edmType); + EasyMock.expect(edmProperty.getMapping()) + .andStubReturn(edmMapping); + EasyMock.expect(edmProperty.getFacets()) + .andStubReturn(facets); + EasyMock.expect(edmProperty.getCustomizableFeedMappings()) + .andStubReturn(null); + EasyMock.expect(edmProperty.getMimeType()) + .andStubReturn(null); + EasyMock.replay(edmProperty); + + } catch (EdmException e) { + fail("There is an exception in mocking some object " + e.getMessage()); + } + + return edmProperty; + + } + + private EdmEntitySet getLocalTargetEntitySet() { + EdmEntitySet objEdmEntitySet = EasyMock.createMock(EdmEntitySet.class); + try { + EasyMock.expect(objEdmEntitySet.getEntityType()) + .andStubReturn(getLocalEdmEntityType()); + EasyMock.expect(objEdmEntitySet.getName()) + .andStubReturn("SalesOderHeaders"); + EasyMock.expect(objEdmEntitySet.getEntityContainer()) + .andStubReturn(getLocalEdmEntityContainer()); + } catch (EdmException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + + EasyMock.replay(objEdmEntitySet); + return objEdmEntitySet; + } + + private EdmEntityContainer getLocalEdmEntityContainer() { + EdmEntityContainer edmEntityContainer = EasyMock.createMock(EdmEntityContainer.class); + EasyMock.expect(edmEntityContainer.isDefaultEntityContainer()) + .andStubReturn(true); + try { + EasyMock.expect(edmEntityContainer.getName()) + .andStubReturn("salesorderprocessingContainer"); + } catch (EdmException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + + EasyMock.replay(edmEntityContainer); + return edmEntityContainer; + } + + private EdmEntityType getLocalEdmEntityType() { + EdmEntityType objEdmEntityType = EasyMock.createMock(EdmEntityType.class); + try { + EasyMock.expect(objEdmEntityType.getName()) + .andStubReturn("SalesOderHeaders"); + EasyMock.expect(objEdmEntityType.getNamespace()) + .andStubReturn("SalesOderHeaders"); + EasyMock.expect(objEdmEntityType.getKind()) + .andStubReturn(EdmTypeKind.ENTITY); + EasyMock.expect(objEdmEntityType.hasStream()) + .andStubReturn(false); + EasyMock.expect(objEdmEntityType.hasStream()) + .andStubReturn(false); + ArrayList propertyNames = new ArrayList(); + propertyNames.add("ID"); + EasyMock.expect(objEdmEntityType.getProperty("ID")) + .andStubReturn(getEdmPropertyForSelect()); + EasyMock.expect(objEdmEntityType.getPropertyNames()) + .andStubReturn(propertyNames); + EasyMock.expect(objEdmEntityType.getNavigationPropertyNames()) + .andStubReturn(new ArrayList()); + EasyMock.expect(objEdmEntityType.getKeyPropertyNames()) + .andStubReturn(propertyNames); + EasyMock.expect(objEdmEntityType.getKeyProperties()) + .andStubReturn(getKeyProperties()); + } catch (EdmException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + EasyMock.replay(objEdmEntityType); + return objEdmEntityType; + } + + private List getKeyProperties() { + List edmProperties = new ArrayList(); + EdmType edmType = EasyMock.createMock(EdmType.class); + EasyMock.expect(edmType.getKind()) + .andStubReturn(EdmTypeKind.SIMPLE); + EasyMock.replay(edmType); + EdmProperty edmProperty = EasyMock.createMock(EdmProperty.class); + EdmMapping edmMapping = EasyMock.createMock(EdmMapping.class); + EasyMock.expect(edmMapping.getInternalName()) + .andStubReturn("soId"); + EasyMock.replay(edmMapping); + try { + EasyMock.expect(edmProperty.getName()) + .andStubReturn("ID"); + EasyMock.expect(edmProperty.getType()) + .andStubReturn(edmType); + EasyMock.expect(edmProperty.getMapping()) + .andStubReturn(edmMapping); + EasyMock.replay(edmProperty); + } catch (EdmException e) { + fail("There is an exception is mocking some object " + e.getMessage()); + } + + edmProperties.add(edmProperty); + return edmProperties; + } + + private InlineCount getLocalInlineCount() { + return InlineCount.NONE; + } + + class SalesOrderHeader { + private int soId; + private int Field1; + + public SalesOrderHeader(final int soId, final int field) { + this.soId = soId; + Field1 = field; + } + + public int getField1() { + return Field1; + } + + public void setField1(final int field1) { + Field1 = field1; + } + + public int getSoId() { + return soId; + } + + public void setSoId(final int soId) { + this.soId = soId; + } + + } + + private List getJPAEntities() { + List listJPAEntities = new ArrayList(); + SalesOrderHeader entity; + entity = new SalesOrderHeader(2, 10); + listJPAEntities.add(entity); + return listJPAEntities; + } + + private Object getEntity() { + return new SalesOrderHeader(10, 34); + } + + private GetEntityUriInfo mockEntityUriInfoForExpand() { + + List selectItemList = new ArrayList(); + List> expandList = new ArrayList>(); + ArrayList navigationPropertyList = new ArrayList(); + // Mocking the navigation property + EdmNavigationProperty navigationProperty = EasyMock.createMock(EdmNavigationProperty.class); + try { + EasyMock.expect(navigationProperty.getName()) + .andStubReturn("SalesOrderItemDetails"); + } catch (EdmException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + EasyMock.replay(navigationProperty); + // Mocking the navigation property segments and adding to expand list + NavigationPropertySegment navigationPropertySegment = EasyMock.createMock(NavigationPropertySegment.class); + EasyMock.expect(navigationPropertySegment.getNavigationProperty()) + .andStubReturn(navigationProperty); + EasyMock.expect(navigationPropertySegment.getTargetEntitySet()) + .andStubReturn(getTargetEntitySetForExpand()); + EasyMock.replay(navigationPropertySegment); + navigationPropertyList.add(navigationPropertySegment); + expandList.add(navigationPropertyList); + // Mocking EntityUriInfo + GetEntityUriInfo entityUriInfo = EasyMock.createMock(GetEntityUriInfo.class); + EasyMock.expect(entityUriInfo.getSelect()) + .andStubReturn(selectItemList); + EasyMock.expect(entityUriInfo.getExpand()) + .andStubReturn(expandList); + EasyMock.replay(entityUriInfo); + return entityUriInfo; + } + + private GetEntitySetUriInfo mockEntitySetUriInfoForExpand() { + + List selectItemList = new ArrayList(); + List> expandList = new ArrayList>(); + ArrayList navigationPropertyList = new ArrayList(); + // Mocking the navigation property + EdmNavigationProperty navigationProperty = EasyMock.createMock(EdmNavigationProperty.class); + try { + EasyMock.expect(navigationProperty.getName()) + .andStubReturn("SalesOrderItemDetails"); + } catch (EdmException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + EasyMock.replay(navigationProperty); + // Mocking the navigation property segments and adding to expand list + NavigationPropertySegment navigationPropertySegment = EasyMock.createMock(NavigationPropertySegment.class); + EasyMock.expect(navigationPropertySegment.getNavigationProperty()) + .andStubReturn(navigationProperty); + EasyMock.expect(navigationPropertySegment.getTargetEntitySet()) + .andStubReturn(getTargetEntitySetForExpand()); + EasyMock.replay(navigationPropertySegment); + navigationPropertyList.add(navigationPropertySegment); + expandList.add(navigationPropertyList); + // Mocking EntityUriInfo + UriInfoImpl entitySetUriInfo = EasyMock.createMock(UriInfoImpl.class); + EasyMock.expect(entitySetUriInfo.getSelect()) + .andStubReturn(selectItemList); + EasyMock.expect(entitySetUriInfo.getExpand()) + .andStubReturn(expandList); + EasyMock.expect(entitySetUriInfo.getInlineCount()) + .andStubReturn(InlineCount.ALLPAGES); + EasyMock.expect(entitySetUriInfo.getSkip()) + .andStubReturn(new Integer(1)); + EasyMock.expect(entitySetUriInfo.getTop()) + .andStubReturn(new Integer(2)); + Map customQuery = new HashMap(); + customQuery.put("count", "5"); + entitySetUriInfo.setCustomQueryOptions(null); + EasyMock.expectLastCall() + .times(1); + EasyMock.expect(entitySetUriInfo.getCustomQueryOptions()) + .andStubReturn(customQuery); + EasyMock.replay(entitySetUriInfo); + return entitySetUriInfo; + } + + private EdmEntitySet getTargetEntitySetForExpand() { + EdmEntitySet entitySet = EasyMock.createMock(EdmEntitySet.class); + try { + EasyMock.expect(entitySet.getName()) + .andStubReturn("SalesOrderHeaders"); + EasyMock.expect(entitySet.getEntityType()) + .andStubReturn(null); + } catch (EdmException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + EasyMock.replay(entitySet); + return entitySet; + } + + private NavigationPropertySegment getNavigationPropertySegment(final String navPropertyName) { + EdmNavigationProperty navigationProperty = EasyMock.createMock(EdmNavigationProperty.class); + try { + EasyMock.expect(navigationProperty.getName()) + .andStubReturn(navPropertyName); + } catch (EdmException e) { + fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); + } + EasyMock.replay(navigationProperty); + NavigationPropertySegment navPropertySegment = EasyMock.createMock(NavigationPropertySegment.class); + EasyMock.expect(navPropertySegment.getNavigationProperty()) + .andStubReturn(navigationProperty); + EasyMock.replay(navPropertySegment); + return navPropertySegment; + } + + private GetFunctionImportUriInfo mockFunctionImportUriInfo() { + + List selectItemList = new ArrayList(); + List> expandList = new ArrayList
- * The implementation of the view provides access to EDM entity types for the - * given JPA EDM model. The view acts as a container for consistent list of EDM - * entity types. An EDM entity type is said to be consistent only if it has at - * least one consistent EDM property and at least one consistent EDM key. - * - * + * The implementation of the view provides access to EDM entity types for the given JPA EDM model. + * The view acts as a container for consistent list of EDM entity types. An EDM entity type is said + * to be consistent only if it has at least one consistent EDM property and at least one consistent + * EDM key. + * + * *
+ * * @org.apache.olingo.odata2.DoNotImplement * @see org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmPropertyView * @see org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmKeyView * @see org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmNavigationPropertyView - * + * */ public interface JPAEdmEntityTypeView extends JPAEdmBaseView { - /** - * The method returns an EDM entity currently being processed. - * - * @return an instance of type {@link org.apache.olingo.odata2.api.edm.provider.EntityType} - */ - public EntityType getEdmEntityType(); + /** + * The method returns an EDM entity currently being processed. + * + * @return an instance of type {@link org.apache.olingo.odata2.api.edm.provider.EntityType} + */ + EntityType getEdmEntityType(); - /** - * The method returns java persistence Entity type currently being - * processed. - * - * @return an instance of type {@link javax.persistence.metamodel.EntityType} - */ - public javax.persistence.metamodel.EntityType> getJPAEntityType(); + /** + * The method returns java persistence Entity type currently being processed. + * + * @return an instance of type {@link javax.persistence.metamodel.EntityType} + */ + jakarta.persistence.metamodel.EntityType> getJPAEntityType(); - /** - * The method returns a consistent list of EDM entity types for a given java - * persistence meta model. - * - * @return a list of {@link org.apache.olingo.odata2.api.edm.provider.EntityType} - */ - public List getConsistentEdmEntityTypes(); + /** + * The method returns a consistent list of EDM entity types for a given java persistence meta model. + * + * @return a list of {@link org.apache.olingo.odata2.api.edm.provider.EntityType} + */ + List getConsistentEdmEntityTypes(); - /** - * The method searches in the consistent list of EDM entity types for the - * given EDM entity type's name. - * - * @param jpaEntityTypeName - * is the name of EDM entity type - * @return a reference to EDM entity type if found else null - */ - public EntityType searchEdmEntityType(String jpaEntityTypeName); + /** + * The method searches in the consistent list of EDM entity types for the given EDM entity type's + * name. + * + * @param jpaEntityTypeName is the name of EDM entity type + * @return a reference to EDM entity type if found else null + */ + EntityType searchEdmEntityType(String jpaEntityTypeName); } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/JPAEdmPropertyView.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/JPAEdmPropertyView.java index 3ce66d648..1eca444e3 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/JPAEdmPropertyView.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/JPAEdmPropertyView.java @@ -20,7 +20,7 @@ import java.util.List; -import javax.persistence.metamodel.Attribute; +import jakarta.persistence.metamodel.Attribute; import org.apache.olingo.odata2.api.edm.provider.Property; import org.apache.olingo.odata2.api.edm.provider.SimpleProperty; @@ -74,16 +74,16 @@ public interface JPAEdmPropertyView extends JPAEdmBaseView { /** * The method returns a JPA Attribute for the given JPA entity type. * - * @return an instance of type {@link javax.persistence.metamodel.Attribute + * @return an instance of type {@link jakarta.persistence.metamodel.Attribute * , ?>} */ Attribute, ?> getJPAAttribute(); /** - * The method returns a JPA Attribute referenced by a JPA Attribute in the {@link javax.persistence.JoinColumn} + * The method returns a JPA Attribute referenced by a JPA Attribute in the {@link jakarta.persistence.JoinColumn} * annotation for the given JPA entity type . * - * @return an instance of type {@link javax.persistence.metamodel.Attribute + * @return an instance of type {@link jakarta.persistence.metamodel.Attribute * , ?>} */ Attribute, ?> getJPAReferencedAttribute(); diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAAttributeMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAAttributeMapType.java index e7bcbe97b..cb899a42a 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAAttributeMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAAttributeMapType.java @@ -1,45 +1,40 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; import java.util.ArrayList; import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlValue; /** - * - * The default name for EDM - * property is derived from JPA attribute name. This can be overriden - * using + * + * The default name for EDM property is derived from JPA attribute name. This can be overriden using * JPAAttributeMapType. - * - * - * Java class for JPAAttributeMapType complex type. - * - * The following schema fragment specifies the expected content contained within this class. - * + * + * + * + * Java class for JPAAttributeMapType complex type. + * + * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAAttributeMapType"> * <complexContent> @@ -60,143 +55,139 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAAttributeMapType", propOrder = { "jpaAttribute" }) +@XmlType(name = "JPAAttributeMapType", propOrder = {"jpaAttribute"}) public class JPAAttributeMapType { - @XmlElement(name = "JPAAttribute") - protected List jpaAttribute; - - /** - * Gets the value of the jpaAttribute property. - * - * - * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the jpaAttribute property. - * - * - * For example, to add a new item, do as follows: - * - * getJPAAttribute().add(newItem); - * - * - * - * - * Objects of the following type(s) are allowed in the list {@link JPAAttributeMapType.JPAAttribute } - * - * - */ - public List getJPAAttribute() { - if (jpaAttribute == null) { - jpaAttribute = new ArrayList(); - } - return jpaAttribute; - } - - /** - * Java class for anonymous complex type. - * - * The following schema fragment specifies the expected content contained within this class. - * - * - * <complexType> - * <simpleContent> - * <extension base="<http://www.w3.org/2001/XMLSchema>string"> - * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * <attribute name="exclude" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /> - * </extension> - * </simpleContent> - * </complexType> - * - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { "value" }) - public static class JPAAttribute { - - @XmlValue - protected String value; - @XmlAttribute(name = "name", required = true) - protected String name; - @XmlAttribute(name = "exclude") - protected Boolean exclude; + @XmlElement(name = "JPAAttribute") + protected List jpaAttribute; /** - * Gets the value of the value property. + * Gets the value of the jpaAttribute property. * - * @return - * possible object is {@link String } + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaAttribute property. * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. + * + * For example, to add a new item, do as follows: + * + * + * getJPAAttribute().add(newItem); + * * - * @param value - * allowed object is {@link String } * - */ - public void setValue(final String value) { - this.value = value; - } - - /** - * Gets the value of the name property. + * + * Objects of the following type(s) are allowed in the list + * {@link JPAAttributeMapType.JPAAttribute } * - * @return - * possible object is {@link String } * */ - public String getName() { - return name; + public List getJPAAttribute() { + if (jpaAttribute == null) { + jpaAttribute = new ArrayList(); + } + return jpaAttribute; } /** - * Sets the value of the name property. + * + * Java class for anonymous complex type. * - * @param value - * allowed object is {@link String } + * + * The following schema fragment specifies the expected content contained within this class. * - */ - public void setName(final String value) { - name = value; - } - - /** - * Gets the value of the exclude property. + * + * <complexType> + * <simpleContent> + * <extension base="<http://www.w3.org/2001/XMLSchema>string"> + * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute name="exclude" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /> + * </extension> + * </simpleContent> + * </complexType> + * * - * @return - * possible object is {@link Boolean } * */ - public boolean isExclude() { - if (exclude == null) { - return false; - } else { - return exclude; - } - } + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"value"}) + public static class JPAAttribute { - /** - * Sets the value of the exclude property. - * - * @param value - * allowed object is {@link Boolean } - * - */ - public void setExclude(final Boolean value) { - exclude = value; - } + @XmlValue + protected String value; + @XmlAttribute(name = "name", required = true) + protected String name; + @XmlAttribute(name = "exclude") + protected Boolean exclude; - } + /** + * Gets the value of the value property. + * + * @return possible object is {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value allowed object is {@link String } + * + */ + public void setValue(final String value) { + this.value = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } + + /** + * Gets the value of the exclude property. + * + * @return possible object is {@link Boolean } + * + */ + public boolean isExclude() { + if (exclude == null) { + return false; + } + return exclude; + } + + /** + * Sets the value of the exclude property. + * + * @param value allowed object is {@link Boolean } + * + */ + public void setExclude(final Boolean value) { + exclude = value; + } + + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModel.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModel.java index a4175d481..b2b255cbe 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModel.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModel.java @@ -1,37 +1,32 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; /** * * Java class for anonymous complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType> * <complexContent> @@ -44,36 +39,35 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { "persistenceUnit" }) +@XmlType(name = "", propOrder = {"persistenceUnit"}) @XmlRootElement(name = "JPAEDMMappingModel") public class JPAEdmMappingModel { - @XmlElement(name = "PersistenceUnit", required = true) - protected JPAPersistenceUnitMapType persistenceUnit; + @XmlElement(name = "PersistenceUnit", required = true) + protected JPAPersistenceUnitMapType persistenceUnit; - /** - * Gets the value of the persistenceUnit property. - * - * @return possible object is {@link JPAPersistenceUnitMapType } - * - */ - public JPAPersistenceUnitMapType getPersistenceUnit() { - return persistenceUnit; - } + /** + * Gets the value of the persistenceUnit property. + * + * @return possible object is {@link JPAPersistenceUnitMapType } + * + */ + public JPAPersistenceUnitMapType getPersistenceUnit() { + return persistenceUnit; + } - /** - * Sets the value of the persistenceUnit property. - * - * @param value - * allowed object is {@link JPAPersistenceUnitMapType } - * - */ - public void setPersistenceUnit(final JPAPersistenceUnitMapType value) { - persistenceUnit = value; - } + /** + * Sets the value of the persistenceUnit property. + * + * @param value allowed object is {@link JPAPersistenceUnitMapType } + * + */ + public void setPersistenceUnit(final JPAPersistenceUnitMapType value) { + persistenceUnit = value; + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModelFactory.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModelFactory.java index 84f8b282b..5ab4991bc 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModelFactory.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModelFactory.java @@ -1,85 +1,83 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlRegistry; +import jakarta.xml.bind.annotation.XmlRegistry; /** - * This object contains factory methods for each Java content interface and Java - * element interface generated in the - * org.apache.olingo.odata2.processor.api.jpa.model.mapping package. + * This object contains factory methods for each Java content interface and Java element interface + * generated in the org.apache.olingo.odata2.processor.api.jpa.model.mapping package. * - * An ObjectFactory allows you to programatically construct new instances of the - * Java representation for XML content. The Java representation of XML content - * can consist of schema derived interfaces and classes representing the binding - * of schema type definitions, element declarations and model groups. Factory - * methods for each of these are provided in this class. - * + * An ObjectFactory allows you to programatically construct new instances of the Java representation + * for XML content. The Java representation of XML content can consist of schema derived interfaces + * and classes representing the binding of schema type definitions, element declarations and model + * groups. Factory methods for each of these are provided in this class. + * */ @XmlRegistry public class JPAEdmMappingModelFactory { - /** - * Create a new ObjectFactory that can be used to create new instances of - * schema derived classes for package: - * org.apache.olingo.odata2.processor.api.jpa.model.mapping - * - */ - public JPAEdmMappingModelFactory() {} + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for + * package: org.apache.olingo.odata2.processor.api.jpa.model.mapping + * + */ + public JPAEdmMappingModelFactory() {} - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPARelationshipMapType } - * - */ - public JPARelationshipMapType createJPARelationshipMapType() { - return new JPARelationshipMapType(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPARelationshipMapType } + * + */ + public JPARelationshipMapType createJPARelationshipMapType() { + return new JPARelationshipMapType(); + } - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAAttributeMapType } - * - */ - public JPAAttributeMapType createJPAAttributeMapType() { - return new JPAAttributeMapType(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAAttributeMapType } + * + */ + public JPAAttributeMapType createJPAAttributeMapType() { + return new JPAAttributeMapType(); + } - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEdmMappingModel } - * - */ - public JPAEdmMappingModel createJPAEDMMappingModel() { - return new JPAEdmMappingModel(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEdmMappingModel } + * + */ + public JPAEdmMappingModel createJPAEDMMappingModel() { + return new JPAEdmMappingModel(); + } - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAPersistenceUnitMapType } - * - */ - public JPAPersistenceUnitMapType createJPAPersistenceUnitMapType() { - return new JPAPersistenceUnitMapType(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAPersistenceUnitMapType } + * + */ + public JPAPersistenceUnitMapType createJPAPersistenceUnitMapType() { + return new JPAPersistenceUnitMapType(); + } - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEmbeddableTypeMapType } - * - */ - public JPAEmbeddableTypeMapType createJPAEmbeddableTypeMapType() { - return new JPAEmbeddableTypeMapType(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEmbeddableTypeMapType } + * + */ + public JPAEmbeddableTypeMapType createJPAEmbeddableTypeMapType() { + return new JPAEmbeddableTypeMapType(); + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypeMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypeMapType.java index e64067387..47803af26 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypeMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypeMapType.java @@ -1,40 +1,37 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** - * - * The default name for EDM - * complex type is derived from JPA Embeddable type name. This can be + * + * The default name for EDM complex type is derived from JPA Embeddable type name. This can be * overriden using JPAEmbeddableTypeMapType. - * - * - * Java class for JPAEmbeddableTypeMapType complex type. - * - * The following schema fragment specifies the expected content contained within this class. - * + * + * + * + * Java class for JPAEmbeddableTypeMapType complex type. + * + * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAEmbeddableTypeMapType"> * <complexContent> @@ -50,112 +47,103 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAEmbeddableTypeMapType", propOrder = { "edmComplexType", "jpaAttributes" }) +@XmlType(name = "JPAEmbeddableTypeMapType", propOrder = {"edmComplexType", "jpaAttributes"}) public class JPAEmbeddableTypeMapType { - @XmlElement(name = "EDMComplexType") - protected String edmComplexType; - @XmlElement(name = "JPAAttributes", required = true) - protected JPAAttributeMapType jpaAttributes; - @XmlAttribute(name = "name", required = true) - protected String name; - @XmlAttribute(name = "exclude") - protected Boolean exclude; + @XmlElement(name = "EDMComplexType") + protected String edmComplexType; + @XmlElement(name = "JPAAttributes", required = true) + protected JPAAttributeMapType jpaAttributes; + @XmlAttribute(name = "name", required = true) + protected String name; + @XmlAttribute(name = "exclude") + protected Boolean exclude; - /** - * Gets the value of the edmComplexType property. - * - * @return - * possible object is {@link String } - * - */ - public String getEDMComplexType() { - return edmComplexType; - } + /** + * Gets the value of the edmComplexType property. + * + * @return possible object is {@link String } + * + */ + public String getEDMComplexType() { + return edmComplexType; + } - /** - * Sets the value of the edmComplexType property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMComplexType(final String value) { - edmComplexType = value; - } + /** + * Sets the value of the edmComplexType property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMComplexType(final String value) { + edmComplexType = value; + } - /** - * Gets the value of the jpaAttributes property. - * - * @return - * possible object is {@link JPAAttributeMapType } - * - */ - public JPAAttributeMapType getJPAAttributes() { - return jpaAttributes; - } + /** + * Gets the value of the jpaAttributes property. + * + * @return possible object is {@link JPAAttributeMapType } + * + */ + public JPAAttributeMapType getJPAAttributes() { + return jpaAttributes; + } - /** - * Sets the value of the jpaAttributes property. - * - * @param value - * allowed object is {@link JPAAttributeMapType } - * - */ - public void setJPAAttributes(final JPAAttributeMapType value) { - jpaAttributes = value; - } + /** + * Sets the value of the jpaAttributes property. + * + * @param value allowed object is {@link JPAAttributeMapType } + * + */ + public void setJPAAttributes(final JPAAttributeMapType value) { + jpaAttributes = value; + } - /** - * Gets the value of the name property. - * - * @return - * possible object is {@link String } - * - */ - public String getName() { - return name; - } + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } - /** - * Sets the value of the name property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setName(final String value) { - name = value; - } + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } - /** - * Gets the value of the exclude property. - * - * @return - * possible object is {@link Boolean } - * - */ - public boolean isExclude() { - if (exclude == null) { - return false; - } else { - return exclude; + /** + * Gets the value of the exclude property. + * + * @return possible object is {@link Boolean } + * + */ + public boolean isExclude() { + if (exclude == null) { + return false; + } + return exclude; } - } - /** - * Sets the value of the exclude property. - * - * @param value - * allowed object is {@link Boolean } - * - */ - public void setExclude(final Boolean value) { - exclude = value; - } + /** + * Sets the value of the exclude property. + * + * @param value allowed object is {@link Boolean } + * + */ + public void setExclude(final Boolean value) { + exclude = value; + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypesMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypesMapType.java index 629312444..6bec5a120 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypesMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypesMapType.java @@ -1,39 +1,33 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; import java.util.ArrayList; import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** * * Java class for JPAEmbeddableTypesMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAEmbeddableTypesMapType"> * <complexContent> @@ -47,43 +41,42 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAEmbeddableTypesMapType", propOrder = { "jpaEmbeddableType" }) +@XmlType(name = "JPAEmbeddableTypesMapType", propOrder = {"jpaEmbeddableType"}) public class JPAEmbeddableTypesMapType { - @XmlElement(name = "JPAEmbeddableType") - protected List jpaEmbeddableType; + @XmlElement(name = "JPAEmbeddableType") + protected List jpaEmbeddableType; - /** - * Gets the value of the jpaEmbeddableType property. - * - * - * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the jpaEmbeddableType property. - * - * - * For example, to add a new item, do as follows: - * - * - * getJPAEmbeddableType().add(newItem); - * - * - * - * - * Objects of the following type(s) are allowed in the list {@link JPAEmbeddableTypeMapType } - * - * - */ - public List getJPAEmbeddableType() { - if (jpaEmbeddableType == null) { - jpaEmbeddableType = new ArrayList(); + /** + * Gets the value of the jpaEmbeddableType property. + * + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaEmbeddableType property. + * + * + * For example, to add a new item, do as follows: + * + * + * getJPAEmbeddableType().add(newItem); + * + * + * + * + * Objects of the following type(s) are allowed in the list {@link JPAEmbeddableTypeMapType } + * + * + */ + public List getJPAEmbeddableType() { + if (jpaEmbeddableType == null) { + jpaEmbeddableType = new ArrayList(); + } + return jpaEmbeddableType; } - return jpaEmbeddableType; - } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java index 22e181922..8c989234d 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java @@ -1,40 +1,37 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** - * - * The default name for EDM - * entity type is derived from JPA entity type name. This can be - * overriden using JPAEntityTypeMapType. - * - * - * Java class for JPAEntityTypeMapType complex type. - * - * The following schema fragment specifies the expected content contained within this class. - * + * + * The default name for EDM entity type is derived from JPA entity type name. This can be overriden + * using JPAEntityTypeMapType. + * + * + * + * Java class for JPAEntityTypeMapType complex type. + * + * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAEntityTypeMapType"> * <complexContent> @@ -53,161 +50,147 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAEntityTypeMapType", propOrder = { "edmEntityType", "edmEntitySet", "jpaAttributes", - "jpaRelationships" }) +@XmlType(name = "JPAEntityTypeMapType", propOrder = {"edmEntityType", "edmEntitySet", "jpaAttributes", "jpaRelationships"}) public class JPAEntityTypeMapType { - @XmlElement(name = "EDMEntityType") - protected String edmEntityType; - @XmlElement(name = "EDMEntitySet") - protected String edmEntitySet; - @XmlElement(name = "JPAAttributes", required = true) - protected JPAAttributeMapType jpaAttributes; - @XmlElement(name = "JPARelationships", required = true) - protected JPARelationshipMapType jpaRelationships; - @XmlAttribute(name = "name", required = true) - protected String name; - @XmlAttribute(name = "exclude") - protected Boolean exclude; - - /** - * Gets the value of the edmEntityType property. - * - * @return - * possible object is {@link String } - * - */ - public String getEDMEntityType() { - return edmEntityType; - } - - /** - * Sets the value of the edmEntityType property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMEntityType(final String value) { - edmEntityType = value; - } - - /** - * Gets the value of the edmEntitySet property. - * - * @return - * possible object is {@link String } - * - */ - public String getEDMEntitySet() { - return edmEntitySet; - } - - /** - * Sets the value of the edmEntitySet property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMEntitySet(final String value) { - edmEntitySet = value; - } - - /** - * Gets the value of the jpaAttributes property. - * - * @return - * possible object is {@link JPAAttributeMapType } - * - */ - public JPAAttributeMapType getJPAAttributes() { - return jpaAttributes; - } - - /** - * Sets the value of the jpaAttributes property. - * - * @param value - * allowed object is {@link JPAAttributeMapType } - * - */ - public void setJPAAttributes(final JPAAttributeMapType value) { - jpaAttributes = value; - } - - /** - * Gets the value of the jpaRelationships property. - * - * @return - * possible object is {@link JPARelationshipMapType } - * - */ - public JPARelationshipMapType getJPARelationships() { - return jpaRelationships; - } - - /** - * Sets the value of the jpaRelationships property. - * - * @param value - * allowed object is {@link JPARelationshipMapType } - * - */ - public void setJPARelationships(final JPARelationshipMapType value) { - jpaRelationships = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is {@link String } - * - */ - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setName(final String value) { - name = value; - } - - /** - * Gets the value of the exclude property. - * - * @return - * possible object is {@link Boolean } - * - */ - public boolean isExclude() { - if (exclude == null) { - return false; - } else { - return exclude; + @XmlElement(name = "EDMEntityType") + protected String edmEntityType; + @XmlElement(name = "EDMEntitySet") + protected String edmEntitySet; + @XmlElement(name = "JPAAttributes", required = true) + protected JPAAttributeMapType jpaAttributes; + @XmlElement(name = "JPARelationships", required = true) + protected JPARelationshipMapType jpaRelationships; + @XmlAttribute(name = "name", required = true) + protected String name; + @XmlAttribute(name = "exclude") + protected Boolean exclude; + + /** + * Gets the value of the edmEntityType property. + * + * @return possible object is {@link String } + * + */ + public String getEDMEntityType() { + return edmEntityType; + } + + /** + * Sets the value of the edmEntityType property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMEntityType(final String value) { + edmEntityType = value; + } + + /** + * Gets the value of the edmEntitySet property. + * + * @return possible object is {@link String } + * + */ + public String getEDMEntitySet() { + return edmEntitySet; + } + + /** + * Sets the value of the edmEntitySet property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMEntitySet(final String value) { + edmEntitySet = value; + } + + /** + * Gets the value of the jpaAttributes property. + * + * @return possible object is {@link JPAAttributeMapType } + * + */ + public JPAAttributeMapType getJPAAttributes() { + return jpaAttributes; + } + + /** + * Sets the value of the jpaAttributes property. + * + * @param value allowed object is {@link JPAAttributeMapType } + * + */ + public void setJPAAttributes(final JPAAttributeMapType value) { + jpaAttributes = value; + } + + /** + * Gets the value of the jpaRelationships property. + * + * @return possible object is {@link JPARelationshipMapType } + * + */ + public JPARelationshipMapType getJPARelationships() { + return jpaRelationships; + } + + /** + * Sets the value of the jpaRelationships property. + * + * @param value allowed object is {@link JPARelationshipMapType } + * + */ + public void setJPARelationships(final JPARelationshipMapType value) { + jpaRelationships = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } + + /** + * Gets the value of the exclude property. + * + * @return possible object is {@link Boolean } + * + */ + public boolean isExclude() { + if (exclude == null) { + return false; + } + return exclude; + } + + /** + * Sets the value of the exclude property. + * + * @param value allowed object is {@link Boolean } + * + */ + public void setExclude(final Boolean value) { + exclude = value; } - } - - /** - * Sets the value of the exclude property. - * - * @param value - * allowed object is {@link Boolean } - * - */ - public void setExclude(final Boolean value) { - exclude = value; - } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java index 7a72e0848..afacaceca 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java @@ -1,39 +1,33 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; import java.util.ArrayList; import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** * * Java class for JPAEntityTypesMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAEntityTypesMapType"> * <complexContent> @@ -47,43 +41,42 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAEntityTypesMapType", propOrder = { "jpaEntityType" }) +@XmlType(name = "JPAEntityTypesMapType", propOrder = {"jpaEntityType"}) public class JPAEntityTypesMapType { - @XmlElement(name = "JPAEntityType") - protected List jpaEntityType; + @XmlElement(name = "JPAEntityType") + protected List jpaEntityType; - /** - * Gets the value of the jpaEntityType property. - * - * - * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the jpaEntityType property. - * - * - * For example, to add a new item, do as follows: - * - * - * getJPAEntityType().add(newItem); - * - * - * - * - * Objects of the following type(s) are allowed in the list {@link JPAEntityTypeMapType } - * - * - */ - public List getJPAEntityType() { - if (jpaEntityType == null) { - jpaEntityType = new ArrayList(); + /** + * Gets the value of the jpaEntityType property. + * + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaEntityType property. + * + * + * For example, to add a new item, do as follows: + * + * + * getJPAEntityType().add(newItem); + * + * + * + * + * Objects of the following type(s) are allowed in the list {@link JPAEntityTypeMapType } + * + * + */ + public List getJPAEntityType() { + if (jpaEntityType == null) { + jpaEntityType = new ArrayList(); + } + return jpaEntityType; } - return jpaEntityType; - } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java index 22260eac1..7ce8c0aa0 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java @@ -1,42 +1,37 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** - * - * By default Java Persistence Unit name is taken as EDM schema name. This can - * be overriden using JPAPersistenceUnitMapType. - * - * + * + * By default Java Persistence Unit name is taken as EDM schema name. This can be overriden using + * JPAPersistenceUnitMapType. + * + * * * Java class for JPAPersistenceUnitMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAPersistenceUnitMapType"> * <complexContent> @@ -53,105 +48,100 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAPersistenceUnitMapType", - propOrder = { "edmSchemaNamespace", "jpaEntityTypes", "jpaEmbeddableTypes" }) +@XmlType(name = "JPAPersistenceUnitMapType", propOrder = {"edmSchemaNamespace", "jpaEntityTypes", "jpaEmbeddableTypes"}) public class JPAPersistenceUnitMapType { - @XmlElement(name = "EDMSchemaNamespace") - protected String edmSchemaNamespace; - @XmlElement(name = "JPAEntityTypes", required = true) - protected JPAEntityTypesMapType jpaEntityTypes; - @XmlElement(name = "JPAEmbeddableTypes", required = true) - protected JPAEmbeddableTypesMapType jpaEmbeddableTypes; - @XmlAttribute(name = "name", required = true) - protected String name; + @XmlElement(name = "EDMSchemaNamespace") + protected String edmSchemaNamespace; + @XmlElement(name = "JPAEntityTypes", required = true) + protected JPAEntityTypesMapType jpaEntityTypes; + @XmlElement(name = "JPAEmbeddableTypes", required = true) + protected JPAEmbeddableTypesMapType jpaEmbeddableTypes; + @XmlAttribute(name = "name", required = true) + protected String name; - /** - * Gets the value of the edmSchemaNamespace property. - * - * @return possible object is {@link String } - * - */ - public String getEDMSchemaNamespace() { - return edmSchemaNamespace; - } + /** + * Gets the value of the edmSchemaNamespace property. + * + * @return possible object is {@link String } + * + */ + public String getEDMSchemaNamespace() { + return edmSchemaNamespace; + } - /** - * Sets the value of the edmSchemaNamespace property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMSchemaNamespace(final String value) { - edmSchemaNamespace = value; - } + /** + * Sets the value of the edmSchemaNamespace property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMSchemaNamespace(final String value) { + edmSchemaNamespace = value; + } - /** - * Gets the value of the jpaEntityTypes property. - * - * @return possible object is {@link JPAEntityTypesMapType } - * - */ - public JPAEntityTypesMapType getJPAEntityTypes() { - return jpaEntityTypes; - } + /** + * Gets the value of the jpaEntityTypes property. + * + * @return possible object is {@link JPAEntityTypesMapType } + * + */ + public JPAEntityTypesMapType getJPAEntityTypes() { + return jpaEntityTypes; + } - /** - * Sets the value of the jpaEntityTypes property. - * - * @param value - * allowed object is {@link JPAEntityTypesMapType } - * - */ - public void setJPAEntityTypes(final JPAEntityTypesMapType value) { - jpaEntityTypes = value; - } + /** + * Sets the value of the jpaEntityTypes property. + * + * @param value allowed object is {@link JPAEntityTypesMapType } + * + */ + public void setJPAEntityTypes(final JPAEntityTypesMapType value) { + jpaEntityTypes = value; + } - /** - * Gets the value of the jpaEmbeddableTypes property. - * - * @return possible object is {@link JPAEmbeddableTypesMapType } - * - */ - public JPAEmbeddableTypesMapType getJPAEmbeddableTypes() { - return jpaEmbeddableTypes; - } + /** + * Gets the value of the jpaEmbeddableTypes property. + * + * @return possible object is {@link JPAEmbeddableTypesMapType } + * + */ + public JPAEmbeddableTypesMapType getJPAEmbeddableTypes() { + return jpaEmbeddableTypes; + } - /** - * Sets the value of the jpaEmbeddableTypes property. - * - * @param value - * allowed object is {@link JPAEmbeddableTypesMapType } - * - */ - public void setJPAEmbeddableTypes(final JPAEmbeddableTypesMapType value) { - jpaEmbeddableTypes = value; - } + /** + * Sets the value of the jpaEmbeddableTypes property. + * + * @param value allowed object is {@link JPAEmbeddableTypesMapType } + * + */ + public void setJPAEmbeddableTypes(final JPAEmbeddableTypesMapType value) { + jpaEmbeddableTypes = value; + } - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return name; - } + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } - /** - * Sets the value of the name property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setName(final String value) { - name = value; - } + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java index 25a2f9569..50970877e 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java @@ -1,46 +1,40 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; import java.util.ArrayList; import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlValue; /** - * - * The default name for EDM navigation property is derived from JPA relationship - * name. This can be overriden using JPARelationshipMapType. - * - * + * + * The default name for EDM navigation property is derived from JPA relationship name. This can be + * overriden using JPARelationshipMapType. + * + * * * Java class for JPARelationshipMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPARelationshipMapType"> * <complexContent> @@ -60,116 +54,113 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPARelationshipMapType", propOrder = { "jpaRelationship" }) +@XmlType(name = "JPARelationshipMapType", propOrder = {"jpaRelationship"}) public class JPARelationshipMapType { - @XmlElement(name = "JPARelationship") - protected List jpaRelationship; - - /** - * Gets the value of the jpaRelationship property. - * - * - * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the jpaRelationship property. - * - * - * For example, to add a new item, do as follows: - * - * - * getJPARelationship().add(newItem); - * - * - * - * - * Objects of the following type(s) are allowed in the list {@link JPARelationshipMapType.JPARelationship } - * - * - */ - public List getJPARelationship() { - if (jpaRelationship == null) { - jpaRelationship = new ArrayList(); - } - return jpaRelationship; - } - - /** - * - * Java class for anonymous complex type. - * - * - * The following schema fragment specifies the expected content contained - * within this class. - * - * - * <complexType> - * <simpleContent> - * <extension base="<http://www.w3.org/2001/XMLSchema>string"> - * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * </extension> - * </simpleContent> - * </complexType> - * - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { "value" }) - public static class JPARelationship { - - @XmlValue - protected String value; - @XmlAttribute(name = "name", required = true) - protected String name; + @XmlElement(name = "JPARelationship") + protected List jpaRelationship; /** - * Gets the value of the value property. + * Gets the value of the jpaRelationship property. * - * @return possible object is {@link String } + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaRelationship property. * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. + * + * For example, to add a new item, do as follows: * - * @param value - * allowed object is {@link String } + * + * getJPARelationship().add(newItem); + * * - */ - public void setValue(final String value) { - this.value = value; - } - - /** - * Gets the value of the name property. * - * @return possible object is {@link String } + * + * Objects of the following type(s) are allowed in the list + * {@link JPARelationshipMapType.JPARelationship } + * * */ - public String getName() { - return name; + public List getJPARelationship() { + if (jpaRelationship == null) { + jpaRelationship = new ArrayList(); + } + return jpaRelationship; } /** - * Sets the value of the name property. + * + * Java class for anonymous complex type. + * + * + * The following schema fragment specifies the expected content contained within this class. + * + * + * <complexType> + * <simpleContent> + * <extension base="<http://www.w3.org/2001/XMLSchema>string"> + * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * </extension> + * </simpleContent> + * </complexType> + * * - * @param value - * allowed object is {@link String } * */ - public void setName(final String value) { - name = value; - } + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"value"}) + public static class JPARelationship { + + @XmlValue + protected String value; + @XmlAttribute(name = "name", required = true) + protected String name; - } + /** + * Gets the value of the value property. + * + * @return possible object is {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value allowed object is {@link String } + * + */ + public void setValue(final String value) { + this.value = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } + + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java index 45a7c3f9b..ed06d3832 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java @@ -1,28 +1,24 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ /** - * OData JPA Processor API Library - Mapping Model - * The JPA EDM Mapping model (XML document) is represented as JAXB annotated Java Classes. - * - * + * OData JPA Processor API Library - Mapping Model The JPA EDM Mapping model (XML document) + * is represented as JAXB annotated Java Classes. + * + * */ -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping", - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +@jakarta.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping", + elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED) package org.apache.olingo.odata2.jpa.processor.api.model.mapping; diff --git a/odata2-jpa-processor/jpa-core/pom.xml b/odata2-jpa-processor/jpa-core/pom.xml index c8eb662a5..2c09c1faa 100644 --- a/odata2-jpa-processor/jpa-core/pom.xml +++ b/odata2-jpa-processor/jpa-core/pom.xml @@ -24,7 +24,7 @@ org.apache.olingo olingo-odata2-jpa-processor - 2.0.13 + 3.0.0-SNAPSHOT ../ @@ -68,10 +68,9 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 - 1.6 - 1.6 + 17 + 17 @@ -88,9 +87,8 @@ - org.eclipse.persistence - javax.persistence - ${version.javax.persistence} + jakarta.persistence + jakarta.persistence-api @@ -122,14 +120,13 @@ junit junit - 4.9 test - org.easymock - easymock - 3.1 - test + org.easymock + easymock + 5.2.0 + test @@ -138,7 +135,6 @@ org.slf4j slf4j-api - 1.7.2 test
Java class for JPAAttributeMapType complex type. - * - *
The following schema fragment specifies the expected content contained within this class. - * + * + * + *
+ * Java class for JPAAttributeMapType complex type. + * + *
+ * The following schema fragment specifies the expected content contained within this class. + * *
* <complexType name="JPAAttributeMapType"> * <complexContent> @@ -60,143 +55,139 @@ * </complexContent> * </complexType> *
- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the jpaAttribute property. - * - *
set
- * For example, to add a new item, do as follows: - *
- * getJPAAttribute().add(newItem); - *
- * Objects of the following type(s) are allowed in the list {@link JPAAttributeMapType.JPAAttribute } - * - * - */ - public List getJPAAttribute() { - if (jpaAttribute == null) { - jpaAttribute = new ArrayList(); - } - return jpaAttribute; - } - - /** - * Java class for anonymous complex type. - * - * The following schema fragment specifies the expected content contained within this class. - * - * - * <complexType> - * <simpleContent> - * <extension base="<http://www.w3.org/2001/XMLSchema>string"> - * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * <attribute name="exclude" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /> - * </extension> - * </simpleContent> - * </complexType> - * - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { "value" }) - public static class JPAAttribute { - - @XmlValue - protected String value; - @XmlAttribute(name = "name", required = true) - protected String name; - @XmlAttribute(name = "exclude") - protected Boolean exclude; + @XmlElement(name = "JPAAttribute") + protected List jpaAttribute; /** - * Gets the value of the value property. + * Gets the value of the jpaAttribute property. * - * @return - * possible object is {@link String } + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaAttribute property. * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. + * + * For example, to add a new item, do as follows: + * + * + * getJPAAttribute().add(newItem); + * * - * @param value - * allowed object is {@link String } * - */ - public void setValue(final String value) { - this.value = value; - } - - /** - * Gets the value of the name property. + * + * Objects of the following type(s) are allowed in the list + * {@link JPAAttributeMapType.JPAAttribute } * - * @return - * possible object is {@link String } * */ - public String getName() { - return name; + public List getJPAAttribute() { + if (jpaAttribute == null) { + jpaAttribute = new ArrayList(); + } + return jpaAttribute; } /** - * Sets the value of the name property. + * + * Java class for anonymous complex type. * - * @param value - * allowed object is {@link String } + * + * The following schema fragment specifies the expected content contained within this class. * - */ - public void setName(final String value) { - name = value; - } - - /** - * Gets the value of the exclude property. + * + * <complexType> + * <simpleContent> + * <extension base="<http://www.w3.org/2001/XMLSchema>string"> + * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute name="exclude" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /> + * </extension> + * </simpleContent> + * </complexType> + * * - * @return - * possible object is {@link Boolean } * */ - public boolean isExclude() { - if (exclude == null) { - return false; - } else { - return exclude; - } - } + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"value"}) + public static class JPAAttribute { - /** - * Sets the value of the exclude property. - * - * @param value - * allowed object is {@link Boolean } - * - */ - public void setExclude(final Boolean value) { - exclude = value; - } + @XmlValue + protected String value; + @XmlAttribute(name = "name", required = true) + protected String name; + @XmlAttribute(name = "exclude") + protected Boolean exclude; - } + /** + * Gets the value of the value property. + * + * @return possible object is {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value allowed object is {@link String } + * + */ + public void setValue(final String value) { + this.value = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } + + /** + * Gets the value of the exclude property. + * + * @return possible object is {@link Boolean } + * + */ + public boolean isExclude() { + if (exclude == null) { + return false; + } + return exclude; + } + + /** + * Sets the value of the exclude property. + * + * @param value allowed object is {@link Boolean } + * + */ + public void setExclude(final Boolean value) { + exclude = value; + } + + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModel.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModel.java index a4175d481..b2b255cbe 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModel.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModel.java @@ -1,37 +1,32 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; /** * * Java class for anonymous complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType> * <complexContent> @@ -44,36 +39,35 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { "persistenceUnit" }) +@XmlType(name = "", propOrder = {"persistenceUnit"}) @XmlRootElement(name = "JPAEDMMappingModel") public class JPAEdmMappingModel { - @XmlElement(name = "PersistenceUnit", required = true) - protected JPAPersistenceUnitMapType persistenceUnit; + @XmlElement(name = "PersistenceUnit", required = true) + protected JPAPersistenceUnitMapType persistenceUnit; - /** - * Gets the value of the persistenceUnit property. - * - * @return possible object is {@link JPAPersistenceUnitMapType } - * - */ - public JPAPersistenceUnitMapType getPersistenceUnit() { - return persistenceUnit; - } + /** + * Gets the value of the persistenceUnit property. + * + * @return possible object is {@link JPAPersistenceUnitMapType } + * + */ + public JPAPersistenceUnitMapType getPersistenceUnit() { + return persistenceUnit; + } - /** - * Sets the value of the persistenceUnit property. - * - * @param value - * allowed object is {@link JPAPersistenceUnitMapType } - * - */ - public void setPersistenceUnit(final JPAPersistenceUnitMapType value) { - persistenceUnit = value; - } + /** + * Sets the value of the persistenceUnit property. + * + * @param value allowed object is {@link JPAPersistenceUnitMapType } + * + */ + public void setPersistenceUnit(final JPAPersistenceUnitMapType value) { + persistenceUnit = value; + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModelFactory.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModelFactory.java index 84f8b282b..5ab4991bc 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModelFactory.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModelFactory.java @@ -1,85 +1,83 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlRegistry; +import jakarta.xml.bind.annotation.XmlRegistry; /** - * This object contains factory methods for each Java content interface and Java - * element interface generated in the - * org.apache.olingo.odata2.processor.api.jpa.model.mapping package. + * This object contains factory methods for each Java content interface and Java element interface + * generated in the org.apache.olingo.odata2.processor.api.jpa.model.mapping package. * - * An ObjectFactory allows you to programatically construct new instances of the - * Java representation for XML content. The Java representation of XML content - * can consist of schema derived interfaces and classes representing the binding - * of schema type definitions, element declarations and model groups. Factory - * methods for each of these are provided in this class. - * + * An ObjectFactory allows you to programatically construct new instances of the Java representation + * for XML content. The Java representation of XML content can consist of schema derived interfaces + * and classes representing the binding of schema type definitions, element declarations and model + * groups. Factory methods for each of these are provided in this class. + * */ @XmlRegistry public class JPAEdmMappingModelFactory { - /** - * Create a new ObjectFactory that can be used to create new instances of - * schema derived classes for package: - * org.apache.olingo.odata2.processor.api.jpa.model.mapping - * - */ - public JPAEdmMappingModelFactory() {} + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for + * package: org.apache.olingo.odata2.processor.api.jpa.model.mapping + * + */ + public JPAEdmMappingModelFactory() {} - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPARelationshipMapType } - * - */ - public JPARelationshipMapType createJPARelationshipMapType() { - return new JPARelationshipMapType(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPARelationshipMapType } + * + */ + public JPARelationshipMapType createJPARelationshipMapType() { + return new JPARelationshipMapType(); + } - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAAttributeMapType } - * - */ - public JPAAttributeMapType createJPAAttributeMapType() { - return new JPAAttributeMapType(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAAttributeMapType } + * + */ + public JPAAttributeMapType createJPAAttributeMapType() { + return new JPAAttributeMapType(); + } - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEdmMappingModel } - * - */ - public JPAEdmMappingModel createJPAEDMMappingModel() { - return new JPAEdmMappingModel(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEdmMappingModel } + * + */ + public JPAEdmMappingModel createJPAEDMMappingModel() { + return new JPAEdmMappingModel(); + } - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAPersistenceUnitMapType } - * - */ - public JPAPersistenceUnitMapType createJPAPersistenceUnitMapType() { - return new JPAPersistenceUnitMapType(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAPersistenceUnitMapType } + * + */ + public JPAPersistenceUnitMapType createJPAPersistenceUnitMapType() { + return new JPAPersistenceUnitMapType(); + } - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEmbeddableTypeMapType } - * - */ - public JPAEmbeddableTypeMapType createJPAEmbeddableTypeMapType() { - return new JPAEmbeddableTypeMapType(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEmbeddableTypeMapType } + * + */ + public JPAEmbeddableTypeMapType createJPAEmbeddableTypeMapType() { + return new JPAEmbeddableTypeMapType(); + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypeMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypeMapType.java index e64067387..47803af26 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypeMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypeMapType.java @@ -1,40 +1,37 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** - * - * The default name for EDM - * complex type is derived from JPA Embeddable type name. This can be + * + * The default name for EDM complex type is derived from JPA Embeddable type name. This can be * overriden using JPAEmbeddableTypeMapType. - * - * - * Java class for JPAEmbeddableTypeMapType complex type. - * - * The following schema fragment specifies the expected content contained within this class. - * + * + * + * + * Java class for JPAEmbeddableTypeMapType complex type. + * + * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAEmbeddableTypeMapType"> * <complexContent> @@ -50,112 +47,103 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAEmbeddableTypeMapType", propOrder = { "edmComplexType", "jpaAttributes" }) +@XmlType(name = "JPAEmbeddableTypeMapType", propOrder = {"edmComplexType", "jpaAttributes"}) public class JPAEmbeddableTypeMapType { - @XmlElement(name = "EDMComplexType") - protected String edmComplexType; - @XmlElement(name = "JPAAttributes", required = true) - protected JPAAttributeMapType jpaAttributes; - @XmlAttribute(name = "name", required = true) - protected String name; - @XmlAttribute(name = "exclude") - protected Boolean exclude; + @XmlElement(name = "EDMComplexType") + protected String edmComplexType; + @XmlElement(name = "JPAAttributes", required = true) + protected JPAAttributeMapType jpaAttributes; + @XmlAttribute(name = "name", required = true) + protected String name; + @XmlAttribute(name = "exclude") + protected Boolean exclude; - /** - * Gets the value of the edmComplexType property. - * - * @return - * possible object is {@link String } - * - */ - public String getEDMComplexType() { - return edmComplexType; - } + /** + * Gets the value of the edmComplexType property. + * + * @return possible object is {@link String } + * + */ + public String getEDMComplexType() { + return edmComplexType; + } - /** - * Sets the value of the edmComplexType property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMComplexType(final String value) { - edmComplexType = value; - } + /** + * Sets the value of the edmComplexType property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMComplexType(final String value) { + edmComplexType = value; + } - /** - * Gets the value of the jpaAttributes property. - * - * @return - * possible object is {@link JPAAttributeMapType } - * - */ - public JPAAttributeMapType getJPAAttributes() { - return jpaAttributes; - } + /** + * Gets the value of the jpaAttributes property. + * + * @return possible object is {@link JPAAttributeMapType } + * + */ + public JPAAttributeMapType getJPAAttributes() { + return jpaAttributes; + } - /** - * Sets the value of the jpaAttributes property. - * - * @param value - * allowed object is {@link JPAAttributeMapType } - * - */ - public void setJPAAttributes(final JPAAttributeMapType value) { - jpaAttributes = value; - } + /** + * Sets the value of the jpaAttributes property. + * + * @param value allowed object is {@link JPAAttributeMapType } + * + */ + public void setJPAAttributes(final JPAAttributeMapType value) { + jpaAttributes = value; + } - /** - * Gets the value of the name property. - * - * @return - * possible object is {@link String } - * - */ - public String getName() { - return name; - } + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } - /** - * Sets the value of the name property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setName(final String value) { - name = value; - } + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } - /** - * Gets the value of the exclude property. - * - * @return - * possible object is {@link Boolean } - * - */ - public boolean isExclude() { - if (exclude == null) { - return false; - } else { - return exclude; + /** + * Gets the value of the exclude property. + * + * @return possible object is {@link Boolean } + * + */ + public boolean isExclude() { + if (exclude == null) { + return false; + } + return exclude; } - } - /** - * Sets the value of the exclude property. - * - * @param value - * allowed object is {@link Boolean } - * - */ - public void setExclude(final Boolean value) { - exclude = value; - } + /** + * Sets the value of the exclude property. + * + * @param value allowed object is {@link Boolean } + * + */ + public void setExclude(final Boolean value) { + exclude = value; + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypesMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypesMapType.java index 629312444..6bec5a120 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypesMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypesMapType.java @@ -1,39 +1,33 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; import java.util.ArrayList; import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** * * Java class for JPAEmbeddableTypesMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAEmbeddableTypesMapType"> * <complexContent> @@ -47,43 +41,42 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAEmbeddableTypesMapType", propOrder = { "jpaEmbeddableType" }) +@XmlType(name = "JPAEmbeddableTypesMapType", propOrder = {"jpaEmbeddableType"}) public class JPAEmbeddableTypesMapType { - @XmlElement(name = "JPAEmbeddableType") - protected List jpaEmbeddableType; + @XmlElement(name = "JPAEmbeddableType") + protected List jpaEmbeddableType; - /** - * Gets the value of the jpaEmbeddableType property. - * - * - * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the jpaEmbeddableType property. - * - * - * For example, to add a new item, do as follows: - * - * - * getJPAEmbeddableType().add(newItem); - * - * - * - * - * Objects of the following type(s) are allowed in the list {@link JPAEmbeddableTypeMapType } - * - * - */ - public List getJPAEmbeddableType() { - if (jpaEmbeddableType == null) { - jpaEmbeddableType = new ArrayList(); + /** + * Gets the value of the jpaEmbeddableType property. + * + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaEmbeddableType property. + * + * + * For example, to add a new item, do as follows: + * + * + * getJPAEmbeddableType().add(newItem); + * + * + * + * + * Objects of the following type(s) are allowed in the list {@link JPAEmbeddableTypeMapType } + * + * + */ + public List getJPAEmbeddableType() { + if (jpaEmbeddableType == null) { + jpaEmbeddableType = new ArrayList(); + } + return jpaEmbeddableType; } - return jpaEmbeddableType; - } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java index 22e181922..8c989234d 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java @@ -1,40 +1,37 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** - * - * The default name for EDM - * entity type is derived from JPA entity type name. This can be - * overriden using JPAEntityTypeMapType. - * - * - * Java class for JPAEntityTypeMapType complex type. - * - * The following schema fragment specifies the expected content contained within this class. - * + * + * The default name for EDM entity type is derived from JPA entity type name. This can be overriden + * using JPAEntityTypeMapType. + * + * + * + * Java class for JPAEntityTypeMapType complex type. + * + * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAEntityTypeMapType"> * <complexContent> @@ -53,161 +50,147 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAEntityTypeMapType", propOrder = { "edmEntityType", "edmEntitySet", "jpaAttributes", - "jpaRelationships" }) +@XmlType(name = "JPAEntityTypeMapType", propOrder = {"edmEntityType", "edmEntitySet", "jpaAttributes", "jpaRelationships"}) public class JPAEntityTypeMapType { - @XmlElement(name = "EDMEntityType") - protected String edmEntityType; - @XmlElement(name = "EDMEntitySet") - protected String edmEntitySet; - @XmlElement(name = "JPAAttributes", required = true) - protected JPAAttributeMapType jpaAttributes; - @XmlElement(name = "JPARelationships", required = true) - protected JPARelationshipMapType jpaRelationships; - @XmlAttribute(name = "name", required = true) - protected String name; - @XmlAttribute(name = "exclude") - protected Boolean exclude; - - /** - * Gets the value of the edmEntityType property. - * - * @return - * possible object is {@link String } - * - */ - public String getEDMEntityType() { - return edmEntityType; - } - - /** - * Sets the value of the edmEntityType property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMEntityType(final String value) { - edmEntityType = value; - } - - /** - * Gets the value of the edmEntitySet property. - * - * @return - * possible object is {@link String } - * - */ - public String getEDMEntitySet() { - return edmEntitySet; - } - - /** - * Sets the value of the edmEntitySet property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMEntitySet(final String value) { - edmEntitySet = value; - } - - /** - * Gets the value of the jpaAttributes property. - * - * @return - * possible object is {@link JPAAttributeMapType } - * - */ - public JPAAttributeMapType getJPAAttributes() { - return jpaAttributes; - } - - /** - * Sets the value of the jpaAttributes property. - * - * @param value - * allowed object is {@link JPAAttributeMapType } - * - */ - public void setJPAAttributes(final JPAAttributeMapType value) { - jpaAttributes = value; - } - - /** - * Gets the value of the jpaRelationships property. - * - * @return - * possible object is {@link JPARelationshipMapType } - * - */ - public JPARelationshipMapType getJPARelationships() { - return jpaRelationships; - } - - /** - * Sets the value of the jpaRelationships property. - * - * @param value - * allowed object is {@link JPARelationshipMapType } - * - */ - public void setJPARelationships(final JPARelationshipMapType value) { - jpaRelationships = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is {@link String } - * - */ - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setName(final String value) { - name = value; - } - - /** - * Gets the value of the exclude property. - * - * @return - * possible object is {@link Boolean } - * - */ - public boolean isExclude() { - if (exclude == null) { - return false; - } else { - return exclude; + @XmlElement(name = "EDMEntityType") + protected String edmEntityType; + @XmlElement(name = "EDMEntitySet") + protected String edmEntitySet; + @XmlElement(name = "JPAAttributes", required = true) + protected JPAAttributeMapType jpaAttributes; + @XmlElement(name = "JPARelationships", required = true) + protected JPARelationshipMapType jpaRelationships; + @XmlAttribute(name = "name", required = true) + protected String name; + @XmlAttribute(name = "exclude") + protected Boolean exclude; + + /** + * Gets the value of the edmEntityType property. + * + * @return possible object is {@link String } + * + */ + public String getEDMEntityType() { + return edmEntityType; + } + + /** + * Sets the value of the edmEntityType property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMEntityType(final String value) { + edmEntityType = value; + } + + /** + * Gets the value of the edmEntitySet property. + * + * @return possible object is {@link String } + * + */ + public String getEDMEntitySet() { + return edmEntitySet; + } + + /** + * Sets the value of the edmEntitySet property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMEntitySet(final String value) { + edmEntitySet = value; + } + + /** + * Gets the value of the jpaAttributes property. + * + * @return possible object is {@link JPAAttributeMapType } + * + */ + public JPAAttributeMapType getJPAAttributes() { + return jpaAttributes; + } + + /** + * Sets the value of the jpaAttributes property. + * + * @param value allowed object is {@link JPAAttributeMapType } + * + */ + public void setJPAAttributes(final JPAAttributeMapType value) { + jpaAttributes = value; + } + + /** + * Gets the value of the jpaRelationships property. + * + * @return possible object is {@link JPARelationshipMapType } + * + */ + public JPARelationshipMapType getJPARelationships() { + return jpaRelationships; + } + + /** + * Sets the value of the jpaRelationships property. + * + * @param value allowed object is {@link JPARelationshipMapType } + * + */ + public void setJPARelationships(final JPARelationshipMapType value) { + jpaRelationships = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } + + /** + * Gets the value of the exclude property. + * + * @return possible object is {@link Boolean } + * + */ + public boolean isExclude() { + if (exclude == null) { + return false; + } + return exclude; + } + + /** + * Sets the value of the exclude property. + * + * @param value allowed object is {@link Boolean } + * + */ + public void setExclude(final Boolean value) { + exclude = value; } - } - - /** - * Sets the value of the exclude property. - * - * @param value - * allowed object is {@link Boolean } - * - */ - public void setExclude(final Boolean value) { - exclude = value; - } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java index 7a72e0848..afacaceca 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java @@ -1,39 +1,33 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; import java.util.ArrayList; import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** * * Java class for JPAEntityTypesMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAEntityTypesMapType"> * <complexContent> @@ -47,43 +41,42 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAEntityTypesMapType", propOrder = { "jpaEntityType" }) +@XmlType(name = "JPAEntityTypesMapType", propOrder = {"jpaEntityType"}) public class JPAEntityTypesMapType { - @XmlElement(name = "JPAEntityType") - protected List jpaEntityType; + @XmlElement(name = "JPAEntityType") + protected List jpaEntityType; - /** - * Gets the value of the jpaEntityType property. - * - * - * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the jpaEntityType property. - * - * - * For example, to add a new item, do as follows: - * - * - * getJPAEntityType().add(newItem); - * - * - * - * - * Objects of the following type(s) are allowed in the list {@link JPAEntityTypeMapType } - * - * - */ - public List getJPAEntityType() { - if (jpaEntityType == null) { - jpaEntityType = new ArrayList(); + /** + * Gets the value of the jpaEntityType property. + * + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaEntityType property. + * + * + * For example, to add a new item, do as follows: + * + * + * getJPAEntityType().add(newItem); + * + * + * + * + * Objects of the following type(s) are allowed in the list {@link JPAEntityTypeMapType } + * + * + */ + public List getJPAEntityType() { + if (jpaEntityType == null) { + jpaEntityType = new ArrayList(); + } + return jpaEntityType; } - return jpaEntityType; - } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java index 22260eac1..7ce8c0aa0 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java @@ -1,42 +1,37 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** - * - * By default Java Persistence Unit name is taken as EDM schema name. This can - * be overriden using JPAPersistenceUnitMapType. - * - * + * + * By default Java Persistence Unit name is taken as EDM schema name. This can be overriden using + * JPAPersistenceUnitMapType. + * + * * * Java class for JPAPersistenceUnitMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAPersistenceUnitMapType"> * <complexContent> @@ -53,105 +48,100 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAPersistenceUnitMapType", - propOrder = { "edmSchemaNamespace", "jpaEntityTypes", "jpaEmbeddableTypes" }) +@XmlType(name = "JPAPersistenceUnitMapType", propOrder = {"edmSchemaNamespace", "jpaEntityTypes", "jpaEmbeddableTypes"}) public class JPAPersistenceUnitMapType { - @XmlElement(name = "EDMSchemaNamespace") - protected String edmSchemaNamespace; - @XmlElement(name = "JPAEntityTypes", required = true) - protected JPAEntityTypesMapType jpaEntityTypes; - @XmlElement(name = "JPAEmbeddableTypes", required = true) - protected JPAEmbeddableTypesMapType jpaEmbeddableTypes; - @XmlAttribute(name = "name", required = true) - protected String name; + @XmlElement(name = "EDMSchemaNamespace") + protected String edmSchemaNamespace; + @XmlElement(name = "JPAEntityTypes", required = true) + protected JPAEntityTypesMapType jpaEntityTypes; + @XmlElement(name = "JPAEmbeddableTypes", required = true) + protected JPAEmbeddableTypesMapType jpaEmbeddableTypes; + @XmlAttribute(name = "name", required = true) + protected String name; - /** - * Gets the value of the edmSchemaNamespace property. - * - * @return possible object is {@link String } - * - */ - public String getEDMSchemaNamespace() { - return edmSchemaNamespace; - } + /** + * Gets the value of the edmSchemaNamespace property. + * + * @return possible object is {@link String } + * + */ + public String getEDMSchemaNamespace() { + return edmSchemaNamespace; + } - /** - * Sets the value of the edmSchemaNamespace property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMSchemaNamespace(final String value) { - edmSchemaNamespace = value; - } + /** + * Sets the value of the edmSchemaNamespace property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMSchemaNamespace(final String value) { + edmSchemaNamespace = value; + } - /** - * Gets the value of the jpaEntityTypes property. - * - * @return possible object is {@link JPAEntityTypesMapType } - * - */ - public JPAEntityTypesMapType getJPAEntityTypes() { - return jpaEntityTypes; - } + /** + * Gets the value of the jpaEntityTypes property. + * + * @return possible object is {@link JPAEntityTypesMapType } + * + */ + public JPAEntityTypesMapType getJPAEntityTypes() { + return jpaEntityTypes; + } - /** - * Sets the value of the jpaEntityTypes property. - * - * @param value - * allowed object is {@link JPAEntityTypesMapType } - * - */ - public void setJPAEntityTypes(final JPAEntityTypesMapType value) { - jpaEntityTypes = value; - } + /** + * Sets the value of the jpaEntityTypes property. + * + * @param value allowed object is {@link JPAEntityTypesMapType } + * + */ + public void setJPAEntityTypes(final JPAEntityTypesMapType value) { + jpaEntityTypes = value; + } - /** - * Gets the value of the jpaEmbeddableTypes property. - * - * @return possible object is {@link JPAEmbeddableTypesMapType } - * - */ - public JPAEmbeddableTypesMapType getJPAEmbeddableTypes() { - return jpaEmbeddableTypes; - } + /** + * Gets the value of the jpaEmbeddableTypes property. + * + * @return possible object is {@link JPAEmbeddableTypesMapType } + * + */ + public JPAEmbeddableTypesMapType getJPAEmbeddableTypes() { + return jpaEmbeddableTypes; + } - /** - * Sets the value of the jpaEmbeddableTypes property. - * - * @param value - * allowed object is {@link JPAEmbeddableTypesMapType } - * - */ - public void setJPAEmbeddableTypes(final JPAEmbeddableTypesMapType value) { - jpaEmbeddableTypes = value; - } + /** + * Sets the value of the jpaEmbeddableTypes property. + * + * @param value allowed object is {@link JPAEmbeddableTypesMapType } + * + */ + public void setJPAEmbeddableTypes(final JPAEmbeddableTypesMapType value) { + jpaEmbeddableTypes = value; + } - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return name; - } + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } - /** - * Sets the value of the name property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setName(final String value) { - name = value; - } + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java index 25a2f9569..50970877e 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java @@ -1,46 +1,40 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; import java.util.ArrayList; import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlValue; /** - * - * The default name for EDM navigation property is derived from JPA relationship - * name. This can be overriden using JPARelationshipMapType. - * - * + * + * The default name for EDM navigation property is derived from JPA relationship name. This can be + * overriden using JPARelationshipMapType. + * + * * * Java class for JPARelationshipMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPARelationshipMapType"> * <complexContent> @@ -60,116 +54,113 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPARelationshipMapType", propOrder = { "jpaRelationship" }) +@XmlType(name = "JPARelationshipMapType", propOrder = {"jpaRelationship"}) public class JPARelationshipMapType { - @XmlElement(name = "JPARelationship") - protected List jpaRelationship; - - /** - * Gets the value of the jpaRelationship property. - * - * - * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the jpaRelationship property. - * - * - * For example, to add a new item, do as follows: - * - * - * getJPARelationship().add(newItem); - * - * - * - * - * Objects of the following type(s) are allowed in the list {@link JPARelationshipMapType.JPARelationship } - * - * - */ - public List getJPARelationship() { - if (jpaRelationship == null) { - jpaRelationship = new ArrayList(); - } - return jpaRelationship; - } - - /** - * - * Java class for anonymous complex type. - * - * - * The following schema fragment specifies the expected content contained - * within this class. - * - * - * <complexType> - * <simpleContent> - * <extension base="<http://www.w3.org/2001/XMLSchema>string"> - * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * </extension> - * </simpleContent> - * </complexType> - * - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { "value" }) - public static class JPARelationship { - - @XmlValue - protected String value; - @XmlAttribute(name = "name", required = true) - protected String name; + @XmlElement(name = "JPARelationship") + protected List jpaRelationship; /** - * Gets the value of the value property. + * Gets the value of the jpaRelationship property. * - * @return possible object is {@link String } + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaRelationship property. * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. + * + * For example, to add a new item, do as follows: * - * @param value - * allowed object is {@link String } + * + * getJPARelationship().add(newItem); + * * - */ - public void setValue(final String value) { - this.value = value; - } - - /** - * Gets the value of the name property. * - * @return possible object is {@link String } + * + * Objects of the following type(s) are allowed in the list + * {@link JPARelationshipMapType.JPARelationship } + * * */ - public String getName() { - return name; + public List getJPARelationship() { + if (jpaRelationship == null) { + jpaRelationship = new ArrayList(); + } + return jpaRelationship; } /** - * Sets the value of the name property. + * + * Java class for anonymous complex type. + * + * + * The following schema fragment specifies the expected content contained within this class. + * + * + * <complexType> + * <simpleContent> + * <extension base="<http://www.w3.org/2001/XMLSchema>string"> + * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * </extension> + * </simpleContent> + * </complexType> + * * - * @param value - * allowed object is {@link String } * */ - public void setName(final String value) { - name = value; - } + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"value"}) + public static class JPARelationship { + + @XmlValue + protected String value; + @XmlAttribute(name = "name", required = true) + protected String name; - } + /** + * Gets the value of the value property. + * + * @return possible object is {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value allowed object is {@link String } + * + */ + public void setValue(final String value) { + this.value = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } + + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java index 45a7c3f9b..ed06d3832 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java @@ -1,28 +1,24 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ /** - * OData JPA Processor API Library - Mapping Model - * The JPA EDM Mapping model (XML document) is represented as JAXB annotated Java Classes. - * - * + * OData JPA Processor API Library - Mapping Model The JPA EDM Mapping model (XML document) + * is represented as JAXB annotated Java Classes. + * + * */ -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping", - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +@jakarta.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping", + elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED) package org.apache.olingo.odata2.jpa.processor.api.model.mapping; diff --git a/odata2-jpa-processor/jpa-core/pom.xml b/odata2-jpa-processor/jpa-core/pom.xml index c8eb662a5..2c09c1faa 100644 --- a/odata2-jpa-processor/jpa-core/pom.xml +++ b/odata2-jpa-processor/jpa-core/pom.xml @@ -24,7 +24,7 @@ org.apache.olingo olingo-odata2-jpa-processor - 2.0.13 + 3.0.0-SNAPSHOT ../ @@ -68,10 +68,9 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 - 1.6 - 1.6 + 17 + 17 @@ -88,9 +87,8 @@ - org.eclipse.persistence - javax.persistence - ${version.javax.persistence} + jakarta.persistence + jakarta.persistence-api @@ -122,14 +120,13 @@ junit junit - 4.9 test - org.easymock - easymock - 3.1 - test + org.easymock + easymock + 5.2.0 + test @@ -138,7 +135,6 @@ org.slf4j slf4j-api - 1.7.2 test
Java class for anonymous complex type. - * - *
The following schema fragment specifies the expected content contained within this class. - * - *
- * <complexType> - * <simpleContent> - * <extension base="<http://www.w3.org/2001/XMLSchema>string"> - * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * <attribute name="exclude" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /> - * </extension> - * </simpleContent> - * </complexType> - *
+ * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaAttribute property. * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. + *
+ * For example, to add a new item, do as follows: + * + *
+ * getJPAAttribute().add(newItem); + *
+ * Objects of the following type(s) are allowed in the list + * {@link JPAAttributeMapType.JPAAttribute } * - * @return - * possible object is {@link String } * */ - public String getName() { - return name; + public List getJPAAttribute() { + if (jpaAttribute == null) { + jpaAttribute = new ArrayList(); + } + return jpaAttribute; } /** - * Sets the value of the name property. + * + * Java class for anonymous complex type. * - * @param value - * allowed object is {@link String } + * + * The following schema fragment specifies the expected content contained within this class. * - */ - public void setName(final String value) { - name = value; - } - - /** - * Gets the value of the exclude property. + * + * <complexType> + * <simpleContent> + * <extension base="<http://www.w3.org/2001/XMLSchema>string"> + * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute name="exclude" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /> + * </extension> + * </simpleContent> + * </complexType> + * * - * @return - * possible object is {@link Boolean } * */ - public boolean isExclude() { - if (exclude == null) { - return false; - } else { - return exclude; - } - } + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"value"}) + public static class JPAAttribute { - /** - * Sets the value of the exclude property. - * - * @param value - * allowed object is {@link Boolean } - * - */ - public void setExclude(final Boolean value) { - exclude = value; - } + @XmlValue + protected String value; + @XmlAttribute(name = "name", required = true) + protected String name; + @XmlAttribute(name = "exclude") + protected Boolean exclude; - } + /** + * Gets the value of the value property. + * + * @return possible object is {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value allowed object is {@link String } + * + */ + public void setValue(final String value) { + this.value = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } + + /** + * Gets the value of the exclude property. + * + * @return possible object is {@link Boolean } + * + */ + public boolean isExclude() { + if (exclude == null) { + return false; + } + return exclude; + } + + /** + * Sets the value of the exclude property. + * + * @param value allowed object is {@link Boolean } + * + */ + public void setExclude(final Boolean value) { + exclude = value; + } + + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModel.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModel.java index a4175d481..b2b255cbe 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModel.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModel.java @@ -1,37 +1,32 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; /** * * Java class for anonymous complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType> * <complexContent> @@ -44,36 +39,35 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { "persistenceUnit" }) +@XmlType(name = "", propOrder = {"persistenceUnit"}) @XmlRootElement(name = "JPAEDMMappingModel") public class JPAEdmMappingModel { - @XmlElement(name = "PersistenceUnit", required = true) - protected JPAPersistenceUnitMapType persistenceUnit; + @XmlElement(name = "PersistenceUnit", required = true) + protected JPAPersistenceUnitMapType persistenceUnit; - /** - * Gets the value of the persistenceUnit property. - * - * @return possible object is {@link JPAPersistenceUnitMapType } - * - */ - public JPAPersistenceUnitMapType getPersistenceUnit() { - return persistenceUnit; - } + /** + * Gets the value of the persistenceUnit property. + * + * @return possible object is {@link JPAPersistenceUnitMapType } + * + */ + public JPAPersistenceUnitMapType getPersistenceUnit() { + return persistenceUnit; + } - /** - * Sets the value of the persistenceUnit property. - * - * @param value - * allowed object is {@link JPAPersistenceUnitMapType } - * - */ - public void setPersistenceUnit(final JPAPersistenceUnitMapType value) { - persistenceUnit = value; - } + /** + * Sets the value of the persistenceUnit property. + * + * @param value allowed object is {@link JPAPersistenceUnitMapType } + * + */ + public void setPersistenceUnit(final JPAPersistenceUnitMapType value) { + persistenceUnit = value; + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModelFactory.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModelFactory.java index 84f8b282b..5ab4991bc 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModelFactory.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEdmMappingModelFactory.java @@ -1,85 +1,83 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlRegistry; +import jakarta.xml.bind.annotation.XmlRegistry; /** - * This object contains factory methods for each Java content interface and Java - * element interface generated in the - * org.apache.olingo.odata2.processor.api.jpa.model.mapping package. + * This object contains factory methods for each Java content interface and Java element interface + * generated in the org.apache.olingo.odata2.processor.api.jpa.model.mapping package. * - * An ObjectFactory allows you to programatically construct new instances of the - * Java representation for XML content. The Java representation of XML content - * can consist of schema derived interfaces and classes representing the binding - * of schema type definitions, element declarations and model groups. Factory - * methods for each of these are provided in this class. - * + * An ObjectFactory allows you to programatically construct new instances of the Java representation + * for XML content. The Java representation of XML content can consist of schema derived interfaces + * and classes representing the binding of schema type definitions, element declarations and model + * groups. Factory methods for each of these are provided in this class. + * */ @XmlRegistry public class JPAEdmMappingModelFactory { - /** - * Create a new ObjectFactory that can be used to create new instances of - * schema derived classes for package: - * org.apache.olingo.odata2.processor.api.jpa.model.mapping - * - */ - public JPAEdmMappingModelFactory() {} + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for + * package: org.apache.olingo.odata2.processor.api.jpa.model.mapping + * + */ + public JPAEdmMappingModelFactory() {} - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPARelationshipMapType } - * - */ - public JPARelationshipMapType createJPARelationshipMapType() { - return new JPARelationshipMapType(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPARelationshipMapType } + * + */ + public JPARelationshipMapType createJPARelationshipMapType() { + return new JPARelationshipMapType(); + } - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAAttributeMapType } - * - */ - public JPAAttributeMapType createJPAAttributeMapType() { - return new JPAAttributeMapType(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAAttributeMapType } + * + */ + public JPAAttributeMapType createJPAAttributeMapType() { + return new JPAAttributeMapType(); + } - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEdmMappingModel } - * - */ - public JPAEdmMappingModel createJPAEDMMappingModel() { - return new JPAEdmMappingModel(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEdmMappingModel } + * + */ + public JPAEdmMappingModel createJPAEDMMappingModel() { + return new JPAEdmMappingModel(); + } - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAPersistenceUnitMapType } - * - */ - public JPAPersistenceUnitMapType createJPAPersistenceUnitMapType() { - return new JPAPersistenceUnitMapType(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAPersistenceUnitMapType } + * + */ + public JPAPersistenceUnitMapType createJPAPersistenceUnitMapType() { + return new JPAPersistenceUnitMapType(); + } - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEmbeddableTypeMapType } - * - */ - public JPAEmbeddableTypeMapType createJPAEmbeddableTypeMapType() { - return new JPAEmbeddableTypeMapType(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEmbeddableTypeMapType } + * + */ + public JPAEmbeddableTypeMapType createJPAEmbeddableTypeMapType() { + return new JPAEmbeddableTypeMapType(); + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypeMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypeMapType.java index e64067387..47803af26 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypeMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypeMapType.java @@ -1,40 +1,37 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** - * - * The default name for EDM - * complex type is derived from JPA Embeddable type name. This can be + * + * The default name for EDM complex type is derived from JPA Embeddable type name. This can be * overriden using JPAEmbeddableTypeMapType. - * - * - * Java class for JPAEmbeddableTypeMapType complex type. - * - * The following schema fragment specifies the expected content contained within this class. - * + * + * + * + * Java class for JPAEmbeddableTypeMapType complex type. + * + * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAEmbeddableTypeMapType"> * <complexContent> @@ -50,112 +47,103 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAEmbeddableTypeMapType", propOrder = { "edmComplexType", "jpaAttributes" }) +@XmlType(name = "JPAEmbeddableTypeMapType", propOrder = {"edmComplexType", "jpaAttributes"}) public class JPAEmbeddableTypeMapType { - @XmlElement(name = "EDMComplexType") - protected String edmComplexType; - @XmlElement(name = "JPAAttributes", required = true) - protected JPAAttributeMapType jpaAttributes; - @XmlAttribute(name = "name", required = true) - protected String name; - @XmlAttribute(name = "exclude") - protected Boolean exclude; + @XmlElement(name = "EDMComplexType") + protected String edmComplexType; + @XmlElement(name = "JPAAttributes", required = true) + protected JPAAttributeMapType jpaAttributes; + @XmlAttribute(name = "name", required = true) + protected String name; + @XmlAttribute(name = "exclude") + protected Boolean exclude; - /** - * Gets the value of the edmComplexType property. - * - * @return - * possible object is {@link String } - * - */ - public String getEDMComplexType() { - return edmComplexType; - } + /** + * Gets the value of the edmComplexType property. + * + * @return possible object is {@link String } + * + */ + public String getEDMComplexType() { + return edmComplexType; + } - /** - * Sets the value of the edmComplexType property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMComplexType(final String value) { - edmComplexType = value; - } + /** + * Sets the value of the edmComplexType property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMComplexType(final String value) { + edmComplexType = value; + } - /** - * Gets the value of the jpaAttributes property. - * - * @return - * possible object is {@link JPAAttributeMapType } - * - */ - public JPAAttributeMapType getJPAAttributes() { - return jpaAttributes; - } + /** + * Gets the value of the jpaAttributes property. + * + * @return possible object is {@link JPAAttributeMapType } + * + */ + public JPAAttributeMapType getJPAAttributes() { + return jpaAttributes; + } - /** - * Sets the value of the jpaAttributes property. - * - * @param value - * allowed object is {@link JPAAttributeMapType } - * - */ - public void setJPAAttributes(final JPAAttributeMapType value) { - jpaAttributes = value; - } + /** + * Sets the value of the jpaAttributes property. + * + * @param value allowed object is {@link JPAAttributeMapType } + * + */ + public void setJPAAttributes(final JPAAttributeMapType value) { + jpaAttributes = value; + } - /** - * Gets the value of the name property. - * - * @return - * possible object is {@link String } - * - */ - public String getName() { - return name; - } + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } - /** - * Sets the value of the name property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setName(final String value) { - name = value; - } + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } - /** - * Gets the value of the exclude property. - * - * @return - * possible object is {@link Boolean } - * - */ - public boolean isExclude() { - if (exclude == null) { - return false; - } else { - return exclude; + /** + * Gets the value of the exclude property. + * + * @return possible object is {@link Boolean } + * + */ + public boolean isExclude() { + if (exclude == null) { + return false; + } + return exclude; } - } - /** - * Sets the value of the exclude property. - * - * @param value - * allowed object is {@link Boolean } - * - */ - public void setExclude(final Boolean value) { - exclude = value; - } + /** + * Sets the value of the exclude property. + * + * @param value allowed object is {@link Boolean } + * + */ + public void setExclude(final Boolean value) { + exclude = value; + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypesMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypesMapType.java index 629312444..6bec5a120 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypesMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypesMapType.java @@ -1,39 +1,33 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; import java.util.ArrayList; import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** * * Java class for JPAEmbeddableTypesMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAEmbeddableTypesMapType"> * <complexContent> @@ -47,43 +41,42 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAEmbeddableTypesMapType", propOrder = { "jpaEmbeddableType" }) +@XmlType(name = "JPAEmbeddableTypesMapType", propOrder = {"jpaEmbeddableType"}) public class JPAEmbeddableTypesMapType { - @XmlElement(name = "JPAEmbeddableType") - protected List jpaEmbeddableType; + @XmlElement(name = "JPAEmbeddableType") + protected List jpaEmbeddableType; - /** - * Gets the value of the jpaEmbeddableType property. - * - * - * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the jpaEmbeddableType property. - * - * - * For example, to add a new item, do as follows: - * - * - * getJPAEmbeddableType().add(newItem); - * - * - * - * - * Objects of the following type(s) are allowed in the list {@link JPAEmbeddableTypeMapType } - * - * - */ - public List getJPAEmbeddableType() { - if (jpaEmbeddableType == null) { - jpaEmbeddableType = new ArrayList(); + /** + * Gets the value of the jpaEmbeddableType property. + * + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaEmbeddableType property. + * + * + * For example, to add a new item, do as follows: + * + * + * getJPAEmbeddableType().add(newItem); + * + * + * + * + * Objects of the following type(s) are allowed in the list {@link JPAEmbeddableTypeMapType } + * + * + */ + public List getJPAEmbeddableType() { + if (jpaEmbeddableType == null) { + jpaEmbeddableType = new ArrayList(); + } + return jpaEmbeddableType; } - return jpaEmbeddableType; - } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java index 22e181922..8c989234d 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java @@ -1,40 +1,37 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** - * - * The default name for EDM - * entity type is derived from JPA entity type name. This can be - * overriden using JPAEntityTypeMapType. - * - * - * Java class for JPAEntityTypeMapType complex type. - * - * The following schema fragment specifies the expected content contained within this class. - * + * + * The default name for EDM entity type is derived from JPA entity type name. This can be overriden + * using JPAEntityTypeMapType. + * + * + * + * Java class for JPAEntityTypeMapType complex type. + * + * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAEntityTypeMapType"> * <complexContent> @@ -53,161 +50,147 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAEntityTypeMapType", propOrder = { "edmEntityType", "edmEntitySet", "jpaAttributes", - "jpaRelationships" }) +@XmlType(name = "JPAEntityTypeMapType", propOrder = {"edmEntityType", "edmEntitySet", "jpaAttributes", "jpaRelationships"}) public class JPAEntityTypeMapType { - @XmlElement(name = "EDMEntityType") - protected String edmEntityType; - @XmlElement(name = "EDMEntitySet") - protected String edmEntitySet; - @XmlElement(name = "JPAAttributes", required = true) - protected JPAAttributeMapType jpaAttributes; - @XmlElement(name = "JPARelationships", required = true) - protected JPARelationshipMapType jpaRelationships; - @XmlAttribute(name = "name", required = true) - protected String name; - @XmlAttribute(name = "exclude") - protected Boolean exclude; - - /** - * Gets the value of the edmEntityType property. - * - * @return - * possible object is {@link String } - * - */ - public String getEDMEntityType() { - return edmEntityType; - } - - /** - * Sets the value of the edmEntityType property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMEntityType(final String value) { - edmEntityType = value; - } - - /** - * Gets the value of the edmEntitySet property. - * - * @return - * possible object is {@link String } - * - */ - public String getEDMEntitySet() { - return edmEntitySet; - } - - /** - * Sets the value of the edmEntitySet property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMEntitySet(final String value) { - edmEntitySet = value; - } - - /** - * Gets the value of the jpaAttributes property. - * - * @return - * possible object is {@link JPAAttributeMapType } - * - */ - public JPAAttributeMapType getJPAAttributes() { - return jpaAttributes; - } - - /** - * Sets the value of the jpaAttributes property. - * - * @param value - * allowed object is {@link JPAAttributeMapType } - * - */ - public void setJPAAttributes(final JPAAttributeMapType value) { - jpaAttributes = value; - } - - /** - * Gets the value of the jpaRelationships property. - * - * @return - * possible object is {@link JPARelationshipMapType } - * - */ - public JPARelationshipMapType getJPARelationships() { - return jpaRelationships; - } - - /** - * Sets the value of the jpaRelationships property. - * - * @param value - * allowed object is {@link JPARelationshipMapType } - * - */ - public void setJPARelationships(final JPARelationshipMapType value) { - jpaRelationships = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is {@link String } - * - */ - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setName(final String value) { - name = value; - } - - /** - * Gets the value of the exclude property. - * - * @return - * possible object is {@link Boolean } - * - */ - public boolean isExclude() { - if (exclude == null) { - return false; - } else { - return exclude; + @XmlElement(name = "EDMEntityType") + protected String edmEntityType; + @XmlElement(name = "EDMEntitySet") + protected String edmEntitySet; + @XmlElement(name = "JPAAttributes", required = true) + protected JPAAttributeMapType jpaAttributes; + @XmlElement(name = "JPARelationships", required = true) + protected JPARelationshipMapType jpaRelationships; + @XmlAttribute(name = "name", required = true) + protected String name; + @XmlAttribute(name = "exclude") + protected Boolean exclude; + + /** + * Gets the value of the edmEntityType property. + * + * @return possible object is {@link String } + * + */ + public String getEDMEntityType() { + return edmEntityType; + } + + /** + * Sets the value of the edmEntityType property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMEntityType(final String value) { + edmEntityType = value; + } + + /** + * Gets the value of the edmEntitySet property. + * + * @return possible object is {@link String } + * + */ + public String getEDMEntitySet() { + return edmEntitySet; + } + + /** + * Sets the value of the edmEntitySet property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMEntitySet(final String value) { + edmEntitySet = value; + } + + /** + * Gets the value of the jpaAttributes property. + * + * @return possible object is {@link JPAAttributeMapType } + * + */ + public JPAAttributeMapType getJPAAttributes() { + return jpaAttributes; + } + + /** + * Sets the value of the jpaAttributes property. + * + * @param value allowed object is {@link JPAAttributeMapType } + * + */ + public void setJPAAttributes(final JPAAttributeMapType value) { + jpaAttributes = value; + } + + /** + * Gets the value of the jpaRelationships property. + * + * @return possible object is {@link JPARelationshipMapType } + * + */ + public JPARelationshipMapType getJPARelationships() { + return jpaRelationships; + } + + /** + * Sets the value of the jpaRelationships property. + * + * @param value allowed object is {@link JPARelationshipMapType } + * + */ + public void setJPARelationships(final JPARelationshipMapType value) { + jpaRelationships = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } + + /** + * Gets the value of the exclude property. + * + * @return possible object is {@link Boolean } + * + */ + public boolean isExclude() { + if (exclude == null) { + return false; + } + return exclude; + } + + /** + * Sets the value of the exclude property. + * + * @param value allowed object is {@link Boolean } + * + */ + public void setExclude(final Boolean value) { + exclude = value; } - } - - /** - * Sets the value of the exclude property. - * - * @param value - * allowed object is {@link Boolean } - * - */ - public void setExclude(final Boolean value) { - exclude = value; - } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java index 7a72e0848..afacaceca 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java @@ -1,39 +1,33 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; import java.util.ArrayList; import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** * * Java class for JPAEntityTypesMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAEntityTypesMapType"> * <complexContent> @@ -47,43 +41,42 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAEntityTypesMapType", propOrder = { "jpaEntityType" }) +@XmlType(name = "JPAEntityTypesMapType", propOrder = {"jpaEntityType"}) public class JPAEntityTypesMapType { - @XmlElement(name = "JPAEntityType") - protected List jpaEntityType; + @XmlElement(name = "JPAEntityType") + protected List jpaEntityType; - /** - * Gets the value of the jpaEntityType property. - * - * - * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the jpaEntityType property. - * - * - * For example, to add a new item, do as follows: - * - * - * getJPAEntityType().add(newItem); - * - * - * - * - * Objects of the following type(s) are allowed in the list {@link JPAEntityTypeMapType } - * - * - */ - public List getJPAEntityType() { - if (jpaEntityType == null) { - jpaEntityType = new ArrayList(); + /** + * Gets the value of the jpaEntityType property. + * + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaEntityType property. + * + * + * For example, to add a new item, do as follows: + * + * + * getJPAEntityType().add(newItem); + * + * + * + * + * Objects of the following type(s) are allowed in the list {@link JPAEntityTypeMapType } + * + * + */ + public List getJPAEntityType() { + if (jpaEntityType == null) { + jpaEntityType = new ArrayList(); + } + return jpaEntityType; } - return jpaEntityType; - } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java index 22260eac1..7ce8c0aa0 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java @@ -1,42 +1,37 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** - * - * By default Java Persistence Unit name is taken as EDM schema name. This can - * be overriden using JPAPersistenceUnitMapType. - * - * + * + * By default Java Persistence Unit name is taken as EDM schema name. This can be overriden using + * JPAPersistenceUnitMapType. + * + * * * Java class for JPAPersistenceUnitMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAPersistenceUnitMapType"> * <complexContent> @@ -53,105 +48,100 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAPersistenceUnitMapType", - propOrder = { "edmSchemaNamespace", "jpaEntityTypes", "jpaEmbeddableTypes" }) +@XmlType(name = "JPAPersistenceUnitMapType", propOrder = {"edmSchemaNamespace", "jpaEntityTypes", "jpaEmbeddableTypes"}) public class JPAPersistenceUnitMapType { - @XmlElement(name = "EDMSchemaNamespace") - protected String edmSchemaNamespace; - @XmlElement(name = "JPAEntityTypes", required = true) - protected JPAEntityTypesMapType jpaEntityTypes; - @XmlElement(name = "JPAEmbeddableTypes", required = true) - protected JPAEmbeddableTypesMapType jpaEmbeddableTypes; - @XmlAttribute(name = "name", required = true) - protected String name; + @XmlElement(name = "EDMSchemaNamespace") + protected String edmSchemaNamespace; + @XmlElement(name = "JPAEntityTypes", required = true) + protected JPAEntityTypesMapType jpaEntityTypes; + @XmlElement(name = "JPAEmbeddableTypes", required = true) + protected JPAEmbeddableTypesMapType jpaEmbeddableTypes; + @XmlAttribute(name = "name", required = true) + protected String name; - /** - * Gets the value of the edmSchemaNamespace property. - * - * @return possible object is {@link String } - * - */ - public String getEDMSchemaNamespace() { - return edmSchemaNamespace; - } + /** + * Gets the value of the edmSchemaNamespace property. + * + * @return possible object is {@link String } + * + */ + public String getEDMSchemaNamespace() { + return edmSchemaNamespace; + } - /** - * Sets the value of the edmSchemaNamespace property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMSchemaNamespace(final String value) { - edmSchemaNamespace = value; - } + /** + * Sets the value of the edmSchemaNamespace property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMSchemaNamespace(final String value) { + edmSchemaNamespace = value; + } - /** - * Gets the value of the jpaEntityTypes property. - * - * @return possible object is {@link JPAEntityTypesMapType } - * - */ - public JPAEntityTypesMapType getJPAEntityTypes() { - return jpaEntityTypes; - } + /** + * Gets the value of the jpaEntityTypes property. + * + * @return possible object is {@link JPAEntityTypesMapType } + * + */ + public JPAEntityTypesMapType getJPAEntityTypes() { + return jpaEntityTypes; + } - /** - * Sets the value of the jpaEntityTypes property. - * - * @param value - * allowed object is {@link JPAEntityTypesMapType } - * - */ - public void setJPAEntityTypes(final JPAEntityTypesMapType value) { - jpaEntityTypes = value; - } + /** + * Sets the value of the jpaEntityTypes property. + * + * @param value allowed object is {@link JPAEntityTypesMapType } + * + */ + public void setJPAEntityTypes(final JPAEntityTypesMapType value) { + jpaEntityTypes = value; + } - /** - * Gets the value of the jpaEmbeddableTypes property. - * - * @return possible object is {@link JPAEmbeddableTypesMapType } - * - */ - public JPAEmbeddableTypesMapType getJPAEmbeddableTypes() { - return jpaEmbeddableTypes; - } + /** + * Gets the value of the jpaEmbeddableTypes property. + * + * @return possible object is {@link JPAEmbeddableTypesMapType } + * + */ + public JPAEmbeddableTypesMapType getJPAEmbeddableTypes() { + return jpaEmbeddableTypes; + } - /** - * Sets the value of the jpaEmbeddableTypes property. - * - * @param value - * allowed object is {@link JPAEmbeddableTypesMapType } - * - */ - public void setJPAEmbeddableTypes(final JPAEmbeddableTypesMapType value) { - jpaEmbeddableTypes = value; - } + /** + * Sets the value of the jpaEmbeddableTypes property. + * + * @param value allowed object is {@link JPAEmbeddableTypesMapType } + * + */ + public void setJPAEmbeddableTypes(final JPAEmbeddableTypesMapType value) { + jpaEmbeddableTypes = value; + } - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return name; - } + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } - /** - * Sets the value of the name property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setName(final String value) { - name = value; - } + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java index 25a2f9569..50970877e 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java @@ -1,46 +1,40 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; import java.util.ArrayList; import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlValue; /** - * - * The default name for EDM navigation property is derived from JPA relationship - * name. This can be overriden using JPARelationshipMapType. - * - * + * + * The default name for EDM navigation property is derived from JPA relationship name. This can be + * overriden using JPARelationshipMapType. + * + * * * Java class for JPARelationshipMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPARelationshipMapType"> * <complexContent> @@ -60,116 +54,113 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPARelationshipMapType", propOrder = { "jpaRelationship" }) +@XmlType(name = "JPARelationshipMapType", propOrder = {"jpaRelationship"}) public class JPARelationshipMapType { - @XmlElement(name = "JPARelationship") - protected List jpaRelationship; - - /** - * Gets the value of the jpaRelationship property. - * - * - * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the jpaRelationship property. - * - * - * For example, to add a new item, do as follows: - * - * - * getJPARelationship().add(newItem); - * - * - * - * - * Objects of the following type(s) are allowed in the list {@link JPARelationshipMapType.JPARelationship } - * - * - */ - public List getJPARelationship() { - if (jpaRelationship == null) { - jpaRelationship = new ArrayList(); - } - return jpaRelationship; - } - - /** - * - * Java class for anonymous complex type. - * - * - * The following schema fragment specifies the expected content contained - * within this class. - * - * - * <complexType> - * <simpleContent> - * <extension base="<http://www.w3.org/2001/XMLSchema>string"> - * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * </extension> - * </simpleContent> - * </complexType> - * - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { "value" }) - public static class JPARelationship { - - @XmlValue - protected String value; - @XmlAttribute(name = "name", required = true) - protected String name; + @XmlElement(name = "JPARelationship") + protected List jpaRelationship; /** - * Gets the value of the value property. + * Gets the value of the jpaRelationship property. * - * @return possible object is {@link String } + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaRelationship property. * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. + * + * For example, to add a new item, do as follows: * - * @param value - * allowed object is {@link String } + * + * getJPARelationship().add(newItem); + * * - */ - public void setValue(final String value) { - this.value = value; - } - - /** - * Gets the value of the name property. * - * @return possible object is {@link String } + * + * Objects of the following type(s) are allowed in the list + * {@link JPARelationshipMapType.JPARelationship } + * * */ - public String getName() { - return name; + public List getJPARelationship() { + if (jpaRelationship == null) { + jpaRelationship = new ArrayList(); + } + return jpaRelationship; } /** - * Sets the value of the name property. + * + * Java class for anonymous complex type. + * + * + * The following schema fragment specifies the expected content contained within this class. + * + * + * <complexType> + * <simpleContent> + * <extension base="<http://www.w3.org/2001/XMLSchema>string"> + * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * </extension> + * </simpleContent> + * </complexType> + * * - * @param value - * allowed object is {@link String } * */ - public void setName(final String value) { - name = value; - } + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"value"}) + public static class JPARelationship { + + @XmlValue + protected String value; + @XmlAttribute(name = "name", required = true) + protected String name; - } + /** + * Gets the value of the value property. + * + * @return possible object is {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value allowed object is {@link String } + * + */ + public void setValue(final String value) { + this.value = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } + + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java index 45a7c3f9b..ed06d3832 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java @@ -1,28 +1,24 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ /** - * OData JPA Processor API Library - Mapping Model - * The JPA EDM Mapping model (XML document) is represented as JAXB annotated Java Classes. - * - * + * OData JPA Processor API Library - Mapping Model The JPA EDM Mapping model (XML document) + * is represented as JAXB annotated Java Classes. + * + * */ -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping", - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +@jakarta.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping", + elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED) package org.apache.olingo.odata2.jpa.processor.api.model.mapping; diff --git a/odata2-jpa-processor/jpa-core/pom.xml b/odata2-jpa-processor/jpa-core/pom.xml index c8eb662a5..2c09c1faa 100644 --- a/odata2-jpa-processor/jpa-core/pom.xml +++ b/odata2-jpa-processor/jpa-core/pom.xml @@ -24,7 +24,7 @@ org.apache.olingo olingo-odata2-jpa-processor - 2.0.13 + 3.0.0-SNAPSHOT ../ @@ -68,10 +68,9 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 - 1.6 - 1.6 + 17 + 17 @@ -88,9 +87,8 @@ - org.eclipse.persistence - javax.persistence - ${version.javax.persistence} + jakarta.persistence + jakarta.persistence-api @@ -122,14 +120,13 @@ junit junit - 4.9 test - org.easymock - easymock - 3.1 - test + org.easymock + easymock + 5.2.0 + test @@ -138,7 +135,6 @@ org.slf4j slf4j-api - 1.7.2 test
+ * Java class for anonymous complex type. * - * @param value - * allowed object is {@link String } + *
+ * The following schema fragment specifies the expected content contained within this class. * - */ - public void setName(final String value) { - name = value; - } - - /** - * Gets the value of the exclude property. + *
+ * <complexType> + * <simpleContent> + * <extension base="<http://www.w3.org/2001/XMLSchema>string"> + * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute name="exclude" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /> + * </extension> + * </simpleContent> + * </complexType> + *
* Java class for anonymous complex type. - * + * *
- * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * *
* <complexType> * <complexContent> @@ -44,36 +39,35 @@ * </complexContent> * </complexType> *
- * An ObjectFactory allows you to programatically construct new instances of the - * Java representation for XML content. The Java representation of XML content - * can consist of schema derived interfaces and classes representing the binding - * of schema type definitions, element declarations and model groups. Factory - * methods for each of these are provided in this class. - * + * An ObjectFactory allows you to programatically construct new instances of the Java representation + * for XML content. The Java representation of XML content can consist of schema derived interfaces + * and classes representing the binding of schema type definitions, element declarations and model + * groups. Factory methods for each of these are provided in this class. + * */ @XmlRegistry public class JPAEdmMappingModelFactory { - /** - * Create a new ObjectFactory that can be used to create new instances of - * schema derived classes for package: - * org.apache.olingo.odata2.processor.api.jpa.model.mapping - * - */ - public JPAEdmMappingModelFactory() {} + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for + * package: org.apache.olingo.odata2.processor.api.jpa.model.mapping + * + */ + public JPAEdmMappingModelFactory() {} - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPARelationshipMapType } - * - */ - public JPARelationshipMapType createJPARelationshipMapType() { - return new JPARelationshipMapType(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPARelationshipMapType } + * + */ + public JPARelationshipMapType createJPARelationshipMapType() { + return new JPARelationshipMapType(); + } - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAAttributeMapType } - * - */ - public JPAAttributeMapType createJPAAttributeMapType() { - return new JPAAttributeMapType(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAAttributeMapType } + * + */ + public JPAAttributeMapType createJPAAttributeMapType() { + return new JPAAttributeMapType(); + } - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEdmMappingModel } - * - */ - public JPAEdmMappingModel createJPAEDMMappingModel() { - return new JPAEdmMappingModel(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEdmMappingModel } + * + */ + public JPAEdmMappingModel createJPAEDMMappingModel() { + return new JPAEdmMappingModel(); + } - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAPersistenceUnitMapType } - * - */ - public JPAPersistenceUnitMapType createJPAPersistenceUnitMapType() { - return new JPAPersistenceUnitMapType(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAPersistenceUnitMapType } + * + */ + public JPAPersistenceUnitMapType createJPAPersistenceUnitMapType() { + return new JPAPersistenceUnitMapType(); + } - /** - * Create an instance of {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEmbeddableTypeMapType } - * - */ - public JPAEmbeddableTypeMapType createJPAEmbeddableTypeMapType() { - return new JPAEmbeddableTypeMapType(); - } + /** + * Create an instance of + * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEmbeddableTypeMapType } + * + */ + public JPAEmbeddableTypeMapType createJPAEmbeddableTypeMapType() { + return new JPAEmbeddableTypeMapType(); + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypeMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypeMapType.java index e64067387..47803af26 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypeMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEmbeddableTypeMapType.java @@ -1,40 +1,37 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** - * - * The default name for EDM - * complex type is derived from JPA Embeddable type name. This can be + * + * The default name for EDM complex type is derived from JPA Embeddable type name. This can be * overriden using JPAEmbeddableTypeMapType. - * - * - *
Java class for JPAEmbeddableTypeMapType complex type. - * - *
+ * Java class for JPAEmbeddableTypeMapType complex type. + * + *
* <complexType name="JPAEmbeddableTypeMapType"> * <complexContent> @@ -50,112 +47,103 @@ * </complexContent> * </complexType> *
* Java class for JPAEmbeddableTypesMapType complex type. - * + * *
* <complexType name="JPAEmbeddableTypesMapType"> * <complexContent> @@ -47,43 +41,42 @@ * </complexContent> * </complexType> *
- * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the jpaEmbeddableType property. - * - *
- * For example, to add a new item, do as follows: - * - *
- * getJPAEmbeddableType().add(newItem); - *
- * Objects of the following type(s) are allowed in the list {@link JPAEmbeddableTypeMapType } - * - * - */ - public List getJPAEmbeddableType() { - if (jpaEmbeddableType == null) { - jpaEmbeddableType = new ArrayList(); + /** + * Gets the value of the jpaEmbeddableType property. + * + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaEmbeddableType property. + * + * + * For example, to add a new item, do as follows: + * + * + * getJPAEmbeddableType().add(newItem); + * + * + * + * + * Objects of the following type(s) are allowed in the list {@link JPAEmbeddableTypeMapType } + * + * + */ + public List getJPAEmbeddableType() { + if (jpaEmbeddableType == null) { + jpaEmbeddableType = new ArrayList(); + } + return jpaEmbeddableType; } - return jpaEmbeddableType; - } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java index 22e181922..8c989234d 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java @@ -1,40 +1,37 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** - * - * The default name for EDM - * entity type is derived from JPA entity type name. This can be - * overriden using JPAEntityTypeMapType. - * - * - * Java class for JPAEntityTypeMapType complex type. - * - * The following schema fragment specifies the expected content contained within this class. - * + * + * The default name for EDM entity type is derived from JPA entity type name. This can be overriden + * using JPAEntityTypeMapType. + * + * + * + * Java class for JPAEntityTypeMapType complex type. + * + * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAEntityTypeMapType"> * <complexContent> @@ -53,161 +50,147 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAEntityTypeMapType", propOrder = { "edmEntityType", "edmEntitySet", "jpaAttributes", - "jpaRelationships" }) +@XmlType(name = "JPAEntityTypeMapType", propOrder = {"edmEntityType", "edmEntitySet", "jpaAttributes", "jpaRelationships"}) public class JPAEntityTypeMapType { - @XmlElement(name = "EDMEntityType") - protected String edmEntityType; - @XmlElement(name = "EDMEntitySet") - protected String edmEntitySet; - @XmlElement(name = "JPAAttributes", required = true) - protected JPAAttributeMapType jpaAttributes; - @XmlElement(name = "JPARelationships", required = true) - protected JPARelationshipMapType jpaRelationships; - @XmlAttribute(name = "name", required = true) - protected String name; - @XmlAttribute(name = "exclude") - protected Boolean exclude; - - /** - * Gets the value of the edmEntityType property. - * - * @return - * possible object is {@link String } - * - */ - public String getEDMEntityType() { - return edmEntityType; - } - - /** - * Sets the value of the edmEntityType property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMEntityType(final String value) { - edmEntityType = value; - } - - /** - * Gets the value of the edmEntitySet property. - * - * @return - * possible object is {@link String } - * - */ - public String getEDMEntitySet() { - return edmEntitySet; - } - - /** - * Sets the value of the edmEntitySet property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMEntitySet(final String value) { - edmEntitySet = value; - } - - /** - * Gets the value of the jpaAttributes property. - * - * @return - * possible object is {@link JPAAttributeMapType } - * - */ - public JPAAttributeMapType getJPAAttributes() { - return jpaAttributes; - } - - /** - * Sets the value of the jpaAttributes property. - * - * @param value - * allowed object is {@link JPAAttributeMapType } - * - */ - public void setJPAAttributes(final JPAAttributeMapType value) { - jpaAttributes = value; - } - - /** - * Gets the value of the jpaRelationships property. - * - * @return - * possible object is {@link JPARelationshipMapType } - * - */ - public JPARelationshipMapType getJPARelationships() { - return jpaRelationships; - } - - /** - * Sets the value of the jpaRelationships property. - * - * @param value - * allowed object is {@link JPARelationshipMapType } - * - */ - public void setJPARelationships(final JPARelationshipMapType value) { - jpaRelationships = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is {@link String } - * - */ - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setName(final String value) { - name = value; - } - - /** - * Gets the value of the exclude property. - * - * @return - * possible object is {@link Boolean } - * - */ - public boolean isExclude() { - if (exclude == null) { - return false; - } else { - return exclude; + @XmlElement(name = "EDMEntityType") + protected String edmEntityType; + @XmlElement(name = "EDMEntitySet") + protected String edmEntitySet; + @XmlElement(name = "JPAAttributes", required = true) + protected JPAAttributeMapType jpaAttributes; + @XmlElement(name = "JPARelationships", required = true) + protected JPARelationshipMapType jpaRelationships; + @XmlAttribute(name = "name", required = true) + protected String name; + @XmlAttribute(name = "exclude") + protected Boolean exclude; + + /** + * Gets the value of the edmEntityType property. + * + * @return possible object is {@link String } + * + */ + public String getEDMEntityType() { + return edmEntityType; + } + + /** + * Sets the value of the edmEntityType property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMEntityType(final String value) { + edmEntityType = value; + } + + /** + * Gets the value of the edmEntitySet property. + * + * @return possible object is {@link String } + * + */ + public String getEDMEntitySet() { + return edmEntitySet; + } + + /** + * Sets the value of the edmEntitySet property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMEntitySet(final String value) { + edmEntitySet = value; + } + + /** + * Gets the value of the jpaAttributes property. + * + * @return possible object is {@link JPAAttributeMapType } + * + */ + public JPAAttributeMapType getJPAAttributes() { + return jpaAttributes; + } + + /** + * Sets the value of the jpaAttributes property. + * + * @param value allowed object is {@link JPAAttributeMapType } + * + */ + public void setJPAAttributes(final JPAAttributeMapType value) { + jpaAttributes = value; + } + + /** + * Gets the value of the jpaRelationships property. + * + * @return possible object is {@link JPARelationshipMapType } + * + */ + public JPARelationshipMapType getJPARelationships() { + return jpaRelationships; + } + + /** + * Sets the value of the jpaRelationships property. + * + * @param value allowed object is {@link JPARelationshipMapType } + * + */ + public void setJPARelationships(final JPARelationshipMapType value) { + jpaRelationships = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } + + /** + * Gets the value of the exclude property. + * + * @return possible object is {@link Boolean } + * + */ + public boolean isExclude() { + if (exclude == null) { + return false; + } + return exclude; + } + + /** + * Sets the value of the exclude property. + * + * @param value allowed object is {@link Boolean } + * + */ + public void setExclude(final Boolean value) { + exclude = value; } - } - - /** - * Sets the value of the exclude property. - * - * @param value - * allowed object is {@link Boolean } - * - */ - public void setExclude(final Boolean value) { - exclude = value; - } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java index 7a72e0848..afacaceca 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java @@ -1,39 +1,33 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; import java.util.ArrayList; import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** * * Java class for JPAEntityTypesMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAEntityTypesMapType"> * <complexContent> @@ -47,43 +41,42 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAEntityTypesMapType", propOrder = { "jpaEntityType" }) +@XmlType(name = "JPAEntityTypesMapType", propOrder = {"jpaEntityType"}) public class JPAEntityTypesMapType { - @XmlElement(name = "JPAEntityType") - protected List jpaEntityType; + @XmlElement(name = "JPAEntityType") + protected List jpaEntityType; - /** - * Gets the value of the jpaEntityType property. - * - * - * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the jpaEntityType property. - * - * - * For example, to add a new item, do as follows: - * - * - * getJPAEntityType().add(newItem); - * - * - * - * - * Objects of the following type(s) are allowed in the list {@link JPAEntityTypeMapType } - * - * - */ - public List getJPAEntityType() { - if (jpaEntityType == null) { - jpaEntityType = new ArrayList(); + /** + * Gets the value of the jpaEntityType property. + * + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaEntityType property. + * + * + * For example, to add a new item, do as follows: + * + * + * getJPAEntityType().add(newItem); + * + * + * + * + * Objects of the following type(s) are allowed in the list {@link JPAEntityTypeMapType } + * + * + */ + public List getJPAEntityType() { + if (jpaEntityType == null) { + jpaEntityType = new ArrayList(); + } + return jpaEntityType; } - return jpaEntityType; - } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java index 22260eac1..7ce8c0aa0 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java @@ -1,42 +1,37 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** - * - * By default Java Persistence Unit name is taken as EDM schema name. This can - * be overriden using JPAPersistenceUnitMapType. - * - * + * + * By default Java Persistence Unit name is taken as EDM schema name. This can be overriden using + * JPAPersistenceUnitMapType. + * + * * * Java class for JPAPersistenceUnitMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAPersistenceUnitMapType"> * <complexContent> @@ -53,105 +48,100 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAPersistenceUnitMapType", - propOrder = { "edmSchemaNamespace", "jpaEntityTypes", "jpaEmbeddableTypes" }) +@XmlType(name = "JPAPersistenceUnitMapType", propOrder = {"edmSchemaNamespace", "jpaEntityTypes", "jpaEmbeddableTypes"}) public class JPAPersistenceUnitMapType { - @XmlElement(name = "EDMSchemaNamespace") - protected String edmSchemaNamespace; - @XmlElement(name = "JPAEntityTypes", required = true) - protected JPAEntityTypesMapType jpaEntityTypes; - @XmlElement(name = "JPAEmbeddableTypes", required = true) - protected JPAEmbeddableTypesMapType jpaEmbeddableTypes; - @XmlAttribute(name = "name", required = true) - protected String name; + @XmlElement(name = "EDMSchemaNamespace") + protected String edmSchemaNamespace; + @XmlElement(name = "JPAEntityTypes", required = true) + protected JPAEntityTypesMapType jpaEntityTypes; + @XmlElement(name = "JPAEmbeddableTypes", required = true) + protected JPAEmbeddableTypesMapType jpaEmbeddableTypes; + @XmlAttribute(name = "name", required = true) + protected String name; - /** - * Gets the value of the edmSchemaNamespace property. - * - * @return possible object is {@link String } - * - */ - public String getEDMSchemaNamespace() { - return edmSchemaNamespace; - } + /** + * Gets the value of the edmSchemaNamespace property. + * + * @return possible object is {@link String } + * + */ + public String getEDMSchemaNamespace() { + return edmSchemaNamespace; + } - /** - * Sets the value of the edmSchemaNamespace property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMSchemaNamespace(final String value) { - edmSchemaNamespace = value; - } + /** + * Sets the value of the edmSchemaNamespace property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMSchemaNamespace(final String value) { + edmSchemaNamespace = value; + } - /** - * Gets the value of the jpaEntityTypes property. - * - * @return possible object is {@link JPAEntityTypesMapType } - * - */ - public JPAEntityTypesMapType getJPAEntityTypes() { - return jpaEntityTypes; - } + /** + * Gets the value of the jpaEntityTypes property. + * + * @return possible object is {@link JPAEntityTypesMapType } + * + */ + public JPAEntityTypesMapType getJPAEntityTypes() { + return jpaEntityTypes; + } - /** - * Sets the value of the jpaEntityTypes property. - * - * @param value - * allowed object is {@link JPAEntityTypesMapType } - * - */ - public void setJPAEntityTypes(final JPAEntityTypesMapType value) { - jpaEntityTypes = value; - } + /** + * Sets the value of the jpaEntityTypes property. + * + * @param value allowed object is {@link JPAEntityTypesMapType } + * + */ + public void setJPAEntityTypes(final JPAEntityTypesMapType value) { + jpaEntityTypes = value; + } - /** - * Gets the value of the jpaEmbeddableTypes property. - * - * @return possible object is {@link JPAEmbeddableTypesMapType } - * - */ - public JPAEmbeddableTypesMapType getJPAEmbeddableTypes() { - return jpaEmbeddableTypes; - } + /** + * Gets the value of the jpaEmbeddableTypes property. + * + * @return possible object is {@link JPAEmbeddableTypesMapType } + * + */ + public JPAEmbeddableTypesMapType getJPAEmbeddableTypes() { + return jpaEmbeddableTypes; + } - /** - * Sets the value of the jpaEmbeddableTypes property. - * - * @param value - * allowed object is {@link JPAEmbeddableTypesMapType } - * - */ - public void setJPAEmbeddableTypes(final JPAEmbeddableTypesMapType value) { - jpaEmbeddableTypes = value; - } + /** + * Sets the value of the jpaEmbeddableTypes property. + * + * @param value allowed object is {@link JPAEmbeddableTypesMapType } + * + */ + public void setJPAEmbeddableTypes(final JPAEmbeddableTypesMapType value) { + jpaEmbeddableTypes = value; + } - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return name; - } + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } - /** - * Sets the value of the name property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setName(final String value) { - name = value; - } + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java index 25a2f9569..50970877e 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java @@ -1,46 +1,40 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; import java.util.ArrayList; import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlValue; /** - * - * The default name for EDM navigation property is derived from JPA relationship - * name. This can be overriden using JPARelationshipMapType. - * - * + * + * The default name for EDM navigation property is derived from JPA relationship name. This can be + * overriden using JPARelationshipMapType. + * + * * * Java class for JPARelationshipMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPARelationshipMapType"> * <complexContent> @@ -60,116 +54,113 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPARelationshipMapType", propOrder = { "jpaRelationship" }) +@XmlType(name = "JPARelationshipMapType", propOrder = {"jpaRelationship"}) public class JPARelationshipMapType { - @XmlElement(name = "JPARelationship") - protected List jpaRelationship; - - /** - * Gets the value of the jpaRelationship property. - * - * - * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the jpaRelationship property. - * - * - * For example, to add a new item, do as follows: - * - * - * getJPARelationship().add(newItem); - * - * - * - * - * Objects of the following type(s) are allowed in the list {@link JPARelationshipMapType.JPARelationship } - * - * - */ - public List getJPARelationship() { - if (jpaRelationship == null) { - jpaRelationship = new ArrayList(); - } - return jpaRelationship; - } - - /** - * - * Java class for anonymous complex type. - * - * - * The following schema fragment specifies the expected content contained - * within this class. - * - * - * <complexType> - * <simpleContent> - * <extension base="<http://www.w3.org/2001/XMLSchema>string"> - * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * </extension> - * </simpleContent> - * </complexType> - * - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { "value" }) - public static class JPARelationship { - - @XmlValue - protected String value; - @XmlAttribute(name = "name", required = true) - protected String name; + @XmlElement(name = "JPARelationship") + protected List jpaRelationship; /** - * Gets the value of the value property. + * Gets the value of the jpaRelationship property. * - * @return possible object is {@link String } + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaRelationship property. * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. + * + * For example, to add a new item, do as follows: * - * @param value - * allowed object is {@link String } + * + * getJPARelationship().add(newItem); + * * - */ - public void setValue(final String value) { - this.value = value; - } - - /** - * Gets the value of the name property. * - * @return possible object is {@link String } + * + * Objects of the following type(s) are allowed in the list + * {@link JPARelationshipMapType.JPARelationship } + * * */ - public String getName() { - return name; + public List getJPARelationship() { + if (jpaRelationship == null) { + jpaRelationship = new ArrayList(); + } + return jpaRelationship; } /** - * Sets the value of the name property. + * + * Java class for anonymous complex type. + * + * + * The following schema fragment specifies the expected content contained within this class. + * + * + * <complexType> + * <simpleContent> + * <extension base="<http://www.w3.org/2001/XMLSchema>string"> + * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * </extension> + * </simpleContent> + * </complexType> + * * - * @param value - * allowed object is {@link String } * */ - public void setName(final String value) { - name = value; - } + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"value"}) + public static class JPARelationship { + + @XmlValue + protected String value; + @XmlAttribute(name = "name", required = true) + protected String name; - } + /** + * Gets the value of the value property. + * + * @return possible object is {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value allowed object is {@link String } + * + */ + public void setValue(final String value) { + this.value = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } + + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java index 45a7c3f9b..ed06d3832 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java @@ -1,28 +1,24 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ /** - * OData JPA Processor API Library - Mapping Model - * The JPA EDM Mapping model (XML document) is represented as JAXB annotated Java Classes. - * - * + * OData JPA Processor API Library - Mapping Model The JPA EDM Mapping model (XML document) + * is represented as JAXB annotated Java Classes. + * + * */ -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping", - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +@jakarta.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping", + elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED) package org.apache.olingo.odata2.jpa.processor.api.model.mapping; diff --git a/odata2-jpa-processor/jpa-core/pom.xml b/odata2-jpa-processor/jpa-core/pom.xml index c8eb662a5..2c09c1faa 100644 --- a/odata2-jpa-processor/jpa-core/pom.xml +++ b/odata2-jpa-processor/jpa-core/pom.xml @@ -24,7 +24,7 @@ org.apache.olingo olingo-odata2-jpa-processor - 2.0.13 + 3.0.0-SNAPSHOT ../ @@ -68,10 +68,9 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 - 1.6 - 1.6 + 17 + 17 @@ -88,9 +87,8 @@ - org.eclipse.persistence - javax.persistence - ${version.javax.persistence} + jakarta.persistence + jakarta.persistence-api @@ -122,14 +120,13 @@ junit junit - 4.9 test - org.easymock - easymock - 3.1 - test + org.easymock + easymock + 5.2.0 + test @@ -138,7 +135,6 @@ org.slf4j slf4j-api - 1.7.2 test
+ * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaEmbeddableType property. + * + *
+ * getJPAEmbeddableType().add(newItem); + *
+ * Objects of the following type(s) are allowed in the list {@link JPAEmbeddableTypeMapType } + * + * + */ + public List getJPAEmbeddableType() { + if (jpaEmbeddableType == null) { + jpaEmbeddableType = new ArrayList(); + } + return jpaEmbeddableType; } - return jpaEmbeddableType; - } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java index 22e181922..8c989234d 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypeMapType.java @@ -1,40 +1,37 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** - * - * The default name for EDM - * entity type is derived from JPA entity type name. This can be - * overriden using JPAEntityTypeMapType. - * - * - * Java class for JPAEntityTypeMapType complex type. - * - * The following schema fragment specifies the expected content contained within this class. - * + * + * The default name for EDM entity type is derived from JPA entity type name. This can be overriden + * using JPAEntityTypeMapType. + * + * + * + * Java class for JPAEntityTypeMapType complex type. + * + * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAEntityTypeMapType"> * <complexContent> @@ -53,161 +50,147 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAEntityTypeMapType", propOrder = { "edmEntityType", "edmEntitySet", "jpaAttributes", - "jpaRelationships" }) +@XmlType(name = "JPAEntityTypeMapType", propOrder = {"edmEntityType", "edmEntitySet", "jpaAttributes", "jpaRelationships"}) public class JPAEntityTypeMapType { - @XmlElement(name = "EDMEntityType") - protected String edmEntityType; - @XmlElement(name = "EDMEntitySet") - protected String edmEntitySet; - @XmlElement(name = "JPAAttributes", required = true) - protected JPAAttributeMapType jpaAttributes; - @XmlElement(name = "JPARelationships", required = true) - protected JPARelationshipMapType jpaRelationships; - @XmlAttribute(name = "name", required = true) - protected String name; - @XmlAttribute(name = "exclude") - protected Boolean exclude; - - /** - * Gets the value of the edmEntityType property. - * - * @return - * possible object is {@link String } - * - */ - public String getEDMEntityType() { - return edmEntityType; - } - - /** - * Sets the value of the edmEntityType property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMEntityType(final String value) { - edmEntityType = value; - } - - /** - * Gets the value of the edmEntitySet property. - * - * @return - * possible object is {@link String } - * - */ - public String getEDMEntitySet() { - return edmEntitySet; - } - - /** - * Sets the value of the edmEntitySet property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMEntitySet(final String value) { - edmEntitySet = value; - } - - /** - * Gets the value of the jpaAttributes property. - * - * @return - * possible object is {@link JPAAttributeMapType } - * - */ - public JPAAttributeMapType getJPAAttributes() { - return jpaAttributes; - } - - /** - * Sets the value of the jpaAttributes property. - * - * @param value - * allowed object is {@link JPAAttributeMapType } - * - */ - public void setJPAAttributes(final JPAAttributeMapType value) { - jpaAttributes = value; - } - - /** - * Gets the value of the jpaRelationships property. - * - * @return - * possible object is {@link JPARelationshipMapType } - * - */ - public JPARelationshipMapType getJPARelationships() { - return jpaRelationships; - } - - /** - * Sets the value of the jpaRelationships property. - * - * @param value - * allowed object is {@link JPARelationshipMapType } - * - */ - public void setJPARelationships(final JPARelationshipMapType value) { - jpaRelationships = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is {@link String } - * - */ - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setName(final String value) { - name = value; - } - - /** - * Gets the value of the exclude property. - * - * @return - * possible object is {@link Boolean } - * - */ - public boolean isExclude() { - if (exclude == null) { - return false; - } else { - return exclude; + @XmlElement(name = "EDMEntityType") + protected String edmEntityType; + @XmlElement(name = "EDMEntitySet") + protected String edmEntitySet; + @XmlElement(name = "JPAAttributes", required = true) + protected JPAAttributeMapType jpaAttributes; + @XmlElement(name = "JPARelationships", required = true) + protected JPARelationshipMapType jpaRelationships; + @XmlAttribute(name = "name", required = true) + protected String name; + @XmlAttribute(name = "exclude") + protected Boolean exclude; + + /** + * Gets the value of the edmEntityType property. + * + * @return possible object is {@link String } + * + */ + public String getEDMEntityType() { + return edmEntityType; + } + + /** + * Sets the value of the edmEntityType property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMEntityType(final String value) { + edmEntityType = value; + } + + /** + * Gets the value of the edmEntitySet property. + * + * @return possible object is {@link String } + * + */ + public String getEDMEntitySet() { + return edmEntitySet; + } + + /** + * Sets the value of the edmEntitySet property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMEntitySet(final String value) { + edmEntitySet = value; + } + + /** + * Gets the value of the jpaAttributes property. + * + * @return possible object is {@link JPAAttributeMapType } + * + */ + public JPAAttributeMapType getJPAAttributes() { + return jpaAttributes; + } + + /** + * Sets the value of the jpaAttributes property. + * + * @param value allowed object is {@link JPAAttributeMapType } + * + */ + public void setJPAAttributes(final JPAAttributeMapType value) { + jpaAttributes = value; + } + + /** + * Gets the value of the jpaRelationships property. + * + * @return possible object is {@link JPARelationshipMapType } + * + */ + public JPARelationshipMapType getJPARelationships() { + return jpaRelationships; + } + + /** + * Sets the value of the jpaRelationships property. + * + * @param value allowed object is {@link JPARelationshipMapType } + * + */ + public void setJPARelationships(final JPARelationshipMapType value) { + jpaRelationships = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } + + /** + * Gets the value of the exclude property. + * + * @return possible object is {@link Boolean } + * + */ + public boolean isExclude() { + if (exclude == null) { + return false; + } + return exclude; + } + + /** + * Sets the value of the exclude property. + * + * @param value allowed object is {@link Boolean } + * + */ + public void setExclude(final Boolean value) { + exclude = value; } - } - - /** - * Sets the value of the exclude property. - * - * @param value - * allowed object is {@link Boolean } - * - */ - public void setExclude(final Boolean value) { - exclude = value; - } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java index 7a72e0848..afacaceca 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAEntityTypesMapType.java @@ -1,39 +1,33 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; import java.util.ArrayList; import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** * * Java class for JPAEntityTypesMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAEntityTypesMapType"> * <complexContent> @@ -47,43 +41,42 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAEntityTypesMapType", propOrder = { "jpaEntityType" }) +@XmlType(name = "JPAEntityTypesMapType", propOrder = {"jpaEntityType"}) public class JPAEntityTypesMapType { - @XmlElement(name = "JPAEntityType") - protected List jpaEntityType; + @XmlElement(name = "JPAEntityType") + protected List jpaEntityType; - /** - * Gets the value of the jpaEntityType property. - * - * - * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the jpaEntityType property. - * - * - * For example, to add a new item, do as follows: - * - * - * getJPAEntityType().add(newItem); - * - * - * - * - * Objects of the following type(s) are allowed in the list {@link JPAEntityTypeMapType } - * - * - */ - public List getJPAEntityType() { - if (jpaEntityType == null) { - jpaEntityType = new ArrayList(); + /** + * Gets the value of the jpaEntityType property. + * + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaEntityType property. + * + * + * For example, to add a new item, do as follows: + * + * + * getJPAEntityType().add(newItem); + * + * + * + * + * Objects of the following type(s) are allowed in the list {@link JPAEntityTypeMapType } + * + * + */ + public List getJPAEntityType() { + if (jpaEntityType == null) { + jpaEntityType = new ArrayList(); + } + return jpaEntityType; } - return jpaEntityType; - } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java index 22260eac1..7ce8c0aa0 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java @@ -1,42 +1,37 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** - * - * By default Java Persistence Unit name is taken as EDM schema name. This can - * be overriden using JPAPersistenceUnitMapType. - * - * + * + * By default Java Persistence Unit name is taken as EDM schema name. This can be overriden using + * JPAPersistenceUnitMapType. + * + * * * Java class for JPAPersistenceUnitMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAPersistenceUnitMapType"> * <complexContent> @@ -53,105 +48,100 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAPersistenceUnitMapType", - propOrder = { "edmSchemaNamespace", "jpaEntityTypes", "jpaEmbeddableTypes" }) +@XmlType(name = "JPAPersistenceUnitMapType", propOrder = {"edmSchemaNamespace", "jpaEntityTypes", "jpaEmbeddableTypes"}) public class JPAPersistenceUnitMapType { - @XmlElement(name = "EDMSchemaNamespace") - protected String edmSchemaNamespace; - @XmlElement(name = "JPAEntityTypes", required = true) - protected JPAEntityTypesMapType jpaEntityTypes; - @XmlElement(name = "JPAEmbeddableTypes", required = true) - protected JPAEmbeddableTypesMapType jpaEmbeddableTypes; - @XmlAttribute(name = "name", required = true) - protected String name; + @XmlElement(name = "EDMSchemaNamespace") + protected String edmSchemaNamespace; + @XmlElement(name = "JPAEntityTypes", required = true) + protected JPAEntityTypesMapType jpaEntityTypes; + @XmlElement(name = "JPAEmbeddableTypes", required = true) + protected JPAEmbeddableTypesMapType jpaEmbeddableTypes; + @XmlAttribute(name = "name", required = true) + protected String name; - /** - * Gets the value of the edmSchemaNamespace property. - * - * @return possible object is {@link String } - * - */ - public String getEDMSchemaNamespace() { - return edmSchemaNamespace; - } + /** + * Gets the value of the edmSchemaNamespace property. + * + * @return possible object is {@link String } + * + */ + public String getEDMSchemaNamespace() { + return edmSchemaNamespace; + } - /** - * Sets the value of the edmSchemaNamespace property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMSchemaNamespace(final String value) { - edmSchemaNamespace = value; - } + /** + * Sets the value of the edmSchemaNamespace property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMSchemaNamespace(final String value) { + edmSchemaNamespace = value; + } - /** - * Gets the value of the jpaEntityTypes property. - * - * @return possible object is {@link JPAEntityTypesMapType } - * - */ - public JPAEntityTypesMapType getJPAEntityTypes() { - return jpaEntityTypes; - } + /** + * Gets the value of the jpaEntityTypes property. + * + * @return possible object is {@link JPAEntityTypesMapType } + * + */ + public JPAEntityTypesMapType getJPAEntityTypes() { + return jpaEntityTypes; + } - /** - * Sets the value of the jpaEntityTypes property. - * - * @param value - * allowed object is {@link JPAEntityTypesMapType } - * - */ - public void setJPAEntityTypes(final JPAEntityTypesMapType value) { - jpaEntityTypes = value; - } + /** + * Sets the value of the jpaEntityTypes property. + * + * @param value allowed object is {@link JPAEntityTypesMapType } + * + */ + public void setJPAEntityTypes(final JPAEntityTypesMapType value) { + jpaEntityTypes = value; + } - /** - * Gets the value of the jpaEmbeddableTypes property. - * - * @return possible object is {@link JPAEmbeddableTypesMapType } - * - */ - public JPAEmbeddableTypesMapType getJPAEmbeddableTypes() { - return jpaEmbeddableTypes; - } + /** + * Gets the value of the jpaEmbeddableTypes property. + * + * @return possible object is {@link JPAEmbeddableTypesMapType } + * + */ + public JPAEmbeddableTypesMapType getJPAEmbeddableTypes() { + return jpaEmbeddableTypes; + } - /** - * Sets the value of the jpaEmbeddableTypes property. - * - * @param value - * allowed object is {@link JPAEmbeddableTypesMapType } - * - */ - public void setJPAEmbeddableTypes(final JPAEmbeddableTypesMapType value) { - jpaEmbeddableTypes = value; - } + /** + * Sets the value of the jpaEmbeddableTypes property. + * + * @param value allowed object is {@link JPAEmbeddableTypesMapType } + * + */ + public void setJPAEmbeddableTypes(final JPAEmbeddableTypesMapType value) { + jpaEmbeddableTypes = value; + } - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return name; - } + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } - /** - * Sets the value of the name property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setName(final String value) { - name = value; - } + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java index 25a2f9569..50970877e 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java @@ -1,46 +1,40 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; import java.util.ArrayList; import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlValue; /** - * - * The default name for EDM navigation property is derived from JPA relationship - * name. This can be overriden using JPARelationshipMapType. - * - * + * + * The default name for EDM navigation property is derived from JPA relationship name. This can be + * overriden using JPARelationshipMapType. + * + * * * Java class for JPARelationshipMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPARelationshipMapType"> * <complexContent> @@ -60,116 +54,113 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPARelationshipMapType", propOrder = { "jpaRelationship" }) +@XmlType(name = "JPARelationshipMapType", propOrder = {"jpaRelationship"}) public class JPARelationshipMapType { - @XmlElement(name = "JPARelationship") - protected List jpaRelationship; - - /** - * Gets the value of the jpaRelationship property. - * - * - * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the jpaRelationship property. - * - * - * For example, to add a new item, do as follows: - * - * - * getJPARelationship().add(newItem); - * - * - * - * - * Objects of the following type(s) are allowed in the list {@link JPARelationshipMapType.JPARelationship } - * - * - */ - public List getJPARelationship() { - if (jpaRelationship == null) { - jpaRelationship = new ArrayList(); - } - return jpaRelationship; - } - - /** - * - * Java class for anonymous complex type. - * - * - * The following schema fragment specifies the expected content contained - * within this class. - * - * - * <complexType> - * <simpleContent> - * <extension base="<http://www.w3.org/2001/XMLSchema>string"> - * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * </extension> - * </simpleContent> - * </complexType> - * - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { "value" }) - public static class JPARelationship { - - @XmlValue - protected String value; - @XmlAttribute(name = "name", required = true) - protected String name; + @XmlElement(name = "JPARelationship") + protected List jpaRelationship; /** - * Gets the value of the value property. + * Gets the value of the jpaRelationship property. * - * @return possible object is {@link String } + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaRelationship property. * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. + * + * For example, to add a new item, do as follows: * - * @param value - * allowed object is {@link String } + * + * getJPARelationship().add(newItem); + * * - */ - public void setValue(final String value) { - this.value = value; - } - - /** - * Gets the value of the name property. * - * @return possible object is {@link String } + * + * Objects of the following type(s) are allowed in the list + * {@link JPARelationshipMapType.JPARelationship } + * * */ - public String getName() { - return name; + public List getJPARelationship() { + if (jpaRelationship == null) { + jpaRelationship = new ArrayList(); + } + return jpaRelationship; } /** - * Sets the value of the name property. + * + * Java class for anonymous complex type. + * + * + * The following schema fragment specifies the expected content contained within this class. + * + * + * <complexType> + * <simpleContent> + * <extension base="<http://www.w3.org/2001/XMLSchema>string"> + * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * </extension> + * </simpleContent> + * </complexType> + * * - * @param value - * allowed object is {@link String } * */ - public void setName(final String value) { - name = value; - } + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"value"}) + public static class JPARelationship { + + @XmlValue + protected String value; + @XmlAttribute(name = "name", required = true) + protected String name; - } + /** + * Gets the value of the value property. + * + * @return possible object is {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value allowed object is {@link String } + * + */ + public void setValue(final String value) { + this.value = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } + + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java index 45a7c3f9b..ed06d3832 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java @@ -1,28 +1,24 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ /** - * OData JPA Processor API Library - Mapping Model - * The JPA EDM Mapping model (XML document) is represented as JAXB annotated Java Classes. - * - * + * OData JPA Processor API Library - Mapping Model The JPA EDM Mapping model (XML document) + * is represented as JAXB annotated Java Classes. + * + * */ -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping", - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +@jakarta.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping", + elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED) package org.apache.olingo.odata2.jpa.processor.api.model.mapping; diff --git a/odata2-jpa-processor/jpa-core/pom.xml b/odata2-jpa-processor/jpa-core/pom.xml index c8eb662a5..2c09c1faa 100644 --- a/odata2-jpa-processor/jpa-core/pom.xml +++ b/odata2-jpa-processor/jpa-core/pom.xml @@ -24,7 +24,7 @@ org.apache.olingo olingo-odata2-jpa-processor - 2.0.13 + 3.0.0-SNAPSHOT ../ @@ -68,10 +68,9 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 - 1.6 - 1.6 + 17 + 17 @@ -88,9 +87,8 @@ - org.eclipse.persistence - javax.persistence - ${version.javax.persistence} + jakarta.persistence + jakarta.persistence-api @@ -122,14 +120,13 @@ junit junit - 4.9 test - org.easymock - easymock - 3.1 - test + org.easymock + easymock + 5.2.0 + test @@ -138,7 +135,6 @@ org.slf4j slf4j-api - 1.7.2 test
Java class for JPAEntityTypeMapType complex type. - * - *
The following schema fragment specifies the expected content contained within this class. - * + * + * The default name for EDM entity type is derived from JPA entity type name. This can be overriden + * using JPAEntityTypeMapType. + * + * + *
+ * Java class for JPAEntityTypeMapType complex type. + * + *
* <complexType name="JPAEntityTypeMapType"> * <complexContent> @@ -53,161 +50,147 @@ * </complexContent> * </complexType> *
* Java class for JPAEntityTypesMapType complex type. - * + * *
* <complexType name="JPAEntityTypesMapType"> * <complexContent> @@ -47,43 +41,42 @@ * </complexContent> * </complexType> *
- * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the jpaEntityType property. - * - *
- * getJPAEntityType().add(newItem); - *
- * Objects of the following type(s) are allowed in the list {@link JPAEntityTypeMapType } - * - * - */ - public List getJPAEntityType() { - if (jpaEntityType == null) { - jpaEntityType = new ArrayList(); + /** + * Gets the value of the jpaEntityType property. + * + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaEntityType property. + * + * + * For example, to add a new item, do as follows: + * + * + * getJPAEntityType().add(newItem); + * + * + * + * + * Objects of the following type(s) are allowed in the list {@link JPAEntityTypeMapType } + * + * + */ + public List getJPAEntityType() { + if (jpaEntityType == null) { + jpaEntityType = new ArrayList(); + } + return jpaEntityType; } - return jpaEntityType; - } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java index 22260eac1..7ce8c0aa0 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java @@ -1,42 +1,37 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** - * - * By default Java Persistence Unit name is taken as EDM schema name. This can - * be overriden using JPAPersistenceUnitMapType. - * - * + * + * By default Java Persistence Unit name is taken as EDM schema name. This can be overriden using + * JPAPersistenceUnitMapType. + * + * * * Java class for JPAPersistenceUnitMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAPersistenceUnitMapType"> * <complexContent> @@ -53,105 +48,100 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAPersistenceUnitMapType", - propOrder = { "edmSchemaNamespace", "jpaEntityTypes", "jpaEmbeddableTypes" }) +@XmlType(name = "JPAPersistenceUnitMapType", propOrder = {"edmSchemaNamespace", "jpaEntityTypes", "jpaEmbeddableTypes"}) public class JPAPersistenceUnitMapType { - @XmlElement(name = "EDMSchemaNamespace") - protected String edmSchemaNamespace; - @XmlElement(name = "JPAEntityTypes", required = true) - protected JPAEntityTypesMapType jpaEntityTypes; - @XmlElement(name = "JPAEmbeddableTypes", required = true) - protected JPAEmbeddableTypesMapType jpaEmbeddableTypes; - @XmlAttribute(name = "name", required = true) - protected String name; + @XmlElement(name = "EDMSchemaNamespace") + protected String edmSchemaNamespace; + @XmlElement(name = "JPAEntityTypes", required = true) + protected JPAEntityTypesMapType jpaEntityTypes; + @XmlElement(name = "JPAEmbeddableTypes", required = true) + protected JPAEmbeddableTypesMapType jpaEmbeddableTypes; + @XmlAttribute(name = "name", required = true) + protected String name; - /** - * Gets the value of the edmSchemaNamespace property. - * - * @return possible object is {@link String } - * - */ - public String getEDMSchemaNamespace() { - return edmSchemaNamespace; - } + /** + * Gets the value of the edmSchemaNamespace property. + * + * @return possible object is {@link String } + * + */ + public String getEDMSchemaNamespace() { + return edmSchemaNamespace; + } - /** - * Sets the value of the edmSchemaNamespace property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMSchemaNamespace(final String value) { - edmSchemaNamespace = value; - } + /** + * Sets the value of the edmSchemaNamespace property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMSchemaNamespace(final String value) { + edmSchemaNamespace = value; + } - /** - * Gets the value of the jpaEntityTypes property. - * - * @return possible object is {@link JPAEntityTypesMapType } - * - */ - public JPAEntityTypesMapType getJPAEntityTypes() { - return jpaEntityTypes; - } + /** + * Gets the value of the jpaEntityTypes property. + * + * @return possible object is {@link JPAEntityTypesMapType } + * + */ + public JPAEntityTypesMapType getJPAEntityTypes() { + return jpaEntityTypes; + } - /** - * Sets the value of the jpaEntityTypes property. - * - * @param value - * allowed object is {@link JPAEntityTypesMapType } - * - */ - public void setJPAEntityTypes(final JPAEntityTypesMapType value) { - jpaEntityTypes = value; - } + /** + * Sets the value of the jpaEntityTypes property. + * + * @param value allowed object is {@link JPAEntityTypesMapType } + * + */ + public void setJPAEntityTypes(final JPAEntityTypesMapType value) { + jpaEntityTypes = value; + } - /** - * Gets the value of the jpaEmbeddableTypes property. - * - * @return possible object is {@link JPAEmbeddableTypesMapType } - * - */ - public JPAEmbeddableTypesMapType getJPAEmbeddableTypes() { - return jpaEmbeddableTypes; - } + /** + * Gets the value of the jpaEmbeddableTypes property. + * + * @return possible object is {@link JPAEmbeddableTypesMapType } + * + */ + public JPAEmbeddableTypesMapType getJPAEmbeddableTypes() { + return jpaEmbeddableTypes; + } - /** - * Sets the value of the jpaEmbeddableTypes property. - * - * @param value - * allowed object is {@link JPAEmbeddableTypesMapType } - * - */ - public void setJPAEmbeddableTypes(final JPAEmbeddableTypesMapType value) { - jpaEmbeddableTypes = value; - } + /** + * Sets the value of the jpaEmbeddableTypes property. + * + * @param value allowed object is {@link JPAEmbeddableTypesMapType } + * + */ + public void setJPAEmbeddableTypes(final JPAEmbeddableTypesMapType value) { + jpaEmbeddableTypes = value; + } - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return name; - } + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } - /** - * Sets the value of the name property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setName(final String value) { - name = value; - } + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java index 25a2f9569..50970877e 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java @@ -1,46 +1,40 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; import java.util.ArrayList; import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlValue; /** - * - * The default name for EDM navigation property is derived from JPA relationship - * name. This can be overriden using JPARelationshipMapType. - * - * + * + * The default name for EDM navigation property is derived from JPA relationship name. This can be + * overriden using JPARelationshipMapType. + * + * * * Java class for JPARelationshipMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPARelationshipMapType"> * <complexContent> @@ -60,116 +54,113 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPARelationshipMapType", propOrder = { "jpaRelationship" }) +@XmlType(name = "JPARelationshipMapType", propOrder = {"jpaRelationship"}) public class JPARelationshipMapType { - @XmlElement(name = "JPARelationship") - protected List jpaRelationship; - - /** - * Gets the value of the jpaRelationship property. - * - * - * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the jpaRelationship property. - * - * - * For example, to add a new item, do as follows: - * - * - * getJPARelationship().add(newItem); - * - * - * - * - * Objects of the following type(s) are allowed in the list {@link JPARelationshipMapType.JPARelationship } - * - * - */ - public List getJPARelationship() { - if (jpaRelationship == null) { - jpaRelationship = new ArrayList(); - } - return jpaRelationship; - } - - /** - * - * Java class for anonymous complex type. - * - * - * The following schema fragment specifies the expected content contained - * within this class. - * - * - * <complexType> - * <simpleContent> - * <extension base="<http://www.w3.org/2001/XMLSchema>string"> - * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * </extension> - * </simpleContent> - * </complexType> - * - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { "value" }) - public static class JPARelationship { - - @XmlValue - protected String value; - @XmlAttribute(name = "name", required = true) - protected String name; + @XmlElement(name = "JPARelationship") + protected List jpaRelationship; /** - * Gets the value of the value property. + * Gets the value of the jpaRelationship property. * - * @return possible object is {@link String } + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaRelationship property. * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. + * + * For example, to add a new item, do as follows: * - * @param value - * allowed object is {@link String } + * + * getJPARelationship().add(newItem); + * * - */ - public void setValue(final String value) { - this.value = value; - } - - /** - * Gets the value of the name property. * - * @return possible object is {@link String } + * + * Objects of the following type(s) are allowed in the list + * {@link JPARelationshipMapType.JPARelationship } + * * */ - public String getName() { - return name; + public List getJPARelationship() { + if (jpaRelationship == null) { + jpaRelationship = new ArrayList(); + } + return jpaRelationship; } /** - * Sets the value of the name property. + * + * Java class for anonymous complex type. + * + * + * The following schema fragment specifies the expected content contained within this class. + * + * + * <complexType> + * <simpleContent> + * <extension base="<http://www.w3.org/2001/XMLSchema>string"> + * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * </extension> + * </simpleContent> + * </complexType> + * * - * @param value - * allowed object is {@link String } * */ - public void setName(final String value) { - name = value; - } + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"value"}) + public static class JPARelationship { + + @XmlValue + protected String value; + @XmlAttribute(name = "name", required = true) + protected String name; - } + /** + * Gets the value of the value property. + * + * @return possible object is {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value allowed object is {@link String } + * + */ + public void setValue(final String value) { + this.value = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } + + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java index 45a7c3f9b..ed06d3832 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java @@ -1,28 +1,24 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ /** - * OData JPA Processor API Library - Mapping Model - * The JPA EDM Mapping model (XML document) is represented as JAXB annotated Java Classes. - * - * + * OData JPA Processor API Library - Mapping Model The JPA EDM Mapping model (XML document) + * is represented as JAXB annotated Java Classes. + * + * */ -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping", - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +@jakarta.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping", + elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED) package org.apache.olingo.odata2.jpa.processor.api.model.mapping; diff --git a/odata2-jpa-processor/jpa-core/pom.xml b/odata2-jpa-processor/jpa-core/pom.xml index c8eb662a5..2c09c1faa 100644 --- a/odata2-jpa-processor/jpa-core/pom.xml +++ b/odata2-jpa-processor/jpa-core/pom.xml @@ -24,7 +24,7 @@ org.apache.olingo olingo-odata2-jpa-processor - 2.0.13 + 3.0.0-SNAPSHOT ../ @@ -68,10 +68,9 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 - 1.6 - 1.6 + 17 + 17 @@ -88,9 +87,8 @@ - org.eclipse.persistence - javax.persistence - ${version.javax.persistence} + jakarta.persistence + jakarta.persistence-api @@ -122,14 +120,13 @@ junit junit - 4.9 test - org.easymock - easymock - 3.1 - test + org.easymock + easymock + 5.2.0 + test @@ -138,7 +135,6 @@ org.slf4j slf4j-api - 1.7.2 test
+ * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaEntityType property. + * + *
+ * getJPAEntityType().add(newItem); + *
+ * Objects of the following type(s) are allowed in the list {@link JPAEntityTypeMapType } + * + * + */ + public List getJPAEntityType() { + if (jpaEntityType == null) { + jpaEntityType = new ArrayList(); + } + return jpaEntityType; } - return jpaEntityType; - } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java index 22260eac1..7ce8c0aa0 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPAPersistenceUnitMapType.java @@ -1,42 +1,37 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; /** - * - * By default Java Persistence Unit name is taken as EDM schema name. This can - * be overriden using JPAPersistenceUnitMapType. - * - * + * + * By default Java Persistence Unit name is taken as EDM schema name. This can be overriden using + * JPAPersistenceUnitMapType. + * + * * * Java class for JPAPersistenceUnitMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPAPersistenceUnitMapType"> * <complexContent> @@ -53,105 +48,100 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPAPersistenceUnitMapType", - propOrder = { "edmSchemaNamespace", "jpaEntityTypes", "jpaEmbeddableTypes" }) +@XmlType(name = "JPAPersistenceUnitMapType", propOrder = {"edmSchemaNamespace", "jpaEntityTypes", "jpaEmbeddableTypes"}) public class JPAPersistenceUnitMapType { - @XmlElement(name = "EDMSchemaNamespace") - protected String edmSchemaNamespace; - @XmlElement(name = "JPAEntityTypes", required = true) - protected JPAEntityTypesMapType jpaEntityTypes; - @XmlElement(name = "JPAEmbeddableTypes", required = true) - protected JPAEmbeddableTypesMapType jpaEmbeddableTypes; - @XmlAttribute(name = "name", required = true) - protected String name; + @XmlElement(name = "EDMSchemaNamespace") + protected String edmSchemaNamespace; + @XmlElement(name = "JPAEntityTypes", required = true) + protected JPAEntityTypesMapType jpaEntityTypes; + @XmlElement(name = "JPAEmbeddableTypes", required = true) + protected JPAEmbeddableTypesMapType jpaEmbeddableTypes; + @XmlAttribute(name = "name", required = true) + protected String name; - /** - * Gets the value of the edmSchemaNamespace property. - * - * @return possible object is {@link String } - * - */ - public String getEDMSchemaNamespace() { - return edmSchemaNamespace; - } + /** + * Gets the value of the edmSchemaNamespace property. + * + * @return possible object is {@link String } + * + */ + public String getEDMSchemaNamespace() { + return edmSchemaNamespace; + } - /** - * Sets the value of the edmSchemaNamespace property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setEDMSchemaNamespace(final String value) { - edmSchemaNamespace = value; - } + /** + * Sets the value of the edmSchemaNamespace property. + * + * @param value allowed object is {@link String } + * + */ + public void setEDMSchemaNamespace(final String value) { + edmSchemaNamespace = value; + } - /** - * Gets the value of the jpaEntityTypes property. - * - * @return possible object is {@link JPAEntityTypesMapType } - * - */ - public JPAEntityTypesMapType getJPAEntityTypes() { - return jpaEntityTypes; - } + /** + * Gets the value of the jpaEntityTypes property. + * + * @return possible object is {@link JPAEntityTypesMapType } + * + */ + public JPAEntityTypesMapType getJPAEntityTypes() { + return jpaEntityTypes; + } - /** - * Sets the value of the jpaEntityTypes property. - * - * @param value - * allowed object is {@link JPAEntityTypesMapType } - * - */ - public void setJPAEntityTypes(final JPAEntityTypesMapType value) { - jpaEntityTypes = value; - } + /** + * Sets the value of the jpaEntityTypes property. + * + * @param value allowed object is {@link JPAEntityTypesMapType } + * + */ + public void setJPAEntityTypes(final JPAEntityTypesMapType value) { + jpaEntityTypes = value; + } - /** - * Gets the value of the jpaEmbeddableTypes property. - * - * @return possible object is {@link JPAEmbeddableTypesMapType } - * - */ - public JPAEmbeddableTypesMapType getJPAEmbeddableTypes() { - return jpaEmbeddableTypes; - } + /** + * Gets the value of the jpaEmbeddableTypes property. + * + * @return possible object is {@link JPAEmbeddableTypesMapType } + * + */ + public JPAEmbeddableTypesMapType getJPAEmbeddableTypes() { + return jpaEmbeddableTypes; + } - /** - * Sets the value of the jpaEmbeddableTypes property. - * - * @param value - * allowed object is {@link JPAEmbeddableTypesMapType } - * - */ - public void setJPAEmbeddableTypes(final JPAEmbeddableTypesMapType value) { - jpaEmbeddableTypes = value; - } + /** + * Sets the value of the jpaEmbeddableTypes property. + * + * @param value allowed object is {@link JPAEmbeddableTypesMapType } + * + */ + public void setJPAEmbeddableTypes(final JPAEmbeddableTypesMapType value) { + jpaEmbeddableTypes = value; + } - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return name; - } + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } - /** - * Sets the value of the name property. - * - * @param value - * allowed object is {@link String } - * - */ - public void setName(final String value) { - name = value; - } + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java index 25a2f9569..50970877e 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/JPARelationshipMapType.java @@ -1,46 +1,40 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ package org.apache.olingo.odata2.jpa.processor.api.model.mapping; import java.util.ArrayList; import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlValue; /** - * - * The default name for EDM navigation property is derived from JPA relationship - * name. This can be overriden using JPARelationshipMapType. - * - * + * + * The default name for EDM navigation property is derived from JPA relationship name. This can be + * overriden using JPARelationshipMapType. + * + * * * Java class for JPARelationshipMapType complex type. - * + * * - * The following schema fragment specifies the expected content contained within - * this class. - * + * The following schema fragment specifies the expected content contained within this class. + * * * <complexType name="JPARelationshipMapType"> * <complexContent> @@ -60,116 +54,113 @@ * </complexContent> * </complexType> * - * - * + * + * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "JPARelationshipMapType", propOrder = { "jpaRelationship" }) +@XmlType(name = "JPARelationshipMapType", propOrder = {"jpaRelationship"}) public class JPARelationshipMapType { - @XmlElement(name = "JPARelationship") - protected List jpaRelationship; - - /** - * Gets the value of the jpaRelationship property. - * - * - * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the jpaRelationship property. - * - * - * For example, to add a new item, do as follows: - * - * - * getJPARelationship().add(newItem); - * - * - * - * - * Objects of the following type(s) are allowed in the list {@link JPARelationshipMapType.JPARelationship } - * - * - */ - public List getJPARelationship() { - if (jpaRelationship == null) { - jpaRelationship = new ArrayList(); - } - return jpaRelationship; - } - - /** - * - * Java class for anonymous complex type. - * - * - * The following schema fragment specifies the expected content contained - * within this class. - * - * - * <complexType> - * <simpleContent> - * <extension base="<http://www.w3.org/2001/XMLSchema>string"> - * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * </extension> - * </simpleContent> - * </complexType> - * - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { "value" }) - public static class JPARelationship { - - @XmlValue - protected String value; - @XmlAttribute(name = "name", required = true) - protected String name; + @XmlElement(name = "JPARelationship") + protected List jpaRelationship; /** - * Gets the value of the value property. + * Gets the value of the jpaRelationship property. * - * @return possible object is {@link String } + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaRelationship property. * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. + * + * For example, to add a new item, do as follows: * - * @param value - * allowed object is {@link String } + * + * getJPARelationship().add(newItem); + * * - */ - public void setValue(final String value) { - this.value = value; - } - - /** - * Gets the value of the name property. * - * @return possible object is {@link String } + * + * Objects of the following type(s) are allowed in the list + * {@link JPARelationshipMapType.JPARelationship } + * * */ - public String getName() { - return name; + public List getJPARelationship() { + if (jpaRelationship == null) { + jpaRelationship = new ArrayList(); + } + return jpaRelationship; } /** - * Sets the value of the name property. + * + * Java class for anonymous complex type. + * + * + * The following schema fragment specifies the expected content contained within this class. + * + * + * <complexType> + * <simpleContent> + * <extension base="<http://www.w3.org/2001/XMLSchema>string"> + * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * </extension> + * </simpleContent> + * </complexType> + * * - * @param value - * allowed object is {@link String } * */ - public void setName(final String value) { - name = value; - } + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"value"}) + public static class JPARelationship { + + @XmlValue + protected String value; + @XmlAttribute(name = "name", required = true) + protected String name; - } + /** + * Gets the value of the value property. + * + * @return possible object is {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value allowed object is {@link String } + * + */ + public void setValue(final String value) { + this.value = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } + + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java index 45a7c3f9b..ed06d3832 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java @@ -1,28 +1,24 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ /** - * OData JPA Processor API Library - Mapping Model - * The JPA EDM Mapping model (XML document) is represented as JAXB annotated Java Classes. - * - * + * OData JPA Processor API Library - Mapping Model The JPA EDM Mapping model (XML document) + * is represented as JAXB annotated Java Classes. + * + * */ -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping", - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +@jakarta.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping", + elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED) package org.apache.olingo.odata2.jpa.processor.api.model.mapping; diff --git a/odata2-jpa-processor/jpa-core/pom.xml b/odata2-jpa-processor/jpa-core/pom.xml index c8eb662a5..2c09c1faa 100644 --- a/odata2-jpa-processor/jpa-core/pom.xml +++ b/odata2-jpa-processor/jpa-core/pom.xml @@ -24,7 +24,7 @@ org.apache.olingo olingo-odata2-jpa-processor - 2.0.13 + 3.0.0-SNAPSHOT ../ @@ -68,10 +68,9 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 - 1.6 - 1.6 + 17 + 17 @@ -88,9 +87,8 @@ - org.eclipse.persistence - javax.persistence - ${version.javax.persistence} + jakarta.persistence + jakarta.persistence-api @@ -122,14 +120,13 @@ junit junit - 4.9 test - org.easymock - easymock - 3.1 - test + org.easymock + easymock + 5.2.0 + test @@ -138,7 +135,6 @@ org.slf4j slf4j-api - 1.7.2 test
* Java class for JPAPersistenceUnitMapType complex type. - * + * *
* <complexType name="JPAPersistenceUnitMapType"> * <complexContent> @@ -53,105 +48,100 @@ * </complexContent> * </complexType> *
* Java class for JPARelationshipMapType complex type. - * + * *
* <complexType name="JPARelationshipMapType"> * <complexContent> @@ -60,116 +54,113 @@ * </complexContent> * </complexType> *
- * This accessor method returns a reference to the live list, not a - * snapshot. Therefore any modification you make to the returned list will - * be present inside the JAXB object. This is why there is not a - * set method for the jpaRelationship property. - * - *
- * getJPARelationship().add(newItem); - *
- * Objects of the following type(s) are allowed in the list {@link JPARelationshipMapType.JPARelationship } - * - * - */ - public List getJPARelationship() { - if (jpaRelationship == null) { - jpaRelationship = new ArrayList(); - } - return jpaRelationship; - } - - /** - * - * Java class for anonymous complex type. - * - * - * The following schema fragment specifies the expected content contained - * within this class. - * - * - * <complexType> - * <simpleContent> - * <extension base="<http://www.w3.org/2001/XMLSchema>string"> - * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * </extension> - * </simpleContent> - * </complexType> - * - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { "value" }) - public static class JPARelationship { - - @XmlValue - protected String value; - @XmlAttribute(name = "name", required = true) - protected String name; + @XmlElement(name = "JPARelationship") + protected List jpaRelationship; /** - * Gets the value of the value property. + * Gets the value of the jpaRelationship property. * - * @return possible object is {@link String } + * + * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaRelationship property. * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. + * + * For example, to add a new item, do as follows: * - * @param value - * allowed object is {@link String } + * + * getJPARelationship().add(newItem); + * * - */ - public void setValue(final String value) { - this.value = value; - } - - /** - * Gets the value of the name property. * - * @return possible object is {@link String } + * + * Objects of the following type(s) are allowed in the list + * {@link JPARelationshipMapType.JPARelationship } + * * */ - public String getName() { - return name; + public List getJPARelationship() { + if (jpaRelationship == null) { + jpaRelationship = new ArrayList(); + } + return jpaRelationship; } /** - * Sets the value of the name property. + * + * Java class for anonymous complex type. + * + * + * The following schema fragment specifies the expected content contained within this class. + * + * + * <complexType> + * <simpleContent> + * <extension base="<http://www.w3.org/2001/XMLSchema>string"> + * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * </extension> + * </simpleContent> + * </complexType> + * * - * @param value - * allowed object is {@link String } * */ - public void setName(final String value) { - name = value; - } + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"value"}) + public static class JPARelationship { + + @XmlValue + protected String value; + @XmlAttribute(name = "name", required = true) + protected String name; - } + /** + * Gets the value of the value property. + * + * @return possible object is {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value allowed object is {@link String } + * + */ + public void setValue(final String value) { + this.value = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } + + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java index 45a7c3f9b..ed06d3832 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java @@ -1,28 +1,24 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ /** - * OData JPA Processor API Library - Mapping Model - * The JPA EDM Mapping model (XML document) is represented as JAXB annotated Java Classes. - * - * + * OData JPA Processor API Library - Mapping Model The JPA EDM Mapping model (XML document) + * is represented as JAXB annotated Java Classes. + * + * */ -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping", - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +@jakarta.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping", + elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED) package org.apache.olingo.odata2.jpa.processor.api.model.mapping; diff --git a/odata2-jpa-processor/jpa-core/pom.xml b/odata2-jpa-processor/jpa-core/pom.xml index c8eb662a5..2c09c1faa 100644 --- a/odata2-jpa-processor/jpa-core/pom.xml +++ b/odata2-jpa-processor/jpa-core/pom.xml @@ -24,7 +24,7 @@ org.apache.olingo olingo-odata2-jpa-processor - 2.0.13 + 3.0.0-SNAPSHOT ../ @@ -68,10 +68,9 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 - 1.6 - 1.6 + 17 + 17 @@ -88,9 +87,8 @@ - org.eclipse.persistence - javax.persistence - ${version.javax.persistence} + jakarta.persistence + jakarta.persistence-api @@ -122,14 +120,13 @@ junit junit - 4.9 test - org.easymock - easymock - 3.1 - test + org.easymock + easymock + 5.2.0 + test @@ -138,7 +135,6 @@ org.slf4j slf4j-api - 1.7.2 test
- * Java class for anonymous complex type. - * - *
- * The following schema fragment specifies the expected content contained - * within this class. - * - *
- * <complexType> - * <simpleContent> - * <extension base="<http://www.w3.org/2001/XMLSchema>string"> - * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> - * </extension> - * </simpleContent> - * </complexType> - *
+ * This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the jpaRelationship property. * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. + *
+ * For example, to add a new item, do as follows: * - * @param value - * allowed object is {@link String } + *
+ * getJPARelationship().add(newItem); + *
+ * Objects of the following type(s) are allowed in the list + * {@link JPARelationshipMapType.JPARelationship } + * * */ - public String getName() { - return name; + public List getJPARelationship() { + if (jpaRelationship == null) { + jpaRelationship = new ArrayList(); + } + return jpaRelationship; } /** - * Sets the value of the name property. + * + * Java class for anonymous complex type. + * + * + * The following schema fragment specifies the expected content contained within this class. + * + * + * <complexType> + * <simpleContent> + * <extension base="<http://www.w3.org/2001/XMLSchema>string"> + * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * </extension> + * </simpleContent> + * </complexType> + * * - * @param value - * allowed object is {@link String } * */ - public void setName(final String value) { - name = value; - } + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"value"}) + public static class JPARelationship { + + @XmlValue + protected String value; + @XmlAttribute(name = "name", required = true) + protected String name; - } + /** + * Gets the value of the value property. + * + * @return possible object is {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value allowed object is {@link String } + * + */ + public void setValue(final String value) { + this.value = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + * + */ + public void setName(final String value) { + name = value; + } + + } } diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java index 45a7c3f9b..ed06d3832 100644 --- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java +++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/model/mapping/package-info.java @@ -1,28 +1,24 @@ /******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. ******************************************************************************/ /** - * OData JPA Processor API Library - Mapping Model - * The JPA EDM Mapping model (XML document) is represented as JAXB annotated Java Classes. - * - * + * OData JPA Processor API Library - Mapping Model The JPA EDM Mapping model (XML document) + * is represented as JAXB annotated Java Classes. + * + * */ -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping", - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +@jakarta.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping", + elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED) package org.apache.olingo.odata2.jpa.processor.api.model.mapping; diff --git a/odata2-jpa-processor/jpa-core/pom.xml b/odata2-jpa-processor/jpa-core/pom.xml index c8eb662a5..2c09c1faa 100644 --- a/odata2-jpa-processor/jpa-core/pom.xml +++ b/odata2-jpa-processor/jpa-core/pom.xml @@ -24,7 +24,7 @@ org.apache.olingo olingo-odata2-jpa-processor - 2.0.13 + 3.0.0-SNAPSHOT ../ @@ -68,10 +68,9 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 - 1.6 - 1.6 + 17 + 17 @@ -88,9 +87,8 @@ - org.eclipse.persistence - javax.persistence - ${version.javax.persistence} + jakarta.persistence + jakarta.persistence-api @@ -122,14 +120,13 @@ junit junit - 4.9 test - org.easymock - easymock - 3.1 - test + org.easymock + easymock + 5.2.0 + test @@ -138,7 +135,6 @@ org.slf4j slf4j-api - 1.7.2 test
+ * Java class for anonymous complex type. + * + *
+ * The following schema fragment specifies the expected content contained within this class. + * + *
+ * <complexType> + * <simpleContent> + * <extension base="<http://www.w3.org/2001/XMLSchema>string"> + * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * </extension> + * </simpleContent> + * </complexType> + *