You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ch...@apache.org on 2013/09/20 15:34:18 UTC
[56/59] [abbrv] cleanup jpa core
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAExpandCallBack.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAExpandCallBack.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAExpandCallBack.java
index 6d88b85..f4ad4e7 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAExpandCallBack.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAExpandCallBack.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.processor.core.jpa.access.data;
@@ -73,8 +73,10 @@ public class JPAExpandCallBack implements OnWriteFeedContent, OnWriteEntryConten
navigationLinks = context.getCurrentExpandSelectTreeNode().getLinks();
if (navigationLinks.size() > 0) {
currentNavPropertyList = new ArrayList<EdmNavigationProperty>();
- currentNavPropertyList.add(getNextNavigationProperty(context.getSourceEntitySet().getEntityType(), context.getNavigationProperty()));
- HashMap<String, Object> navigationMap = jpaResultParser.parse2EdmNavigationValueMap(inlinedEntry, currentNavPropertyList);
+ currentNavPropertyList.add(getNextNavigationProperty(context.getSourceEntitySet().getEntityType(), context
+ .getNavigationProperty()));
+ HashMap<String, Object> navigationMap =
+ jpaResultParser.parse2EdmNavigationValueMap(inlinedEntry, currentNavPropertyList);
edmPropertyValueMap.putAll(navigationMap);
result.setEntryData(edmPropertyValueMap);
}
@@ -110,10 +112,12 @@ public class JPAExpandCallBack implements OnWriteFeedContent, OnWriteEntryConten
result.setFeedData(edmEntityList);
if (context.getCurrentExpandSelectTreeNode().getLinks().size() > 0) {
currentNavPropertyList = new ArrayList<EdmNavigationProperty>();
- currentNavPropertyList.add(getNextNavigationProperty(context.getSourceEntitySet().getEntityType(), context.getNavigationProperty()));
+ currentNavPropertyList.add(getNextNavigationProperty(context.getSourceEntitySet().getEntityType(), context
+ .getNavigationProperty()));
int count = 0;
for (Object object : listOfItems) {
- HashMap<String, Object> navigationMap = jpaResultParser.parse2EdmNavigationValueMap(object, currentNavPropertyList);
+ HashMap<String, Object> navigationMap =
+ jpaResultParser.parse2EdmNavigationValueMap(object, currentNavPropertyList);
edmEntityList.get(count).putAll(navigationMap);
count++;
}
@@ -128,13 +132,15 @@ public class JPAExpandCallBack implements OnWriteFeedContent, OnWriteEntryConten
return result;
}
- private EdmNavigationProperty getNextNavigationProperty(final EdmEntityType sourceEntityType, final EdmNavigationProperty navigationProperty) throws EdmException {
+ private EdmNavigationProperty getNextNavigationProperty(final EdmEntityType sourceEntityType,
+ final EdmNavigationProperty navigationProperty) throws EdmException {
int count;
for (ArrayList<NavigationPropertySegment> navPropSegments : expandList) {
count = 0;
for (NavigationPropertySegment navPropSegment : navPropSegments) {
EdmNavigationProperty navProperty = navPropSegment.getNavigationProperty();
- if (navProperty.getFromRole().equalsIgnoreCase(sourceEntityType.getName()) && navProperty.getName().equals(navigationProperty.getName())) {
+ if (navProperty.getFromRole().equalsIgnoreCase(sourceEntityType.getName())
+ && navProperty.getName().equals(navigationProperty.getName())) {
return navPropSegments.get(count + 1).getNavigationProperty();
} else {
count++;
@@ -145,7 +151,9 @@ public class JPAExpandCallBack implements OnWriteFeedContent, OnWriteEntryConten
return null;
}
- public static <T> Map<String, ODataCallback> getCallbacks(final URI baseUri, final ExpandSelectTreeNode expandSelectTreeNode, final List<ArrayList<NavigationPropertySegment>> expandList) throws EdmException {
+ public static <T> Map<String, ODataCallback> getCallbacks(final URI baseUri,
+ final ExpandSelectTreeNode expandSelectTreeNode, final List<ArrayList<NavigationPropertySegment>> expandList)
+ throws EdmException {
Map<String, ODataCallback> callbacks = new HashMap<String, ODataCallback>();
for (String navigationPropertyName : expandSelectTreeNode.getLinks().keySet()) {
@@ -156,7 +164,8 @@ public class JPAExpandCallBack implements OnWriteFeedContent, OnWriteEntryConten
}
- private EntityProviderWriteProperties getInlineEntityProviderProperties(final WriteCallbackContext context) throws EdmException {
+ private EntityProviderWriteProperties getInlineEntityProviderProperties(final WriteCallbackContext context)
+ throws EdmException {
ODataEntityProviderPropertiesBuilder propertiesBuilder = EntityProviderWriteProperties.serviceRoot(baseUri);
propertiesBuilder.callbacks(getCallbacks(baseUri, context.getCurrentExpandSelectTreeNode(), expandList));
propertiesBuilder.expandSelectTree(context.getCurrentExpandSelectTreeNode());
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAFunctionContext.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAFunctionContext.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAFunctionContext.java
index 000d018..8f79c92 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAFunctionContext.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAFunctionContext.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.processor.core.jpa.access.data;
@@ -81,7 +81,8 @@ public class JPAFunctionContext extends JPAMethodContext {
return JPAFunctionContext.this;
}
- private JPAFunction generateJPAFunction() throws EdmException, NoSuchMethodException, SecurityException, ODataJPAModelException, ODataJPARuntimeException {
+ private JPAFunction generateJPAFunction() throws EdmException, NoSuchMethodException, SecurityException,
+ ODataJPAModelException, ODataJPARuntimeException {
Class<?>[] parameterTypes = getParameterTypes();
Method method = getMethod(parameterTypes);
@@ -113,7 +114,8 @@ public class JPAFunctionContext extends JPAMethodContext {
}
- private Object convertArguement(final EdmLiteral edmLiteral, final EdmFacets facets, final Class<?> targetType) throws EdmSimpleTypeException {
+ private Object convertArguement(final EdmLiteral edmLiteral, final EdmFacets facets, final Class<?> targetType)
+ throws EdmSimpleTypeException {
EdmSimpleType edmType = edmLiteral.getType();
Object value = edmType.valueOfString(edmLiteral.getLiteral(), EdmLiteralKind.DEFAULT, facets, targetType);
@@ -146,7 +148,8 @@ public class JPAFunctionContext extends JPAMethodContext {
return null;
}
- private Object generateEnclosingObject() throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
+ private Object generateEnclosingObject() throws InstantiationException, IllegalAccessException,
+ IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
Class<?> type = ((JPAEdmMapping) mapping).getJPAType();
Object[] params = null;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPALink.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPALink.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPALink.java
index caefe8c..872a99b 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPALink.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPALink.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.processor.core.jpa.access.data;
@@ -59,7 +59,8 @@ public class JPALink {
sourceJPAEntity = jpaEntity;
}
- public void create(final PostUriInfo uriInfo, final InputStream content, final String requestContentType, final String contentType) throws ODataJPARuntimeException, ODataJPAModelException {
+ public void create(final PostUriInfo uriInfo, final InputStream content, final String requestContentType,
+ final String contentType) throws ODataJPARuntimeException, ODataJPAModelException {
EdmEntitySet targetEntitySet = uriInfo.getTargetEntitySet();
String targerEntitySetName;
@@ -99,14 +100,17 @@ public class JPALink {
getUriInfo = parser.parseLinkURI();
sourceJPAEntity = jpaProcessor.process((GetEntityUriInfo) getUriInfo);
if (sourceJPAEntity == null) {
- throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.RESOURCE_X_NOT_FOUND.addContent(getUriInfo.getTargetEntitySet().getName()), null);
+ throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.RESOURCE_X_NOT_FOUND
+ .addContent(getUriInfo.getTargetEntitySet().getName()), null);
}
}
JPAEntityParser entityParser = new JPAEntityParser();
- Method setMethod = entityParser.getAccessModifier(sourceJPAEntity, navigationProperty, JPAEntityParser.ACCESS_MODIFIER_SET);
+ Method setMethod =
+ entityParser.getAccessModifier(sourceJPAEntity, navigationProperty, JPAEntityParser.ACCESS_MODIFIER_SET);
- Method getMethod = entityParser.getAccessModifier(sourceJPAEntity, navigationProperty, JPAEntityParser.ACCESS_MODIFIER_GET);
+ Method getMethod =
+ entityParser.getAccessModifier(sourceJPAEntity, navigationProperty, JPAEntityParser.ACCESS_MODIFIER_GET);
if (getMethod.getReturnType().getTypeParameters() != null) {
@SuppressWarnings("unchecked")
@@ -142,7 +146,8 @@ public class JPALink {
}
- public void update(final PutMergePatchUriInfo putUriInfo, final InputStream content, final String requestContentType, final String contentType) throws ODataJPARuntimeException, ODataJPAModelException {
+ public void update(final PutMergePatchUriInfo putUriInfo, final InputStream content, final String requestContentType,
+ final String contentType) throws ODataJPARuntimeException, ODataJPAModelException {
UriInfo uriInfo = (UriInfo) putUriInfo;
EdmEntitySet targetEntitySet = uriInfo.getTargetEntitySet();
@@ -183,16 +188,20 @@ public class JPALink {
getUriInfo = parser.parseLinkURI();
sourceJPAEntity = jpaProcessor.process((GetEntityUriInfo) getUriInfo);
if (sourceJPAEntity == null) {
- throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.RESOURCE_X_NOT_FOUND.addContent(getUriInfo.getTargetEntitySet().getName()), null);
+ throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.RESOURCE_X_NOT_FOUND
+ .addContent(getUriInfo.getTargetEntitySet().getName()), null);
}
}
JPAEntityParser entityParser = new JPAEntityParser();
- Method setMethod = entityParser.getAccessModifier(sourceJPAEntity, navigationProperty, JPAEntityParser.ACCESS_MODIFIER_SET);
+ Method setMethod =
+ entityParser.getAccessModifier(sourceJPAEntity, navigationProperty, JPAEntityParser.ACCESS_MODIFIER_SET);
- Method getMethod = entityParser.getAccessModifier(sourceJPAEntity, navigationProperty, JPAEntityParser.ACCESS_MODIFIER_GET);
+ Method getMethod =
+ entityParser.getAccessModifier(sourceJPAEntity, navigationProperty, JPAEntityParser.ACCESS_MODIFIER_GET);
- if (getMethod.getReturnType().getTypeParameters() != null && getMethod.getReturnType().getTypeParameters().length != 0) {
+ if (getMethod.getReturnType().getTypeParameters() != null
+ && getMethod.getReturnType().getTypeParameters().length != 0) {
@SuppressWarnings("unchecked")
List<Object> relatedEntities = (List<Object>) getMethod.invoke(sourceJPAEntity);
relatedEntities.add(targetJPAEntity);
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAProcessorImpl.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAProcessorImpl.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAProcessorImpl.java
index 6f266b9..8501b77 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAProcessorImpl.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/data/JPAProcessorImpl.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.processor.core.jpa.access.data;
@@ -268,6 +268,7 @@ public class JPAProcessorImpl implements JPAProcessor {
}
/* Process Create Entity Request */
+ @Override
public <T> List<T> process(final PostUriInfo createView, final InputStream content,
final String requestedContentType) throws ODataJPAModelException,
ODataJPARuntimeException {
@@ -275,25 +276,28 @@ public class JPAProcessorImpl implements JPAProcessor {
}
@Override
- public <T> List<T> process(PostUriInfo createView, Map<String, Object> content) throws ODataJPAModelException, ODataJPARuntimeException {
+ public <T> List<T> process(final PostUriInfo createView, final Map<String, Object> content)
+ throws ODataJPAModelException, ODataJPARuntimeException {
return processCreate(createView, null, content, null);
}
/* Process Update Entity Request */
@Override
- public <T> Object process(PutMergePatchUriInfo updateView,
+ public <T> Object process(final PutMergePatchUriInfo updateView,
final InputStream content, final String requestContentType)
throws ODataJPAModelException, ODataJPARuntimeException {
return processUpdate(updateView, content, null, requestContentType);
}
@Override
- public <T> Object process(PutMergePatchUriInfo updateView, Map<String, Object> content) throws ODataJPAModelException, ODataJPARuntimeException {
+ public <T> Object process(final PutMergePatchUriInfo updateView, final Map<String, Object> content)
+ throws ODataJPAModelException, ODataJPARuntimeException {
return processUpdate(updateView, null, content, null);
}
@SuppressWarnings("unchecked")
- private <T> List<T> processCreate(final PostUriInfo createView, final InputStream content, final Map<String, Object> properties,
+ private <T> List<T> processCreate(final PostUriInfo createView, final InputStream content,
+ final Map<String, Object> properties,
final String requestedContentType) throws ODataJPAModelException,
ODataJPARuntimeException {
try {
@@ -306,13 +310,13 @@ public class JPAProcessorImpl implements JPAProcessor {
if (content != null) {
final ODataEntityParser oDataEntityParser = new ODataEntityParser(oDataJPAContext);
- final ODataEntry oDataEntry = oDataEntityParser.parseEntry(oDataEntitySet, content, requestedContentType, false);
+ final ODataEntry oDataEntry =
+ oDataEntityParser.parseEntry(oDataEntitySet, content, requestedContentType, false);
virtualJPAEntity.create(oDataEntry);
JPALink link = new JPALink(oDataJPAContext);
link.setSourceJPAEntity(jpaEntity);
link.create(createView, content, requestedContentType, requestedContentType);
- }
- else if (properties != null) {
+ } else if (properties != null) {
virtualJPAEntity.create(properties);
} else {
return null;
@@ -338,7 +342,7 @@ public class JPAProcessorImpl implements JPAProcessor {
}
public <T> Object processUpdate(PutMergePatchUriInfo updateView,
- final InputStream content, Map<String, Object> properties, final String requestContentType)
+ final InputStream content, final Map<String, Object> properties, final String requestContentType)
throws ODataJPAModelException, ODataJPARuntimeException {
JPQLContextType contextType = null;
Object jpaEntity = null;
@@ -356,9 +360,10 @@ public class JPAProcessorImpl implements JPAProcessor {
jpaEntity = readEntity(updateView, contextType);
- if (jpaEntity == null)
+ if (jpaEntity == null) {
throw ODataJPARuntimeException
.throwException(ODataJPARuntimeException.RESOURCE_NOT_FOUND, null);
+ }
final EdmEntitySet oDataEntitySet = updateView.getTargetEntitySet();
final EdmEntityType oDataEntityType = oDataEntitySet.getEntityType();
@@ -369,11 +374,11 @@ public class JPAProcessorImpl implements JPAProcessor {
final ODataEntityParser oDataEntityParser = new ODataEntityParser(oDataJPAContext);
final ODataEntry oDataEntry = oDataEntityParser.parseEntry(oDataEntitySet, content, requestContentType, false);
virtualJPAEntity.update(oDataEntry);
- }
- else if (properties != null)
+ } else if (properties != null) {
virtualJPAEntity.update(properties);
- else
+ } else {
return null;
+ }
em.flush();
em.getTransaction().commit();
} catch (Exception e) {
@@ -451,7 +456,8 @@ public class JPAProcessorImpl implements JPAProcessor {
Object selectedObject = null;
- if (uriParserResultView instanceof DeleteUriInfo || uriParserResultView instanceof GetEntityUriInfo || uriParserResultView instanceof PutMergePatchUriInfo) {
+ if (uriParserResultView instanceof DeleteUriInfo || uriParserResultView instanceof GetEntityUriInfo
+ || uriParserResultView instanceof PutMergePatchUriInfo) {
JPQLContext selectJPQLContext = JPQLContext.createBuilder(
contextType, uriParserResultView).build();
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/model/EdmTypeConvertor.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/model/EdmTypeConvertor.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/model/EdmTypeConvertor.java
index ae9dcf0..f3c3e88 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/model/EdmTypeConvertor.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/model/EdmTypeConvertor.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.processor.core.jpa.access.model;
@@ -31,7 +31,8 @@ import org.apache.olingo.odata2.processor.api.jpa.exception.ODataJPARuntimeExcep
public class EdmTypeConvertor {
- public static Class<?> convertToJavaType(final EdmType edmType) throws ODataJPAModelException, ODataJPARuntimeException {
+ public static Class<?> convertToJavaType(final EdmType edmType) throws ODataJPAModelException,
+ ODataJPARuntimeException {
if (edmType instanceof EdmSimpleType) {
EdmSimpleType edmSimpleType = (EdmSimpleType) edmType;
if (edmSimpleType == EdmSimpleTypeKind.String.getEdmSimpleTypeInstance()) {
@@ -62,6 +63,7 @@ public class EdmTypeConvertor {
return UUID.class;
}
}
- throw ODataJPAModelException.throwException(ODataJPAModelException.TYPE_NOT_SUPPORTED.addContent(edmType.toString()), null);
+ throw ODataJPAModelException.throwException(ODataJPAModelException.TYPE_NOT_SUPPORTED
+ .addContent(edmType.toString()), null);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPAEdmMappingModelService.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPAEdmMappingModelService.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPAEdmMappingModelService.java
index 8d4d69e..8150631 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPAEdmMappingModelService.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPAEdmMappingModelService.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.processor.core.jpa.access.model;
@@ -172,7 +172,8 @@ public class JPAEdmMappingModelService implements JPAEdmMappingModelAccess {
}
private JPAEntityTypeMapType searchJPAEntityTypeMapType(final String jpaEntityTypeName) {
- for (JPAEntityTypeMapType jpaEntityType : mappingModel.getPersistenceUnit().getJPAEntityTypes().getJPAEntityType()) {
+ for (JPAEntityTypeMapType jpaEntityType : mappingModel.getPersistenceUnit().getJPAEntityTypes()
+ .getJPAEntityType()) {
if (jpaEntityType.getName().equals(jpaEntityTypeName)) {
return jpaEntityType;
}
@@ -182,7 +183,8 @@ public class JPAEdmMappingModelService implements JPAEdmMappingModelAccess {
}
private JPAEmbeddableTypeMapType searchJPAEmbeddableTypeMapType(final String jpaEmbeddableTypeName) {
- for (JPAEmbeddableTypeMapType jpaEmbeddableType : mappingModel.getPersistenceUnit().getJPAEmbeddableTypes().getJPAEmbeddableType()) {
+ for (JPAEmbeddableTypeMapType jpaEmbeddableType : mappingModel.getPersistenceUnit().getJPAEmbeddableTypes()
+ .getJPAEmbeddableType()) {
if (jpaEmbeddableType.getName().equals(jpaEmbeddableTypeName)) {
return jpaEmbeddableType;
}
@@ -230,7 +232,8 @@ public class JPAEdmMappingModelService implements JPAEdmMappingModelAccess {
}
@Override
- public boolean checkExclusionOfJPAEmbeddableAttributeType(final String jpaEmbeddableTypeName, final String jpaAttributeName) {
+ public boolean checkExclusionOfJPAEmbeddableAttributeType(final String jpaEmbeddableTypeName,
+ final String jpaAttributeName) {
JPAEmbeddableTypeMapType type = searchJPAEmbeddableTypeMapType(jpaEmbeddableTypeName);
if (type != null && type.getJPAAttributes() != null) {
for (JPAAttribute jpaAttribute : type.getJPAAttributes().getJPAAttribute()) {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPAEdmNameBuilder.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPAEdmNameBuilder.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPAEdmNameBuilder.java
index da9bff6..22bdc82 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPAEdmNameBuilder.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPAEdmNameBuilder.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.processor.core.jpa.access.model;
@@ -89,7 +89,7 @@ public class JPAEdmNameBuilder {
if (edmEntityTypeName == null) {
edmEntityTypeName = jpaEntityName;
}
- //Setting the mapping object
+ // Setting the mapping object
edmEntityType.setMapping(((Mapping) mapping).setInternalName(jpaEntityName));
edmEntityType.setName(edmEntityTypeName);
@@ -130,9 +130,13 @@ public class JPAEdmNameBuilder {
JPAEdmMappingModelAccess mappingModelAccess = view.getJPAEdmMappingModelAccess();
if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) {
if (isComplexMode) {
- propertyName = mappingModelAccess.mapJPAEmbeddableTypeAttribute(view.getJPAEdmComplexTypeView().getJPAEmbeddableType().getJavaType().getSimpleName(), jpaAttributeName);
+ propertyName =
+ mappingModelAccess.mapJPAEmbeddableTypeAttribute(view.getJPAEdmComplexTypeView().getJPAEmbeddableType()
+ .getJavaType().getSimpleName(), jpaAttributeName);
} else {
- propertyName = mappingModelAccess.mapJPAAttribute(view.getJPAEdmEntityTypeView().getJPAEntityType().getName(), jpaAttributeName);
+ propertyName =
+ mappingModelAccess.mapJPAAttribute(view.getJPAEdmEntityTypeView().getJPAEntityType().getName(),
+ jpaAttributeName);
}
}
if (propertyName == null) {
@@ -312,7 +316,8 @@ public class JPAEdmNameBuilder {
* EDM Association End Name - RULES
* ************************************************************************
*/
- public static void build(final JPAEdmAssociationEndView assocaitionEndView, final JPAEdmEntityTypeView entityTypeView, final JPAEdmPropertyView propertyView) {
+ public static void build(final JPAEdmAssociationEndView assocaitionEndView,
+ final JPAEdmEntityTypeView entityTypeView, final JPAEdmPropertyView propertyView) {
String namespace = buildNamespace(assocaitionEndView);
@@ -323,12 +328,13 @@ public class JPAEdmNameBuilder {
name = null;
String jpaEntityTypeName = null;
Attribute<?, ?> jpaAttribute = propertyView.getJPAAttribute();
- if (jpaAttribute.isCollection())
+ if (jpaAttribute.isCollection()) {
jpaEntityTypeName = ((PluralAttribute<?, ?, ?>) jpaAttribute).getElementType().getJavaType()
.getSimpleName();
- else
+ } else {
jpaEntityTypeName = propertyView.getJPAAttribute().getJavaType()
.getSimpleName();
+ }
JPAEdmMappingModelAccess mappingModelAccess = assocaitionEndView.getJPAEdmMappingModelAccess();
@@ -431,10 +437,11 @@ public class JPAEdmNameBuilder {
.getJPAEdmMappingModelAccess();
String targetEntityTypeName = null;
- if (jpaAttribute.isCollection())
+ if (jpaAttribute.isCollection()) {
targetEntityTypeName = ((PluralAttribute<?, ?, ?>) jpaAttribute).getElementType().getJavaType().getSimpleName();
- else
+ } else {
targetEntityTypeName = jpaAttribute.getJavaType().getSimpleName();
+ }
if (mappingModelAccess != null
&& mappingModelAccess.isMappingModelExists()) {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPATypeConvertor.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPATypeConvertor.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPATypeConvertor.java
index 6bb69b5..c24d587 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPATypeConvertor.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/access/model/JPATypeConvertor.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.processor.core.jpa.access.model;
@@ -33,8 +33,8 @@ import org.apache.olingo.odata2.processor.api.jpa.exception.ODataJPAModelExcepti
/**
* This class holds utility methods for Type conversions between JPA and OData Types.
*
- *
- *
+ *
+ *
*/
public class JPATypeConvertor {
@@ -44,15 +44,18 @@ public class JPATypeConvertor {
* Types.
*
* @param jpaType
- * The JPA Type input.
+ * The JPA Type input.
* @return The corresponding EdmSimpleTypeKind.
* @throws ODataJPAModelException
- * @throws ODataJPARuntimeException
+ * @throws org.apache.olingo.odata2.processor.api.jpa.exception.ODataJPARuntimeException
*
* @see EdmSimpleTypeKind
*/
- public static EdmSimpleTypeKind convertToEdmSimpleType(final Class<?> jpaType, final Attribute<?, ?> currentAttribute) throws ODataJPAModelException {
- if (jpaType.equals(String.class) || jpaType.equals(Character.class) || jpaType.equals(char.class) || jpaType.equals(char[].class) ||
+ public static EdmSimpleTypeKind
+ convertToEdmSimpleType(final Class<?> jpaType, final Attribute<?, ?> currentAttribute)
+ throws ODataJPAModelException {
+ if (jpaType.equals(String.class) || jpaType.equals(Character.class) || jpaType.equals(char.class)
+ || jpaType.equals(char[].class) ||
jpaType.equals(Character[].class)) {
return EdmSimpleTypeKind.String;
} else if (jpaType.equals(Long.class) || jpaType.equals(long.class)) {
@@ -77,7 +80,9 @@ public class JPATypeConvertor {
return EdmSimpleTypeKind.Boolean;
} else if ((jpaType.equals(Date.class)) || (jpaType.equals(Calendar.class))) {
try {
- if ((currentAttribute != null) && (currentAttribute.getDeclaringType().getJavaType().getDeclaredField(currentAttribute.getName()).getAnnotation(Temporal.class).value() == TemporalType.TIME)) {
+ if ((currentAttribute != null)
+ && (currentAttribute.getDeclaringType().getJavaType().getDeclaredField(currentAttribute.getName())
+ .getAnnotation(Temporal.class).value() == TemporalType.TIME)) {
return EdmSimpleTypeKind.Time;
} else {
return EdmSimpleTypeKind.DateTime;
@@ -90,6 +95,7 @@ public class JPATypeConvertor {
} else if (jpaType.equals(UUID.class)) {
return EdmSimpleTypeKind.Guid;
}
- throw ODataJPAModelException.throwException(ODataJPAModelException.TYPE_NOT_SUPPORTED.addContent(jpaType.toString()), null);
+ throw ODataJPAModelException.throwException(ODataJPAModelException.TYPE_NOT_SUPPORTED
+ .addContent(jpaType.toString()), null);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/edm/ODataJPAEdmProvider.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/edm/ODataJPAEdmProvider.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/edm/ODataJPAEdmProvider.java
index ecce1ad..e0014e5 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/edm/ODataJPAEdmProvider.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/edm/ODataJPAEdmProvider.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.processor.core.jpa.edm;
@@ -220,7 +220,8 @@ public class ODataJPAEdmProvider extends EdmProvider {
}
@Override
- public AssociationSet getAssociationSet(final String entityContainer, final FullQualifiedName association, final String sourceEntitySetName, final String sourceEntitySetRole) throws ODataException {
+ public AssociationSet getAssociationSet(final String entityContainer, final FullQualifiedName association,
+ final String sourceEntitySetName, final String sourceEntitySetRole) throws ODataException {
EntityContainer container = null;
if (!entityContainerInfos.containsKey(entityContainer)) {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/exception/ODataJPAMessageServiceDefault.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/exception/ODataJPAMessageServiceDefault.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/exception/ODataJPAMessageServiceDefault.java
index 72118da..d7f3964 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/exception/ODataJPAMessageServiceDefault.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/exception/ODataJPAMessageServiceDefault.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.processor.core.jpa.exception;
@@ -36,7 +36,8 @@ import org.apache.olingo.odata2.processor.core.jpa.ODataJPAContextImpl;
public class ODataJPAMessageServiceDefault implements ODataJPAMessageService {
private static final String BUNDLE_NAME = "jpaprocessor_msg"; //$NON-NLS-1$
- private static final Map<Locale, ODataJPAMessageService> LOCALE_2_MESSAGE_SERVICE = new HashMap<Locale, ODataJPAMessageService>();
+ private static final Map<Locale, ODataJPAMessageService> LOCALE_2_MESSAGE_SERVICE =
+ new HashMap<Locale, ODataJPAMessageService>();
private static final ResourceBundle defaultResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
private final ResourceBundle resourceBundle;
private final Locale lanLocale;
@@ -70,7 +71,8 @@ public class ODataJPAMessageServiceDefault implements ODataJPAMessageService {
} catch (MissingResourceException e) {
return "Missing message for key '" + key + "'!";
} catch (MissingFormatArgumentException e) {
- return "Missing replacement for place holder in value '" + value + "' for following arguments '" + Arrays.toString(contentAsArray) + "'!";
+ return "Missing replacement for place holder in value '" + value + "' for following arguments '"
+ + Arrays.toString(contentAsArray) + "'!";
}
}
@@ -82,7 +84,8 @@ public class ODataJPAMessageServiceDefault implements ODataJPAMessageService {
public static ODataJPAMessageService getInstance(final Locale locale) {
Locale acceptedLocale = Locale.ENGLISH;
- if ((ODataJPAContextImpl.getContextInThreadLocal() != null) && (ODataJPAContextImpl.getContextInThreadLocal().getAcceptableLanguages() != null)) {
+ if ((ODataJPAContextImpl.getContextInThreadLocal() != null)
+ && (ODataJPAContextImpl.getContextInThreadLocal().getAcceptableLanguages() != null)) {
List<Locale> acceptedLanguages = ODataJPAContextImpl.getContextInThreadLocal().getAcceptableLanguages();
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/factory/ODataJPAFactoryImpl.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/factory/ODataJPAFactoryImpl.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/factory/ODataJPAFactoryImpl.java
index 2f6da6e..2b14f9d 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/factory/ODataJPAFactoryImpl.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/factory/ODataJPAFactoryImpl.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.processor.core.jpa.factory;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLJoinSelectContext.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLJoinSelectContext.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLJoinSelectContext.java
index c84687f..6026464 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLJoinSelectContext.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLJoinSelectContext.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.processor.core.jpa.jpql;
@@ -100,7 +100,8 @@ public class JPQLJoinSelectContext extends JPQLSelectContext implements JPQLJoin
entityTypeName = entityType.getName();
}
- jpaOuterJoinClause = new JPAJoinClause(entityTypeName, entityAlias, null, null, joinCondition, JPAJoinClause.JOIN.INNER);
+ jpaOuterJoinClause =
+ new JPAJoinClause(entityTypeName, entityAlias, null, null, joinCondition, JPAJoinClause.JOIN.INNER);
jpaOuterJoinClauses.add(jpaOuterJoinClause);
@@ -110,9 +111,12 @@ public class JPQLJoinSelectContext extends JPQLSelectContext implements JPQLJoin
String relationShipAlias = generateRelationShipAlias();
- joinCondition = ODataExpressionParser.parseKeyPredicates(navigationSegment.getKeyPredicates(), relationShipAlias);
+ joinCondition =
+ ODataExpressionParser.parseKeyPredicates(navigationSegment.getKeyPredicates(), relationShipAlias);
- jpaOuterJoinClause = new JPAJoinClause(getFromEntityName(navigationProperty), entityAlias, getRelationShipName(navigationProperty), relationShipAlias, joinCondition, JPAJoinClause.JOIN.INNER);
+ jpaOuterJoinClause =
+ new JPAJoinClause(getFromEntityName(navigationProperty), entityAlias,
+ getRelationShipName(navigationProperty), relationShipAlias, joinCondition, JPAJoinClause.JOIN.INNER);
jpaOuterJoinClauses.add(jpaOuterJoinClause);
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLJoinSelectSingleContext.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLJoinSelectSingleContext.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLJoinSelectSingleContext.java
index bb385ca..c25eae9 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLJoinSelectSingleContext.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLJoinSelectSingleContext.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.processor.core.jpa.jpql;
@@ -87,7 +87,8 @@ public class JPQLJoinSelectSingleContext extends JPQLSelectSingleContext impleme
entityTypeName = entityType.getName();
}
- jpaOuterJoinClause = new JPAJoinClause(entityTypeName, entityAlias, null, null, joinCondition, JPAJoinClause.JOIN.INNER);
+ jpaOuterJoinClause =
+ new JPAJoinClause(entityTypeName, entityAlias, null, null, joinCondition, JPAJoinClause.JOIN.INNER);
jpaOuterJoinClauses.add(jpaOuterJoinClause);
@@ -97,9 +98,12 @@ public class JPQLJoinSelectSingleContext extends JPQLSelectSingleContext impleme
String relationShipAlias = generateRelationShipAlias();
- joinCondition = ODataExpressionParser.parseKeyPredicates(navigationSegment.getKeyPredicates(), relationShipAlias);
+ joinCondition =
+ ODataExpressionParser.parseKeyPredicates(navigationSegment.getKeyPredicates(), relationShipAlias);
- jpaOuterJoinClause = new JPAJoinClause(getFromEntityName(navigationProperty), entityAlias, getRelationShipName(navigationProperty), relationShipAlias, joinCondition, JPAJoinClause.JOIN.INNER);
+ jpaOuterJoinClause =
+ new JPAJoinClause(getFromEntityName(navigationProperty), entityAlias,
+ getRelationShipName(navigationProperty), relationShipAlias, joinCondition, JPAJoinClause.JOIN.INNER);
jpaOuterJoinClauses.add(jpaOuterJoinClause);
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLJoinSelectSingleStatementBuilder.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLJoinSelectSingleStatementBuilder.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLJoinSelectSingleStatementBuilder.java
index 41282de..fd06892 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLJoinSelectSingleStatementBuilder.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLJoinSelectSingleStatementBuilder.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.processor.core.jpa.jpql;
@@ -82,7 +82,8 @@ public class JPQLJoinSelectSingleStatementBuilder extends JPQLStatementBuilder {
joinCondition = joinClause.getJoinCondition();
if (joinCondition != null) {
- joinWhereCondition.append(JPQLStatement.DELIMITER.SPACE + JPQLStatement.Operator.AND + JPQLStatement.DELIMITER.SPACE);
+ joinWhereCondition.append(JPQLStatement.DELIMITER.SPACE + JPQLStatement.Operator.AND
+ + JPQLStatement.DELIMITER.SPACE);
joinWhereCondition.append(joinCondition);
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLJoinStatementBuilder.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLJoinStatementBuilder.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLJoinStatementBuilder.java
index afd09bf..57d0e28 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLJoinStatementBuilder.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLJoinStatementBuilder.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.processor.core.jpa.jpql;
@@ -52,12 +52,12 @@ public class JPQLJoinStatementBuilder extends JPQLStatementBuilder {
StringBuilder joinWhereCondition = null;
jpqlQuery.append(JPQLStatement.KEYWORD.SELECT).append(JPQLStatement.DELIMITER.SPACE);
- if (context.getType().equals(JPQLContextType.JOIN_COUNT)) {//$COUNT
+ if (context.getType().equals(JPQLContextType.JOIN_COUNT)) {// $COUNT
jpqlQuery.append(JPQLStatement.KEYWORD.COUNT).append(JPQLStatement.DELIMITER.SPACE);
jpqlQuery.append(JPQLStatement.DELIMITER.PARENTHESIS_LEFT).append(JPQLStatement.DELIMITER.SPACE);
jpqlQuery.append(context.getSelectExpression()).append(JPQLStatement.DELIMITER.SPACE);
jpqlQuery.append(JPQLStatement.DELIMITER.PARENTHESIS_RIGHT).append(JPQLStatement.DELIMITER.SPACE);
- } else { //Normal
+ } else { // Normal
jpqlQuery.append(context.getSelectExpression()).append(JPQLStatement.DELIMITER.SPACE);
}
@@ -93,7 +93,8 @@ public class JPQLJoinStatementBuilder extends JPQLStatementBuilder {
joinCondition = joinClause.getJoinCondition();
if (joinCondition != null) {
- joinWhereCondition.append(JPQLStatement.DELIMITER.SPACE + JPQLStatement.Operator.AND + JPQLStatement.DELIMITER.SPACE);
+ joinWhereCondition.append(JPQLStatement.DELIMITER.SPACE + JPQLStatement.Operator.AND
+ + JPQLStatement.DELIMITER.SPACE);
joinWhereCondition.append(joinCondition);
}
@@ -103,7 +104,8 @@ public class JPQLJoinStatementBuilder extends JPQLStatementBuilder {
}
String whereExpression = context.getWhereExpression();
if (whereExpression != null || joinWhereCondition.length() > 0) {
- jpqlQuery.append(JPQLStatement.DELIMITER.SPACE).append(JPQLStatement.KEYWORD.WHERE).append(JPQLStatement.DELIMITER.SPACE);
+ jpqlQuery.append(JPQLStatement.DELIMITER.SPACE).append(JPQLStatement.KEYWORD.WHERE).append(
+ JPQLStatement.DELIMITER.SPACE);
if (whereExpression != null) {
jpqlQuery.append(whereExpression);
if (joinWhereCondition != null) {
@@ -125,14 +127,16 @@ public class JPQLJoinStatementBuilder extends JPQLStatementBuilder {
while (orderItr.hasNext()) {
if (i != 0) {
- orderByBuilder.append(JPQLStatement.DELIMITER.SPACE).append(JPQLStatement.DELIMITER.COMMA).append(JPQLStatement.DELIMITER.SPACE);
+ orderByBuilder.append(JPQLStatement.DELIMITER.SPACE).append(JPQLStatement.DELIMITER.COMMA).append(
+ JPQLStatement.DELIMITER.SPACE);
}
Entry<String, String> entry = orderItr.next();
orderByBuilder.append(entry.getKey()).append(JPQLStatement.DELIMITER.SPACE);
orderByBuilder.append(entry.getValue());
i++;
}
- jpqlQuery.append(JPQLStatement.DELIMITER.SPACE).append(JPQLStatement.KEYWORD.ORDERBY).append(JPQLStatement.DELIMITER.SPACE);
+ jpqlQuery.append(JPQLStatement.DELIMITER.SPACE).append(JPQLStatement.KEYWORD.ORDERBY).append(
+ JPQLStatement.DELIMITER.SPACE);
jpqlQuery.append(orderByBuilder);
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLSelectContext.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLSelectContext.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLSelectContext.java
index a04804f..ef588aa 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLSelectContext.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLSelectContext.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.processor.core.jpa.jpql;
@@ -38,7 +38,7 @@ public class JPQLSelectContext extends JPQLContext implements JPQLSelectContextV
protected HashMap<String, String> orderByCollection;
protected String whereCondition;
- protected boolean isCountOnly = false;//Support for $count
+ protected boolean isCountOnly = false;// Support for $count
public JPQLSelectContext(final boolean isCountOnly) {
this.isCountOnly = isCountOnly;
@@ -71,7 +71,8 @@ public class JPQLSelectContext extends JPQLContext implements JPQLSelectContextV
return whereCondition;
}
- public class JPQLSelectContextBuilder extends org.apache.olingo.odata2.processor.api.jpa.jpql.JPQLContext.JPQLContextBuilder {
+ public class JPQLSelectContextBuilder extends
+ org.apache.olingo.odata2.processor.api.jpa.jpql.JPQLContext.JPQLContextBuilder {
protected GetEntitySetUriInfo entitySetView;
@@ -119,7 +120,7 @@ public class JPQLSelectContext extends JPQLContext implements JPQLSelectContextV
}
/*
- * Generate Select Clause
+ * Generate Select Clause
*/
protected String generateSelectExpression() throws EdmException {
return getJPAEntityAlias();
@@ -136,7 +137,8 @@ public class JPQLSelectContext extends JPQLContext implements JPQLSelectContextV
} else if (entitySetView.getTop() != null || entitySetView.getSkip() != null) {
- return ODataExpressionParser.parseKeyPropertiesToJPAOrderByExpression(entitySetView.getTargetEntitySet().getEntityType().getKeyProperties(), getJPAEntityAlias());
+ return ODataExpressionParser.parseKeyPropertiesToJPAOrderByExpression(entitySetView.getTargetEntitySet()
+ .getEntityType().getKeyProperties(), getJPAEntityAlias());
} else {
return null;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLSelectSingleContext.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLSelectSingleContext.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLSelectSingleContext.java
index b8e8323..9d2884d 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLSelectSingleContext.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLSelectSingleContext.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.processor.core.jpa.jpql;
@@ -54,7 +54,8 @@ public class JPQLSelectSingleContext extends JPQLContext implements JPQLSelectSi
return selectExpression;
}
- public class JPQLSelectSingleContextBuilder extends org.apache.olingo.odata2.processor.api.jpa.jpql.JPQLContext.JPQLContextBuilder {
+ public class JPQLSelectSingleContextBuilder extends
+ org.apache.olingo.odata2.processor.api.jpa.jpql.JPQLContext.JPQLContextBuilder {
protected GetEntityUriInfo entityView;
@@ -99,7 +100,7 @@ public class JPQLSelectSingleContext extends JPQLContext implements JPQLSelectSi
}
/*
- * Generate Select Clause
+ * Generate Select Clause
*/
protected String generateSelectExpression() throws EdmException {
return getJPAEntityAlias();
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLSelectSingleStatementBuilder.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLSelectSingleStatementBuilder.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLSelectSingleStatementBuilder.java
index 651024b..06e2444 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLSelectSingleStatementBuilder.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLSelectSingleStatementBuilder.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.processor.core.jpa.jpql;
@@ -55,7 +55,8 @@ public class JPQLSelectSingleStatementBuilder extends JPQLStatementBuilder {
if (context.getKeyPredicates() != null && context.getKeyPredicates().size() > 0) {
jpqlQuery.append(JPQLStatement.DELIMITER.SPACE);
jpqlQuery.append(JPQLStatement.KEYWORD.WHERE).append(JPQLStatement.DELIMITER.SPACE);
- jpqlQuery.append(ODataExpressionParser.parseKeyPredicates(context.getKeyPredicates(), context.getJPAEntityAlias()));
+ jpqlQuery.append(ODataExpressionParser
+ .parseKeyPredicates(context.getKeyPredicates(), context.getJPAEntityAlias()));
}
return jpqlQuery.toString();
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/02a598bd/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLSelectStatementBuilder.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLSelectStatementBuilder.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLSelectStatementBuilder.java
index 34d4a58..22059f1 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLSelectStatementBuilder.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/jpql/JPQLSelectStatementBuilder.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.processor.core.jpa.jpql;
@@ -51,12 +51,12 @@ public class JPQLSelectStatementBuilder extends JPQLStatementBuilder {
String fromClause = context.getJPAEntityName() + JPQLStatement.DELIMITER.SPACE + tableAlias;
jpqlQuery.append(JPQLStatement.KEYWORD.SELECT).append(JPQLStatement.DELIMITER.SPACE);
- if (context.getType().equals(JPQLContextType.SELECT_COUNT)) { //$COUNT
+ if (context.getType().equals(JPQLContextType.SELECT_COUNT)) { // $COUNT
jpqlQuery.append(JPQLStatement.KEYWORD.COUNT).append(JPQLStatement.DELIMITER.SPACE);
jpqlQuery.append(JPQLStatement.DELIMITER.PARENTHESIS_LEFT).append(JPQLStatement.DELIMITER.SPACE);
jpqlQuery.append(context.getSelectExpression()).append(JPQLStatement.DELIMITER.SPACE);
jpqlQuery.append(JPQLStatement.DELIMITER.PARENTHESIS_RIGHT).append(JPQLStatement.DELIMITER.SPACE);
- } else {//Normal
+ } else {// Normal
jpqlQuery.append(context.getSelectExpression()).append(JPQLStatement.DELIMITER.SPACE);
}
@@ -78,7 +78,8 @@ public class JPQLSelectStatementBuilder extends JPQLStatementBuilder {
while (orderItr.hasNext()) {
if (i != 0) {
- orderByBuilder.append(JPQLStatement.DELIMITER.SPACE).append(JPQLStatement.DELIMITER.COMMA).append(JPQLStatement.DELIMITER.SPACE);
+ orderByBuilder.append(JPQLStatement.DELIMITER.SPACE).append(JPQLStatement.DELIMITER.COMMA).append(
+ JPQLStatement.DELIMITER.SPACE);
}
Entry<String, String> entry = orderItr.next();
orderByBuilder.append(entry.getKey()).append(JPQLStatement.DELIMITER.SPACE);