You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by mi...@apache.org on 2025/03/01 12:58:16 UTC
(olingo-odata2) 28/29: more adaptations
This is an automated email from the ASF dual-hosted git repository.
mibo pushed a commit to branch OLINGO-1636-jdk_upgrade
in repository https://gitbox.apache.org/repos/asf/olingo-odata2.git
commit 5d7914ce329b61a059d18c3cbfa02e1f10969bf7
Author: Iliyan Velichkov <ve...@gmail.com>
AuthorDate: Thu Dec 14 12:54:21 2023 +0200
more adaptations
Signed-off-by: Iliyan Velichkov <ve...@gmail.com>
---
.../processor/ref/model/ResourceHelper.java | 134 ++-
.../processor/ref/AbstractRefXmlTest.java | 118 ++-
.../api/model/mapping/JPAAttributeMapType.java | 273 +++---
.../api/model/mapping/JPAEdmMappingModel.java | 80 +-
.../model/mapping/JPAEdmMappingModelFactory.java | 130 ++-
.../model/mapping/JPAEmbeddableTypeMapType.java | 224 +++--
.../model/mapping/JPAEmbeddableTypesMapType.java | 97 +--
.../api/model/mapping/JPAEntityTypeMapType.java | 335 ++++----
.../api/model/mapping/JPAEntityTypesMapType.java | 97 +--
.../model/mapping/JPAPersistenceUnitMapType.java | 214 +++--
.../api/model/mapping/JPARelationshipMapType.java | 223 +++--
odata2-jpa-processor/jpa-core/pom.xml | 8 +-
.../jpa/processor/core/access/data/JPAEntity.java | 930 ++++++++++-----------
.../core/access/model/JPATypeConverter.java | 4 +-
.../core/access/data/JPAEntityParserTest.java | 17 +-
.../processor/core/mock/ODataJPAContextMock.java | 187 +++--
.../mock/data/EntityWithXmlAdapterOnProperty.java | 2 +-
.../jpa/processor/core/mock/data/JPATypeMock.java | 2 +-
.../jpa/processor/core/mock/data/XmlAdapter.java | 47 +-
19 files changed, 1511 insertions(+), 1611 deletions(-)
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 7d64bc41..8fc4dc27 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.awt.image.WritableRaster;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
-
import javax.imageio.ImageIO;
/**
@@ -31,66 +26,67 @@ import javax.imageio.ImageIO;
*/
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 = ResourceHelper.class.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 635e605b..13867b9c 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 @@ import org.xml.sax.SAXException;
/**
* 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<String, String> prefixMap = new HashMap<String, String>();
- 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<String, String> prefixMap = new HashMap<String, String>();
+ 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-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 e7bcbe97..302a51d6 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,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.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;
@@ -29,17 +24,17 @@ import javax.xml.bind.annotation.XmlType;
import javax.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.
- *
- *
- * <p>Java class for JPAAttributeMapType complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
+ *
+ *
+ * <p>
+ * Java class for JPAAttributeMapType complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
* <pre>
* <complexType name="JPAAttributeMapType">
* <complexContent>
@@ -60,143 +55,139 @@ import javax.xml.bind.annotation.XmlValue;
* </complexContent>
* </complexType>
* </pre>
- *
- *
+ *
+ *
*/
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "JPAAttributeMapType", propOrder = { "jpaAttribute" })
+@XmlType(name = "JPAAttributeMapType", propOrder = {"jpaAttribute"})
public class JPAAttributeMapType {
- @XmlElement(name = "JPAAttribute")
- protected List<JPAAttributeMapType.JPAAttribute> jpaAttribute;
-
- /**
- * Gets the value of the jpaAttribute property.
- *
- * <p>
- * 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 <CODE>set</CODE> method for the jpaAttribute property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getJPAAttribute().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list {@link JPAAttributeMapType.JPAAttribute }
- *
- *
- */
- public List<JPAAttributeMapType.JPAAttribute> getJPAAttribute() {
- if (jpaAttribute == null) {
- jpaAttribute = new ArrayList<JPAAttributeMapType.JPAAttribute>();
- }
- return jpaAttribute;
- }
-
- /**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <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>
- * </pre>
- *
- *
- */
- @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<JPAAttributeMapType.JPAAttribute> jpaAttribute;
/**
- * Gets the value of the value property.
+ * Gets the value of the jpaAttribute property.
*
- * @return
- * possible object is {@link String }
+ * <p>
+ * 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 <CODE>set</CODE> method for the jpaAttribute property.
*
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Sets the value of the value property.
+ * <p>
+ * For example, to add a new item, do as follows:
+ *
+ * <pre>
+ * getJPAAttribute().add(newItem);
+ * </pre>
*
- * @param value
- * allowed object is {@link String }
*
- */
- public void setValue(final String value) {
- this.value = value;
- }
-
- /**
- * Gets the value of the name property.
+ * <p>
+ * 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<JPAAttributeMapType.JPAAttribute> getJPAAttribute() {
+ if (jpaAttribute == null) {
+ jpaAttribute = new ArrayList<JPAAttributeMapType.JPAAttribute>();
+ }
+ return jpaAttribute;
}
/**
- * Sets the value of the name property.
+ * <p>
+ * Java class for anonymous complex type.
*
- * @param value
- * allowed object is {@link String }
+ * <p>
+ * 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.
+ * <pre>
+ * <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>
+ * </pre>
*
- * @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 a4175d48..1d585dfd 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,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.api.model.mapping;
@@ -27,11 +23,10 @@ import javax.xml.bind.annotation.XmlType;
/**
* <p>
* Java class for anonymous complex type.
- *
+ *
* <p>
- * The following schema fragment specifies the expected content contained within
- * this class.
- *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
* <pre>
* <complexType>
* <complexContent>
@@ -44,36 +39,35 @@ import javax.xml.bind.annotation.XmlType;
* </complexContent>
* </complexType>
* </pre>
- *
- *
+ *
+ *
*/
@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 84f8b282..5f2683aa 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;
/**
- * 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.
* <p>
- * 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 e6406738..024ea5ae 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,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.api.model.mapping;
@@ -25,16 +21,17 @@ import javax.xml.bind.annotation.XmlElement;
import javax.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.
- *
- *
- * <p>Java class for JPAEmbeddableTypeMapType complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
+ *
+ *
+ * <p>
+ * Java class for JPAEmbeddableTypeMapType complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
* <pre>
* <complexType name="JPAEmbeddableTypeMapType">
* <complexContent>
@@ -50,112 +47,103 @@ import javax.xml.bind.annotation.XmlType;
* </complexContent>
* </complexType>
* </pre>
- *
- *
+ *
+ *
*/
@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 62931244..6dcfb8a6 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,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.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;
@@ -29,11 +24,10 @@ import javax.xml.bind.annotation.XmlType;
/**
* <p>
* Java class for JPAEmbeddableTypesMapType complex type.
- *
+ *
* <p>
- * The following schema fragment specifies the expected content contained within
- * this class.
- *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
* <pre>
* <complexType name="JPAEmbeddableTypesMapType">
* <complexContent>
@@ -47,43 +41,42 @@ import javax.xml.bind.annotation.XmlType;
* </complexContent>
* </complexType>
* </pre>
- *
- *
+ *
+ *
*/
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "JPAEmbeddableTypesMapType", propOrder = { "jpaEmbeddableType" })
+@XmlType(name = "JPAEmbeddableTypesMapType", propOrder = {"jpaEmbeddableType"})
public class JPAEmbeddableTypesMapType {
- @XmlElement(name = "JPAEmbeddableType")
- protected List<JPAEmbeddableTypeMapType> jpaEmbeddableType;
+ @XmlElement(name = "JPAEmbeddableType")
+ protected List<JPAEmbeddableTypeMapType> jpaEmbeddableType;
- /**
- * Gets the value of the jpaEmbeddableType property.
- *
- * <p>
- * 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
- * <CODE>set</CODE> method for the jpaEmbeddableType property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getJPAEmbeddableType().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list {@link JPAEmbeddableTypeMapType }
- *
- *
- */
- public List<JPAEmbeddableTypeMapType> getJPAEmbeddableType() {
- if (jpaEmbeddableType == null) {
- jpaEmbeddableType = new ArrayList<JPAEmbeddableTypeMapType>();
+ /**
+ * Gets the value of the jpaEmbeddableType property.
+ *
+ * <p>
+ * 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 <CODE>set</CODE> method for the jpaEmbeddableType property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ *
+ * <pre>
+ * getJPAEmbeddableType().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list {@link JPAEmbeddableTypeMapType }
+ *
+ *
+ */
+ public List<JPAEmbeddableTypeMapType> getJPAEmbeddableType() {
+ if (jpaEmbeddableType == null) {
+ jpaEmbeddableType = new ArrayList<JPAEmbeddableTypeMapType>();
+ }
+ 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 22e18192..fe6173c8 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,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.api.model.mapping;
@@ -25,16 +21,17 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
- *
- * The default name for EDM
- * entity type is derived from JPA entity type name. This can be
- * overriden using JPAEntityTypeMapType.
- *
- *
- * <p>Java class for JPAEntityTypeMapType complex type.
- *
- * <p>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.
+ *
+ *
+ * <p>
+ * Java class for JPAEntityTypeMapType complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
* <pre>
* <complexType name="JPAEntityTypeMapType">
* <complexContent>
@@ -53,161 +50,147 @@ import javax.xml.bind.annotation.XmlType;
* </complexContent>
* </complexType>
* </pre>
- *
- *
+ *
+ *
*/
@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 7a72e084..5cbd7599 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,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.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;
@@ -29,11 +24,10 @@ import javax.xml.bind.annotation.XmlType;
/**
* <p>
* Java class for JPAEntityTypesMapType complex type.
- *
+ *
* <p>
- * The following schema fragment specifies the expected content contained within
- * this class.
- *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
* <pre>
* <complexType name="JPAEntityTypesMapType">
* <complexContent>
@@ -47,43 +41,42 @@ import javax.xml.bind.annotation.XmlType;
* </complexContent>
* </complexType>
* </pre>
- *
- *
+ *
+ *
*/
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "JPAEntityTypesMapType", propOrder = { "jpaEntityType" })
+@XmlType(name = "JPAEntityTypesMapType", propOrder = {"jpaEntityType"})
public class JPAEntityTypesMapType {
- @XmlElement(name = "JPAEntityType")
- protected List<JPAEntityTypeMapType> jpaEntityType;
+ @XmlElement(name = "JPAEntityType")
+ protected List<JPAEntityTypeMapType> jpaEntityType;
- /**
- * Gets the value of the jpaEntityType property.
- *
- * <p>
- * 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
- * <CODE>set</CODE> method for the jpaEntityType property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getJPAEntityType().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list {@link JPAEntityTypeMapType }
- *
- *
- */
- public List<JPAEntityTypeMapType> getJPAEntityType() {
- if (jpaEntityType == null) {
- jpaEntityType = new ArrayList<JPAEntityTypeMapType>();
+ /**
+ * Gets the value of the jpaEntityType property.
+ *
+ * <p>
+ * 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 <CODE>set</CODE> method for the jpaEntityType property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ *
+ * <pre>
+ * getJPAEntityType().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list {@link JPAEntityTypeMapType }
+ *
+ *
+ */
+ public List<JPAEntityTypeMapType> getJPAEntityType() {
+ if (jpaEntityType == null) {
+ jpaEntityType = new ArrayList<JPAEntityTypeMapType>();
+ }
+ 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 22260eac..53bc390c 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,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.api.model.mapping;
@@ -25,18 +21,17 @@ import javax.xml.bind.annotation.XmlElement;
import javax.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.
+ *
+ *
* <p>
* Java class for JPAPersistenceUnitMapType complex type.
- *
+ *
* <p>
- * The following schema fragment specifies the expected content contained within
- * this class.
- *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
* <pre>
* <complexType name="JPAPersistenceUnitMapType">
* <complexContent>
@@ -53,105 +48,100 @@ import javax.xml.bind.annotation.XmlType;
* </complexContent>
* </complexType>
* </pre>
- *
- *
+ *
+ *
*/
@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 25a2f956..ed596422 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,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.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;
@@ -29,18 +24,17 @@ import javax.xml.bind.annotation.XmlType;
import javax.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.
+ *
+ *
* <p>
* Java class for JPARelationshipMapType complex type.
- *
+ *
* <p>
- * The following schema fragment specifies the expected content contained within
- * this class.
- *
+ * The following schema fragment specifies the expected content contained within this class.
+ *
* <pre>
* <complexType name="JPARelationshipMapType">
* <complexContent>
@@ -60,116 +54,113 @@ import javax.xml.bind.annotation.XmlValue;
* </complexContent>
* </complexType>
* </pre>
- *
- *
+ *
+ *
*/
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "JPARelationshipMapType", propOrder = { "jpaRelationship" })
+@XmlType(name = "JPARelationshipMapType", propOrder = {"jpaRelationship"})
public class JPARelationshipMapType {
- @XmlElement(name = "JPARelationship")
- protected List<JPARelationshipMapType.JPARelationship> jpaRelationship;
-
- /**
- * Gets the value of the jpaRelationship property.
- *
- * <p>
- * 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
- * <CODE>set</CODE> method for the jpaRelationship property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getJPARelationship().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list {@link JPARelationshipMapType.JPARelationship }
- *
- *
- */
- public List<JPARelationshipMapType.JPARelationship> getJPARelationship() {
- if (jpaRelationship == null) {
- jpaRelationship = new ArrayList<JPARelationshipMapType.JPARelationship>();
- }
- return jpaRelationship;
- }
-
- /**
- * <p>
- * Java class for anonymous complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained
- * within this class.
- *
- * <pre>
- * <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>
- * </pre>
- *
- *
- */
- @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<JPARelationshipMapType.JPARelationship> jpaRelationship;
/**
- * Gets the value of the value property.
+ * Gets the value of the jpaRelationship property.
*
- * @return possible object is {@link String }
+ * <p>
+ * 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 <CODE>set</CODE> method for the jpaRelationship property.
*
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Sets the value of the value property.
+ * <p>
+ * For example, to add a new item, do as follows:
*
- * @param value
- * allowed object is {@link String }
+ * <pre>
+ * getJPARelationship().add(newItem);
+ * </pre>
*
- */
- public void setValue(final String value) {
- this.value = value;
- }
-
- /**
- * Gets the value of the name property.
*
- * @return possible object is {@link String }
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link JPARelationshipMapType.JPARelationship }
+ *
*
*/
- public String getName() {
- return name;
+ public List<JPARelationshipMapType.JPARelationship> getJPARelationship() {
+ if (jpaRelationship == null) {
+ jpaRelationship = new ArrayList<JPARelationshipMapType.JPARelationship>();
+ }
+ return jpaRelationship;
}
/**
- * Sets the value of the name property.
+ * <p>
+ * Java class for anonymous complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <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>
+ * </pre>
*
- * @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-core/pom.xml b/odata2-jpa-processor/jpa-core/pom.xml
index ee4d22cd..4dbe770b 100644
--- a/odata2-jpa-processor/jpa-core/pom.xml
+++ b/odata2-jpa-processor/jpa-core/pom.xml
@@ -123,10 +123,10 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
- <version>3.1</version>
- <scope>test</scope>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymock</artifactId>
+ <version>5.2.0</version>
+ <scope>test</scope>
</dependency>
<!-- ########################## -->
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 a3f5495c..3db5ab5b 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.HashSet;
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.EdmNavigationProperty;
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.ODataJPAModelExcepti
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<String, Method> accessModifiersWrite = null;
- private JPAEntityParser jpaEntityParser = null;
- private ODataJPAContext oDataJPAContext;
- private OnJPAWriteContent onJPAWriteContent = null;
- private List<String> relatedJPAEntityLink = new ArrayList<String>();
- private HashMap<String, List<Object>> 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<String, Method> accessModifiersWrite = null;
+ private JPAEntityParser jpaEntityParser = null;
+ private ODataJPAContext oDataJPAContext;
+ private OnJPAWriteContent onJPAWriteContent = null;
+ private final List<String> relatedJPAEntityLink = new ArrayList<String>();
+ private HashMap<String, List<Object>> 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<String, Method> accessModifiersWrite) {
+ this.accessModifiersWrite = accessModifiersWrite;
}
- jpaEntityParser = new JPAEntityParser();
- onJPAWriteContent = oDataJPAContext.getODataContext().getServiceFactory().getCallback(OnJPAWriteContent.class);
- }
- public void setAccessModifersWrite(final HashMap<String, Method> 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<String, Object> 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<Object> targetJPAEntities = new ArrayList<Object>();
+ 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<String, Object> oDataEntryProperties = oDataEntry.getProperties();
- if (oDataEntry.containsInlineEntry()) {
- normalizeInlineEntries(oDataEntryProperties);
- }
- if (oDataEntry.getProperties().size() > 0) {
+ public EdmEntitySet getEdmEntitySet() {
+ return oDataEntitySet;
+ }
+ public void create(final Map<String, Object> 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<Object> targetJPAEntities = new ArrayList<Object>();
- 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<String, Object> 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<String, Object> 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<String, Object> oDataEntryProperties = oDataEntry.getProperties();
- if (oDataEntry.containsInlineEntry()) {
- normalizeInlineEntries(oDataEntryProperties);
+ public void update(final Map<String, Object> 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<String, Object> 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<String, Object> 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<String, String> embeddableKeys,
- final List<EdmProperty> oDataEntryKeyProperties,
- final Map<String, Object> oDataEntryProperties, final Object entity)
- throws ODataJPARuntimeException, EdmException, IllegalAccessException, IllegalArgumentException,
- InvocationTargetException, InstantiationException {
-
- HashMap<String, Object> embeddableObjMap = new HashMap<String, Object>();
- List<EdmProperty> leftODataEntryKeyProperties = new ArrayList<EdmProperty>();
- HashMap<String, String> leftEmbeddableKeys = new HashMap<String, String>();
-
- 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<String, Object> 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<String, Object> oDataEntryProperties) throws ODataJPARuntimeException {
- List<ODataEntry> 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<ODataEntry>();
- entries.add((ODataEntry) inline);
- }
- if (entries != null) {
- oDataEntryProperties.put(navigationPropertyName, entries);
- entries = null;
+ protected void setEmbeddableKeyProperty(final HashMap<String, String> embeddableKeys, final List<EdmProperty> oDataEntryKeyProperties,
+ final Map<String, Object> oDataEntryProperties, final Object entity) throws ODataJPARuntimeException, EdmException,
+ IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException {
+
+ HashMap<String, Object> embeddableObjMap = new HashMap<String, Object>();
+ List<EdmProperty> leftODataEntryKeyProperties = new ArrayList<EdmProperty>();
+ HashMap<String, String> leftEmbeddableKeys = new HashMap<String, String>();
+
+ 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<String, Object> oDataEntryProperties,
- final boolean isCreate)
- throws ODataJPARuntimeException {
- try {
-
- EdmStructuralType structuralType = null;
- final List<String> 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<String, String> embeddableKeys =
- jpaEntityParser.getJPAEmbeddableKeyMap(jpaEntity.getClass().getName());
- Set<String> propertyNames = null;
- if (embeddableKeys != null) {
- setEmbeddableKeyProperty(embeddableKeys, oDataEntityType.getKeyProperties(), oDataEntryProperties,
- jpaEntity);
-
- propertyNames = new HashSet<String>();
- 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<String, Object> oDataEntryProperties) throws ODataJPARuntimeException {
+ List<ODataEntry> 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<ODataEntry>();
+ 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<String, Object> 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<String> 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<String, Object>) oDataEntryProperties.get(propertyName), propertyName);
- } else {
- setComplexProperty(accessModifier, jpaEntity,
- structuralType,
- (HashMap<String, Object>) oDataEntryProperties.get(propertyName));
- }
- break;
- case NAVIGATION:
- case ENTITY:
- if (isCreate) {
- structuralType = (EdmStructuralType) edmTyped.getType();
- EdmNavigationProperty navProperty = (EdmNavigationProperty) edmTyped;
- EdmEntitySet edmRelatedEntitySet = oDataEntitySet.getRelatedEntitySet(navProperty);
- List<ODataEntry> relatedEntries = (List<ODataEntry>) oDataEntryProperties.get(propertyName);
- if (relatedJPAEntityMap == null) {
- relatedJPAEntityMap = new HashMap<String, List<Object>>();
+
+ 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<String, String> embeddableKeys = jpaEntityParser.getJPAEmbeddableKeyMap(jpaEntity.getClass()
+ .getName());
+ Set<String> propertyNames = null;
+ if (embeddableKeys != null) {
+ setEmbeddableKeyProperty(embeddableKeys, oDataEntityType.getKeyProperties(), oDataEntryProperties, jpaEntity);
+
+ propertyNames = new HashSet<String>();
+ propertyNames.addAll(oDataEntryProperties.keySet());
+ for (String key : embeddableKeys.keySet()) {
+ propertyNames.remove(key);
+ }
+ } else {
+ propertyNames = oDataEntryProperties.keySet();
}
- List<Object> relatedJPAEntities = new ArrayList<Object>();
- 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<String, Object>) oDataEntryProperties.get(propertyName), propertyName);
+ } else {
+ setComplexProperty(accessModifier, jpaEntity, structuralType,
+ (HashMap<String, Object>) oDataEntryProperties.get(propertyName));
+ }
+ break;
+ case NAVIGATION:
+ case ENTITY:
+ if (isCreate) {
+ structuralType = (EdmStructuralType) edmTyped.getType();
+ EdmNavigationProperty navProperty = (EdmNavigationProperty) edmTyped;
+ EdmEntitySet edmRelatedEntitySet = oDataEntitySet.getRelatedEntitySet(navProperty);
+ List<ODataEntry> relatedEntries = (List<ODataEntry>) oDataEntryProperties.get(propertyName);
+ if (relatedJPAEntityMap == null) {
+ relatedJPAEntityMap = new HashMap<String, List<Object>>();
+ }
+ List<Object> relatedJPAEntities = new ArrayList<Object>();
+ 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<String, Object> 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<String, Method> 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<String, Object>) propertyValue.get(edmPropertyName), propertyName);
+ @SuppressWarnings("unchecked")
+ protected void setComplexProperty(Method accessModifier, final Object jpaEntity, final EdmStructuralType edmComplexType,
+ final HashMap<String, Object> 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<Enum>) 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<String, Method> 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<String, Object>) 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<Enum>) 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/model/JPATypeConverter.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPATypeConverter.java
index a27658bb..579a1f59 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
@@ -33,8 +33,8 @@ import jakarta.persistence.Lob;
import jakarta.persistence.Temporal;
import jakarta.persistence.TemporalType;
import jakarta.persistence.metamodel.Attribute;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+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/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParserTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParserTest.java
index 25f28c76..1813557d 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParserTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParserTest.java
@@ -378,7 +378,8 @@ public class JPAEntityParserTest {
assertEquals("getField1", name);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) {
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException
+ | SecurityException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
@@ -401,7 +402,8 @@ public class JPAEntityParserTest {
String name = (String) getGetterName.invoke(resultParser, params);
assertNull(name);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) {
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException
+ | SecurityException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
@@ -410,7 +412,7 @@ public class JPAEntityParserTest {
/*
* TestCase - getGetterName is a private method in JPAResultParser. The method is uses reflection to
* derive the property access methods from EdmProperty
- *
+ *
* EdmProperty name could have been modified. Then mapping object of EdmProperty should be used for
* deriving the name
*/
@@ -432,7 +434,8 @@ public class JPAEntityParserTest {
String name = (String) getGetterName.invoke(resultParser, params);
assertEquals("getField1", name);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) {
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException
+ | SecurityException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
}
@@ -492,15 +495,13 @@ public class JPAEntityParserTest {
getGetters.setAccessible(true);
try {
getGetters.invoke(resultParser, jpaEntity, structuralType);
- } catch (IllegalAccessException e) {
- fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
- } catch (IllegalArgumentException e) {
+ } catch (IllegalAccessException | IllegalArgumentException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
} catch (InvocationTargetException e) {
assertTrue(true);
}
} catch (NoSuchMethodException e) {
- assertEquals("org.apache.olingo.odata2.jpa.processor.core.access.data.JPAEntityParser.getGetters(java.lang.Object, "
+ assertEquals("org.apache.olingo.odata2.jpa.processor.core.access.data.JPAEntityParser.getGetters(java.lang.Object,"
+ "org.apache.olingo.odata2.api.edm.EdmStructuralType)", e.getMessage());
} catch (SecurityException | EdmException e) {
fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAContextMock.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAContextMock.java
index e4b0a930..b2c2f8cb 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAContextMock.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAContextMock.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.mock;
@@ -24,7 +20,10 @@ import java.util.Calendar;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-
+import org.apache.olingo.odata2.api.processor.ODataContext;
+import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext;
+import org.easymock.Capture;
+import org.easymock.EasyMock;
import jakarta.persistence.EntityManager;
import jakarta.persistence.EntityManagerFactory;
import jakarta.persistence.Query;
@@ -32,80 +31,106 @@ import jakarta.persistence.TemporalType;
import jakarta.persistence.metamodel.EntityType;
import jakarta.persistence.metamodel.Metamodel;
-import org.apache.olingo.odata2.api.processor.ODataContext;
-import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext;
-import org.easymock.Capture;
-import org.easymock.EasyMock;
-
public abstract class ODataJPAContextMock {
- public static final String NAMESPACE = "salesorderprocessing";
- public static final String MAPPING_MODEL = "SalesOrderProcessingMappingModel";
- public static final String PERSISTENCE_UNIT_NAME = "salesorderprocessing";
+ public static final String NAMESPACE = "salesorderprocessing";
+ public static final String MAPPING_MODEL = "SalesOrderProcessingMappingModel";
+ public static final String PERSISTENCE_UNIT_NAME = "salesorderprocessing";
- public static ODataJPAContext mockODataJPAContext() {
- ODataJPAContext odataJPAContext = EasyMock.createMock(ODataJPAContext.class);
- EasyMock.expect(odataJPAContext.getPersistenceUnitName()).andStubReturn(NAMESPACE);
- EasyMock.expect(odataJPAContext.getEntityManagerFactory()).andReturn(mockEntityManagerFactory());
- EasyMock.expect(odataJPAContext.getEntityManager()).andReturn(mockEntityManager());
- EasyMock.expect(odataJPAContext.getJPAEdmMappingModel()).andReturn(MAPPING_MODEL);
- EasyMock.expect(odataJPAContext.getJPAEdmExtension()).andReturn(null);
- EasyMock.expect(odataJPAContext.getDefaultNaming()).andReturn(true);
+ public static ODataJPAContext mockODataJPAContext() {
+ ODataJPAContext odataJPAContext = EasyMock.createMock(ODataJPAContext.class);
+ EasyMock.expect(odataJPAContext.getPersistenceUnitName())
+ .andStubReturn(NAMESPACE);
+ EasyMock.expect(odataJPAContext.getEntityManagerFactory())
+ .andReturn(mockEntityManagerFactory());
+ EasyMock.expect(odataJPAContext.getEntityManager())
+ .andReturn(mockEntityManager());
+ EasyMock.expect(odataJPAContext.getJPAEdmMappingModel())
+ .andReturn(MAPPING_MODEL);
+ EasyMock.expect(odataJPAContext.getJPAEdmExtension())
+ .andReturn(null);
+ EasyMock.expect(odataJPAContext.getDefaultNaming())
+ .andReturn(true);
- EasyMock.replay(odataJPAContext);
- return odataJPAContext;
- }
+ EasyMock.replay(odataJPAContext);
+ return odataJPAContext;
+ }
- public static ODataJPAContext mockODataJPAContext(final ODataContext context) {
- ODataJPAContext odataJPAContext = EasyMock.createMock(ODataJPAContext.class);
- EasyMock.expect(odataJPAContext.getPersistenceUnitName()).andStubReturn(NAMESPACE);
- EasyMock.expect(odataJPAContext.getEntityManagerFactory()).andReturn(mockEntityManagerFactory());
- EasyMock.expect(odataJPAContext.getEntityManager()).andStubReturn(mockEntityManager());
- EasyMock.expect(odataJPAContext.getJPAEdmMappingModel()).andReturn(MAPPING_MODEL);
- EasyMock.expect(odataJPAContext.getJPAEdmExtension()).andReturn(null);
- EasyMock.expect(odataJPAContext.getDefaultNaming()).andReturn(true);
- EasyMock.expect(odataJPAContext.getODataContext()).andReturn(context).anyTimes();
- EasyMock.expect(odataJPAContext.getPageSize()).andReturn(0);
+ public static ODataJPAContext mockODataJPAContext(final ODataContext context) {
+ ODataJPAContext odataJPAContext = EasyMock.createMock(ODataJPAContext.class);
+ EasyMock.expect(odataJPAContext.getPersistenceUnitName())
+ .andStubReturn(NAMESPACE);
+ EasyMock.expect(odataJPAContext.getEntityManagerFactory())
+ .andReturn(mockEntityManagerFactory());
+ EasyMock.expect(odataJPAContext.getEntityManager())
+ .andStubReturn(mockEntityManager());
+ EasyMock.expect(odataJPAContext.getJPAEdmMappingModel())
+ .andReturn(MAPPING_MODEL);
+ EasyMock.expect(odataJPAContext.getJPAEdmExtension())
+ .andReturn(null);
+ EasyMock.expect(odataJPAContext.getDefaultNaming())
+ .andReturn(true);
+ EasyMock.expect(odataJPAContext.getODataContext())
+ .andReturn(context)
+ .anyTimes();
+ EasyMock.expect(odataJPAContext.getPageSize())
+ .andReturn(0);
- EasyMock.replay(odataJPAContext);
- return odataJPAContext;
- }
+ EasyMock.replay(odataJPAContext);
+ return odataJPAContext;
+ }
- private static EntityManager mockEntityManager() {
- EntityManager em = EasyMock.createMock(EntityManager.class);
- Metamodel mm = EasyMock.createMock(Metamodel.class);
- EasyMock.expect(em.getMetamodel()).andReturn(mm).anyTimes();
- Set<EntityType<?>> et = new HashSet<EntityType<?>>();
- EasyMock.expect(mm.getEntities()).andReturn(et).anyTimes();
- EasyMock.expect(em.isOpen()).andReturn(true).anyTimes();
- Query jpqlquery = EasyMock.createMock(Query.class);
- Capture<String> capturedArgument = new Capture<String>();
- EasyMock.expect(em.createQuery(EasyMock.capture(capturedArgument))).andReturn(jpqlquery).anyTimes();
- EasyMock.expect(jpqlquery.setParameter(EasyMock.anyInt(), EasyMock.anyObject()))
- .andReturn(jpqlquery).anyTimes();
- EasyMock.expect(jpqlquery.setParameter(EasyMock.anyInt(), (Calendar) EasyMock.anyObject(),
- EasyMock.anyObject(TemporalType.TIMESTAMP.getClass()))).andReturn(jpqlquery).anyTimes();
- EasyMock.expect(jpqlquery.setParameter(EasyMock.anyInt(), (Time) EasyMock.anyObject(),
- EasyMock.anyObject(TemporalType.TIME.getClass()))).andReturn(jpqlquery).anyTimes();
- List<Object> result = new ArrayList<Object>();
- result.add(5);
- EasyMock.expect(jpqlquery.getResultList()).andReturn(result).anyTimes();
- EasyMock.replay(em, mm, jpqlquery);
- return em;
+ private static EntityManager mockEntityManager() {
+ EntityManager em = EasyMock.createMock(EntityManager.class);
+ Metamodel mm = EasyMock.createMock(Metamodel.class);
+ EasyMock.expect(em.getMetamodel())
+ .andReturn(mm)
+ .anyTimes();
+ Set<EntityType<?>> et = new HashSet<EntityType<?>>();
+ EasyMock.expect(mm.getEntities())
+ .andReturn(et)
+ .anyTimes();
+ EasyMock.expect(em.isOpen())
+ .andReturn(true)
+ .anyTimes();
+ Query jpqlquery = EasyMock.createMock(Query.class);
+ Capture<String> capturedArgument = Capture.newInstance();
+ EasyMock.expect(em.createQuery(EasyMock.capture(capturedArgument)))
+ .andReturn(jpqlquery)
+ .anyTimes();
+ EasyMock.expect(jpqlquery.setParameter(EasyMock.anyInt(), EasyMock.anyObject()))
+ .andReturn(jpqlquery)
+ .anyTimes();
+ EasyMock.expect(jpqlquery.setParameter(EasyMock.anyInt(), (Calendar) EasyMock.anyObject(),
+ EasyMock.anyObject(TemporalType.TIMESTAMP.getClass())))
+ .andReturn(jpqlquery)
+ .anyTimes();
+ EasyMock.expect(
+ jpqlquery.setParameter(EasyMock.anyInt(), (Time) EasyMock.anyObject(), EasyMock.anyObject(TemporalType.TIME.getClass())))
+ .andReturn(jpqlquery)
+ .anyTimes();
+ List<Object> result = new ArrayList<Object>();
+ result.add(5);
+ EasyMock.expect(jpqlquery.getResultList())
+ .andReturn(result)
+ .anyTimes();
+ EasyMock.replay(em, mm, jpqlquery);
+ return em;
- }
+ }
- private static EntityManagerFactory mockEntityManagerFactory() {
- EntityManagerFactory emf = EasyMock.createMock(EntityManagerFactory.class);
- EasyMock.expect(emf.getMetamodel()).andReturn(mockMetaModel());
- EasyMock.replay(emf);
- return emf;
- }
+ private static EntityManagerFactory mockEntityManagerFactory() {
+ EntityManagerFactory emf = EasyMock.createMock(EntityManagerFactory.class);
+ EasyMock.expect(emf.getMetamodel())
+ .andReturn(mockMetaModel());
+ EasyMock.replay(emf);
+ return emf;
+ }
- private static Metamodel mockMetaModel() {
- Metamodel metaModel = EasyMock.createMock(Metamodel.class);
- EasyMock.replay(metaModel);
- return metaModel;
- }
+ private static Metamodel mockMetaModel() {
+ Metamodel metaModel = EasyMock.createMock(Metamodel.class);
+ EasyMock.replay(metaModel);
+ return metaModel;
+ }
}
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/EntityWithXmlAdapterOnProperty.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/EntityWithXmlAdapterOnProperty.java
index a3b68d3d..f0e5d99d 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/EntityWithXmlAdapterOnProperty.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/EntityWithXmlAdapterOnProperty.java
@@ -18,7 +18,7 @@
******************************************************************************/
package org.apache.olingo.odata2.jpa.processor.core.mock.data;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
public class EntityWithXmlAdapterOnProperty {
private EntityWithXmlAdapterOnProperty self;
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/JPATypeMock.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/JPATypeMock.java
index a9d0c4eb..8bbd1bf2 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/JPATypeMock.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/JPATypeMock.java
@@ -28,7 +28,7 @@ import java.util.Date;
import java.util.List;
import java.util.UUID;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
/* ========================================================================= */
public class JPATypeMock {
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/XmlAdapter.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/XmlAdapter.java
index 32378340..d7d1d3e6 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/XmlAdapter.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/XmlAdapter.java
@@ -1,34 +1,29 @@
/*******************************************************************************
- * 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.mock.data;
-public class XmlAdapter extends
- javax.xml.bind.annotation.adapters.XmlAdapter<String, EntityWithXmlAdapterOnProperty> {
+public class XmlAdapter extends jakarta.xml.bind.annotation.adapters.XmlAdapter<String, EntityWithXmlAdapterOnProperty> {
- @Override
- public String marshal(EntityWithXmlAdapterOnProperty arg0) throws Exception {
- return "self";
- }
+ @Override
+ public String marshal(EntityWithXmlAdapterOnProperty arg0) throws Exception {
+ return "self";
+ }
- @Override
- public EntityWithXmlAdapterOnProperty unmarshal(String arg0) throws Exception {
- return new EntityWithXmlAdapterOnProperty();
- }
+ @Override
+ public EntityWithXmlAdapterOnProperty unmarshal(String arg0) throws Exception {
+ return new EntityWithXmlAdapterOnProperty();
+ }
-}
\ No newline at end of file
+}