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:17 UTC
[55/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/model/JPAEdmAssociation.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmAssociation.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmAssociation.java
index 9f0a9e7..1675828 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmAssociation.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmAssociation.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.model;
@@ -47,7 +47,8 @@ public class JPAEdmAssociation extends JPAEdmBaseViewImpl implements JPAEdmAssoc
private List<JPAEdmReferentialConstraintView> inconsistentRefConstraintViewList;
private int numberOfSimilarEndPoints;
- public JPAEdmAssociation(final JPAEdmAssociationEndView associationEndview, final JPAEdmEntityTypeView entityTypeView, final JPAEdmPropertyView propertyView, final int value) {
+ public JPAEdmAssociation(final JPAEdmAssociationEndView associationEndview,
+ final JPAEdmEntityTypeView entityTypeView, final JPAEdmPropertyView propertyView, final int value) {
super(associationEndview);
associationEndView = associationEndview;
numberOfSimilarEndPoints = value;
@@ -93,8 +94,11 @@ public class JPAEdmAssociation extends JPAEdmBaseViewImpl implements JPAEdmAssoc
if (association != null) {
if (view.compare(association.getEnd1(), association.getEnd2())) {
JPAEdmAssociationEndView associationEnd = associationEndMap.get(association.getName());
- if (associationEnd.getJoinColumnName() != null && associationEnd.getJoinColumnReferenceColumnName() != null && view.getJoinColumnName() != null && view.getJoinColumnReferenceColumnName() != null) {
- if (view.getJoinColumnName().equals(associationEnd.getJoinColumnName()) && view.getJoinColumnReferenceColumnName().equals(associationEnd.getJoinColumnReferenceColumnName())) {
+ if (associationEnd.getJoinColumnName() != null && associationEnd.getJoinColumnReferenceColumnName() != null
+ && view.getJoinColumnName() != null && view.getJoinColumnReferenceColumnName() != null) {
+ if (view.getJoinColumnName().equals(associationEnd.getJoinColumnName())
+ && view.getJoinColumnReferenceColumnName()
+ .equals(associationEnd.getJoinColumnReferenceColumnName())) {
currentAssociation = association;
return association;
}
@@ -120,7 +124,8 @@ public class JPAEdmAssociation extends JPAEdmBaseViewImpl implements JPAEdmAssoc
}
@Override
- public void addJPAEdmAssociationView(final JPAEdmAssociationView associationView, final JPAEdmAssociationEndView associationEndView) {
+ public void addJPAEdmAssociationView(final JPAEdmAssociationView associationView,
+ final JPAEdmAssociationEndView associationEndView) {
if (associationView != null) {
currentAssociation = associationView.getEdmAssociation();
associationMap.put(currentAssociation.getName(), currentAssociation);
@@ -218,7 +223,10 @@ public class JPAEdmAssociation extends JPAEdmBaseViewImpl implements JPAEdmAssoc
if (association != null) {
end1 = association.getEnd1();
end2 = association.getEnd2();
- if ((end1.getType().equals(currentAssociationEnd1.getType()) && end2.getType().equals(currentAssociationEnd2.getType())) || (end1.getType().equals(currentAssociationEnd2.getType()) && end2.getType().equals(currentAssociationEnd1.getType()))) {
+ if ((end1.getType().equals(currentAssociationEnd1.getType()) && end2.getType().equals(
+ currentAssociationEnd2.getType()))
+ || (end1.getType().equals(currentAssociationEnd2.getType()) && end2.getType().equals(
+ currentAssociationEnd1.getType()))) {
count++;
}
}
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/model/JPAEdmAssociationEnd.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmAssociationEnd.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmAssociationEnd.java
index 23e8e49..1b648ae 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmAssociationEnd.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmAssociationEnd.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.model;
@@ -146,7 +146,14 @@ public class JPAEdmAssociationEnd extends JPAEdmBaseViewImpl implements JPAEdmAs
@Override
public boolean compare(final AssociationEnd end1, final AssociationEnd end2) {
- if ((end1.getType().equals(currentAssociationEnd1.getType()) && end2.getType().equals(currentAssociationEnd2.getType()) && end1.getMultiplicity().equals(currentAssociationEnd1.getMultiplicity()) && end2.getMultiplicity().equals(currentAssociationEnd2.getMultiplicity())) || (end1.getType().equals(currentAssociationEnd2.getType()) && end2.getType().equals(currentAssociationEnd1.getType()) && end1.getMultiplicity().equals(currentAssociationEnd2.getMultiplicity()) && end2.getMultiplicity().equals(currentAssociationEnd1.getMultiplicity()))) {
+ if ((end1.getType().equals(currentAssociationEnd1.getType())
+ && end2.getType().equals(currentAssociationEnd2.getType())
+ && end1.getMultiplicity().equals(currentAssociationEnd1.getMultiplicity()) && end2.getMultiplicity().equals(
+ currentAssociationEnd2.getMultiplicity()))
+ || (end1.getType().equals(currentAssociationEnd2.getType())
+ && end2.getType().equals(currentAssociationEnd1.getType())
+ && end1.getMultiplicity().equals(currentAssociationEnd2.getMultiplicity()) && end2.getMultiplicity()
+ .equals(currentAssociationEnd1.getMultiplicity()))) {
return true;
}
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/model/JPAEdmAssociationSet.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmAssociationSet.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmAssociationSet.java
index 52ebe72..925a497 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmAssociationSet.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmAssociationSet.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.model;
@@ -88,7 +88,8 @@ public class JPAEdmAssociationSet extends JPAEdmBaseViewImpl implements JPAEdmAs
currentAssociation = association;
- FullQualifiedName fQname = new FullQualifiedName(schemaView.getEdmSchema().getNamespace(), association.getName());
+ FullQualifiedName fQname =
+ new FullQualifiedName(schemaView.getEdmSchema().getNamespace(), association.getName());
currentAssociationSet = new AssociationSet();
currentAssociationSet.setAssociation(fQname);
@@ -97,7 +98,8 @@ public class JPAEdmAssociationSet extends JPAEdmBaseViewImpl implements JPAEdmAs
for (EntitySet entitySet : entitySetList) {
fQname = entitySet.getEntityType();
endFlag = 0;
- if (fQname.equals(association.getEnd1().getType()) || ++endFlag > 1 || fQname.equals(association.getEnd2().getType())) {
+ if (fQname.equals(association.getEnd1().getType()) || ++endFlag > 1
+ || fQname.equals(association.getEnd2().getType())) {
AssociationSetEnd end = new AssociationSetEnd();
end.setEntitySet(entitySet.getName());
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/model/JPAEdmBaseViewImpl.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmBaseViewImpl.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmBaseViewImpl.java
index 1524402..0485bb1 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmBaseViewImpl.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmBaseViewImpl.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.model;
@@ -46,7 +46,8 @@ public abstract class JPAEdmBaseViewImpl implements JPAEdmBaseView {
public JPAEdmBaseViewImpl(final ODataJPAContext context) {
pUnitName = context.getPersistenceUnitName();
metaModel = context.getEntityManagerFactory().getMetamodel();
- jpaEdmMappingModelAccess = ODataJPAFactory.createFactory().getJPAAccessFactory().getJPAEdmMappingModelAccess(context);
+ jpaEdmMappingModelAccess =
+ ODataJPAFactory.createFactory().getJPAAccessFactory().getJPAEdmMappingModelAccess(context);
jpaEdmExtension = context.getJPAEdmExtension();
jpaEdmMappingModelAccess.loadMappingModel();
}
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/model/JPAEdmComplexType.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmComplexType.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmComplexType.java
index 025d101..ad25a1b 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmComplexType.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmComplexType.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.model;
@@ -128,7 +128,8 @@ public class JPAEdmComplexType extends JPAEdmBaseViewImpl implements JPAEdmCompl
}
@Override
- public void expandEdmComplexType(final ComplexType complexType, List<Property> expandedList, final String embeddablePropertyName) {
+ public void expandEdmComplexType(final ComplexType complexType, List<Property> expandedList,
+ final String embeddablePropertyName) {
if (expandedList == null) {
expandedList = new ArrayList<Property>();
@@ -171,13 +172,13 @@ public class JPAEdmComplexType extends JPAEdmBaseViewImpl implements JPAEdmCompl
* The Complex Type is created only if it is not created
* earlier. A local buffer is maintained to track the list
* of complex types created.
- *
+ *
* ************************************************************
- * Build EDM Complex Type - STEPS
+ * Build EDM Complex Type - STEPS
* ************************************************************
* 1) Fetch list of embeddable types from JPA Model
- * 2) Search local buffer if there exists already a Complex
- * type for the embeddable type.
+ * 2) Search local buffer if there exists already a Complex
+ * type for the embeddable type.
* 3) If the complex type was already been built continue with
* the next embeddable type, else create new EDM Complex Type.
* 4) Create a Property view with Complex Type
@@ -188,9 +189,8 @@ public class JPAEdmComplexType extends JPAEdmBaseViewImpl implements JPAEdmCompl
* 7) Provide name for EDM complex type.
*
* ************************************************************
- * Build EDM Complex Type - STEPS
+ * Build EDM Complex Type - STEPS
* ************************************************************
- *
*/
@Override
public void build() throws ODataJPAModelException, ODataJPARuntimeException {
@@ -241,7 +241,10 @@ public class JPAEdmComplexType extends JPAEdmBaseViewImpl implements JPAEdmCompl
private boolean isExcluded(final JPAEdmComplexType jpaEdmComplexType) {
JPAEdmMappingModelAccess mappingModelAccess = jpaEdmComplexType.getJPAEdmMappingModelAccess();
- if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists() && mappingModelAccess.checkExclusionOfJPAEmbeddableType(jpaEdmComplexType.getJPAEmbeddableType().getJavaType().getSimpleName())) {
+ if (mappingModelAccess != null
+ && mappingModelAccess.isMappingModelExists()
+ && mappingModelAccess.checkExclusionOfJPAEmbeddableType(jpaEdmComplexType.getJPAEmbeddableType()
+ .getJavaType().getSimpleName())) {
return true;
}
return false;
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/model/JPAEdmEntityContainer.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmEntityContainer.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmEntityContainer.java
index 8af8f6b..fee40c2 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmEntityContainer.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmEntityContainer.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.model;
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/model/JPAEdmEntitySet.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmEntitySet.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmEntitySet.java
index 4f52d7d..9e5248f 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmEntitySet.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmEntitySet.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.model;
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/model/JPAEdmEntityType.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmEntityType.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmEntityType.java
index 9c158a9..5864a1c 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmEntityType.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmEntityType.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.model;
@@ -112,7 +112,8 @@ public class JPAEdmEntityType extends JPAEdmBaseViewImpl implements JPAEdmEntity
currentEdmEntityType.setProperties(propertyView.getEdmPropertyList());
if (propertyView.getJPAEdmNavigationPropertyView() != null) {
JPAEdmNavigationPropertyView navPropView = propertyView.getJPAEdmNavigationPropertyView();
- if (navPropView.getConsistentEdmNavigationProperties() != null && !navPropView.getConsistentEdmNavigationProperties().isEmpty()) {
+ if (navPropView.getConsistentEdmNavigationProperties() != null
+ && !navPropView.getConsistentEdmNavigationProperties().isEmpty()) {
currentEdmEntityType.setNavigationProperties(navPropView.getConsistentEdmNavigationProperties());
}
}
@@ -127,7 +128,8 @@ public class JPAEdmEntityType extends JPAEdmBaseViewImpl implements JPAEdmEntity
private boolean isExcluded(final JPAEdmEntityType jpaEdmEntityType) {
JPAEdmMappingModelAccess mappingModelAccess = jpaEdmEntityType.getJPAEdmMappingModelAccess();
- if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists() && mappingModelAccess.checkExclusionOfJPAEntityType(jpaEdmEntityType.getJPAEntityType().getName())) {
+ if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()
+ && mappingModelAccess.checkExclusionOfJPAEntityType(jpaEdmEntityType.getJPAEntityType().getName())) {
return true;
}
return false;
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/model/JPAEdmFacets.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmFacets.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmFacets.java
index 56e8850..61f984f 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmFacets.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmFacets.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.model;
@@ -39,8 +39,10 @@ public class JPAEdmFacets {
.getJavaMember()).getAnnotation(Column.class);
}
- if (column == null) return;
-
+ if (column == null) {
+ return;
+ }
+
setNullable(column, edmProperty);
switch (edmTypeKind) {
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/model/JPAEdmFunctionImport.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmFunctionImport.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmFunctionImport.java
index ab89ce9..62fcaae 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmFunctionImport.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmFunctionImport.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.model;
@@ -82,7 +82,8 @@ public class JPAEdmFunctionImport extends JPAEdmBaseViewImpl implements JPAEdmFu
HashMap<Class<?>, String[]> customOperations = schemaView.getRegisteredOperations();
- jpaEdmEntityTypeView = schemaView.getJPAEdmEntityContainerView().getJPAEdmEntitySetView().getJPAEdmEntityTypeView();
+ jpaEdmEntityTypeView =
+ schemaView.getJPAEdmEntityContainerView().getJPAEdmEntitySetView().getJPAEdmEntityTypeView();
jpaEdmComplexTypeView = schemaView.getJPAEdmComplexTypeView();
if (customOperations != null) {
@@ -136,7 +137,8 @@ public class JPAEdmFunctionImport extends JPAEdmBaseViewImpl implements JPAEdmFu
private FunctionImport buildFunctionImport(final Method method) throws ODataJPAModelException {
- org.apache.olingo.odata2.api.annotation.edm.FunctionImport annotation = method.getAnnotation(org.apache.olingo.odata2.api.annotation.edm.FunctionImport.class);
+ org.apache.olingo.odata2.api.annotation.edm.FunctionImport annotation =
+ method.getAnnotation(org.apache.olingo.odata2.api.annotation.edm.FunctionImport.class);
if (annotation != null && annotation.returnType() != ReturnType.NONE) {
FunctionImport functionImport = new FunctionImport();
@@ -161,7 +163,8 @@ public class JPAEdmFunctionImport extends JPAEdmBaseViewImpl implements JPAEdmFu
return null;
}
- private void buildParameter(final FunctionImport functionImport, final Method method) throws ODataJPAModelException {
+ private void buildParameter(final FunctionImport functionImport, final Method method)
+ throws ODataJPAModelException {
Annotation[][] annotations = method.getParameterAnnotations();
Class<?>[] parameterTypes = method.getParameterTypes();
@@ -176,7 +179,8 @@ public class JPAEdmFunctionImport extends JPAEdmBaseViewImpl implements JPAEdmFu
Parameter annotation = (Parameter) element;
FunctionImportParameter functionImportParameter = new FunctionImportParameter();
if (annotation.name().equals("")) {
- throw ODataJPAModelException.throwException(ODataJPAModelException.FUNC_PARAM_NAME_EXP.addContent(method.getDeclaringClass().getName(), method.getName()), null);
+ throw ODataJPAModelException.throwException(ODataJPAModelException.FUNC_PARAM_NAME_EXP.addContent(method
+ .getDeclaringClass().getName(), method.getName()), null);
} else {
functionImportParameter.setName(annotation.name());
}
@@ -214,12 +218,14 @@ public class JPAEdmFunctionImport extends JPAEdmBaseViewImpl implements JPAEdmFu
}
}
- private void buildReturnType(final FunctionImport functionImport, final Method method, final org.apache.olingo.odata2.api.annotation.edm.FunctionImport annotation) throws ODataJPAModelException {
+ private void buildReturnType(final FunctionImport functionImport, final Method method,
+ final org.apache.olingo.odata2.api.annotation.edm.FunctionImport annotation) throws ODataJPAModelException {
ReturnType returnType = annotation.returnType();
Multiplicity multiplicity = null;
if (returnType != ReturnType.NONE) {
- org.apache.olingo.odata2.api.edm.provider.ReturnType functionReturnType = new org.apache.olingo.odata2.api.edm.provider.ReturnType();
+ org.apache.olingo.odata2.api.edm.provider.ReturnType functionReturnType =
+ new org.apache.olingo.odata2.api.edm.provider.ReturnType();
multiplicity = annotation.multiplicity();
if (multiplicity == Multiplicity.MANY) {
@@ -238,7 +244,8 @@ public class JPAEdmFunctionImport extends JPAEdmBaseViewImpl implements JPAEdmFu
Class<?> methodReturnType = method.getReturnType();
if (methodReturnType == null || methodReturnType.getName().equals("void")) {
- throw ODataJPAModelException.throwException(ODataJPAModelException.FUNC_RETURN_TYPE_EXP.addContent(method.getDeclaringClass(), method.getName()), null);
+ throw ODataJPAModelException.throwException(ODataJPAModelException.FUNC_RETURN_TYPE_EXP.addContent(method
+ .getDeclaringClass(), method.getName()), null);
}
switch (returnType) {
case ENTITY_TYPE:
@@ -250,7 +257,8 @@ public class JPAEdmFunctionImport extends JPAEdmBaseViewImpl implements JPAEdmFu
}
if (edmEntityType == null) {
- throw ODataJPAModelException.throwException(ODataJPAModelException.FUNC_RETURN_TYPE_ENTITY_NOT_FOUND.addContent(method.getDeclaringClass(), method.getName(), methodReturnType.getSimpleName()), null);
+ throw ODataJPAModelException.throwException(ODataJPAModelException.FUNC_RETURN_TYPE_ENTITY_NOT_FOUND
+ .addContent(method.getDeclaringClass(), method.getName(), methodReturnType.getSimpleName()), null);
}
functionReturnType.setTypeName(JPAEdmNameBuilder.build(schemaView, edmEntityType.getName()));
break;
@@ -268,7 +276,8 @@ public class JPAEdmFunctionImport extends JPAEdmBaseViewImpl implements JPAEdmFu
complexType = jpaEdmComplexTypeView.searchEdmComplexType(getReturnTypeName(method));
}
if (complexType == null) {
- throw ODataJPAModelException.throwException(ODataJPAModelException.FUNC_RETURN_TYPE_ENTITY_NOT_FOUND.addContent(method.getDeclaringClass(), method.getName(), methodReturnType.getSimpleName()), null);
+ throw ODataJPAModelException.throwException(ODataJPAModelException.FUNC_RETURN_TYPE_ENTITY_NOT_FOUND
+ .addContent(method.getDeclaringClass(), method.getName(), methodReturnType.getSimpleName()), null);
}
functionReturnType.setTypeName(JPAEdmNameBuilder.build(schemaView, complexType.getName()));
break;
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/model/JPAEdmKey.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmKey.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmKey.java
index cfe47fc..15cd26e 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmKey.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmKey.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.model;
@@ -85,7 +85,8 @@ public class JPAEdmKey extends JPAEdmBaseViewImpl implements JPAEdmKeyView {
}
if (isBuildModeComplexType) {
- ComplexType complexType = complexTypeView.searchEdmComplexType(propertyView.getJPAAttribute().getJavaType().getName());
+ ComplexType complexType =
+ complexTypeView.searchEdmComplexType(propertyView.getJPAAttribute().getJavaType().getName());
normalizeComplexKey(complexType, propertyRefList);
} else {
PropertyRef propertyRef = new PropertyRef();
@@ -101,7 +102,7 @@ public class JPAEdmKey extends JPAEdmBaseViewImpl implements JPAEdmKeyView {
}
- //TODO think how to stop the recursion if A includes B and B includes A!!!!!!
+ // TODO think how to stop the recursion if A includes B and B includes A!!!!!!
public void normalizeComplexKey(final ComplexType complexType, final List<PropertyRef> propertyRefList) {
for (Property property : complexType.getProperties()) {
try {
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/model/JPAEdmMappingImpl.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmMappingImpl.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmMappingImpl.java
index cc40fad..99d9f5f 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmMappingImpl.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmMappingImpl.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.model;
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/model/JPAEdmModel.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmModel.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmModel.java
index a307fa1..fac5614 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmModel.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmModel.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.model;
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/model/JPAEdmNavigationProperty.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmNavigationProperty.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmNavigationProperty.java
index 7224bc6..6070b31 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmNavigationProperty.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmNavigationProperty.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.model;
@@ -38,7 +38,8 @@ public class JPAEdmNavigationProperty extends JPAEdmBaseViewImpl implements JPAE
private List<NavigationProperty> consistentNavigationProperties = null;
private int count;
- public JPAEdmNavigationProperty(final JPAEdmAssociationView associationView, final JPAEdmPropertyView propertyView, final int countNumber) {
+ public JPAEdmNavigationProperty(final JPAEdmAssociationView associationView, final JPAEdmPropertyView propertyView,
+ final int countNumber) {
super(associationView);
this.associationView = associationView;
this.propertyView = propertyView;
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/model/JPAEdmProperty.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmProperty.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmProperty.java
index def45db..28cc7ce 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmProperty.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmProperty.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.model;
@@ -123,15 +123,14 @@ public class JPAEdmProperty extends JPAEdmBaseViewImpl implements
}
@Override
- public JPAEdmNavigationPropertyView getJPAEdmNavigationPropertyView()
- {
+ public JPAEdmNavigationPropertyView getJPAEdmNavigationPropertyView() {
return navigationPropertyView;
}
private class JPAEdmPropertyBuilder implements JPAEdmBuilder {
/*
*
- * Each call to build method creates a new EDM Property List.
+ * Each call to build method creates a new EDM Property List.
* The Property List can be created either by an Entity type or
* ComplexType. The flag isBuildModeComplexType tells if the
* Properties are built for complex type or for Entity Type.
@@ -144,28 +143,27 @@ public class JPAEdmProperty extends JPAEdmBaseViewImpl implements
* by Schema.
*
* Building Properties is divided into four parts
- * A) Building Simple Properties
- * B) Building Complex Properties
- * C) Building Associations
- * D) Building Navigation Properties
- *
+ * A) Building Simple Properties
+ * B) Building Complex Properties
+ * C) Building Associations
+ * D) Building Navigation Properties
+ *
* ************************************************************
- * Build EDM Schema - STEPS
+ * Build EDM Schema - STEPS
* ************************************************************
- * A) Building Simple Properties:
+ * A) Building Simple Properties:
*
- * 1) Fetch JPA Attribute List from
- * A) Complex Type
- * B) Entity Type
- * depending on isBuildModeComplexType.
+ * 1) Fetch JPA Attribute List from
+ * A) Complex Type
+ * B) Entity Type
+ * depending on isBuildModeComplexType.
* B) Building Complex Properties
* C) Building Associations
* D) Building Navigation Properties
-
+ *
* ************************************************************
- * Build EDM Schema - STEPS
+ * Build EDM Schema - STEPS
* ************************************************************
- *
*/
@Override
public void build() throws ODataJPAModelException, ODataJPARuntimeException {
@@ -192,7 +190,7 @@ public class JPAEdmProperty extends JPAEdmBaseViewImpl implements
for (Object jpaAttribute : jpaAttributes) {
currentAttribute = (Attribute<?, ?>) jpaAttribute;
- // Check for need to Exclude
+ // Check for need to Exclude
if (isExcluded((JPAEdmPropertyView) JPAEdmProperty.this, entityTypeName, currentAttribute.getName())) {
continue;
}
@@ -250,8 +248,7 @@ public class JPAEdmProperty extends JPAEdmBaseViewImpl implements
}
keyView.getBuilder().build();
complexTypeView.expandEdmComplexType(complexType, properties, currentAttribute.getName());
- }
- else {
+ } else {
currentComplexProperty = new ComplexProperty();
if (isBuildModeComplexType) {
JPAEdmNameBuilder
@@ -285,7 +282,8 @@ public class JPAEdmProperty extends JPAEdmBaseViewImpl implements
JPAEdmAssociationView associationView = schemaView.getJPAEdmAssociationView();
if (associationView.searchAssociation(associationEndView) == null) {
int count = associationView.getNumberOfAssociationsWithSimilarEndPoints(associationEndView);
- JPAEdmAssociationView associationViewLocal = new JPAEdmAssociation(associationEndView, entityTypeView, JPAEdmProperty.this, count);
+ JPAEdmAssociationView associationViewLocal =
+ new JPAEdmAssociation(associationEndView, entityTypeView, JPAEdmProperty.this, count);
associationViewLocal.getBuilder().build();
associationView.addJPAEdmAssociationView(associationViewLocal, associationEndView);
}
@@ -298,17 +296,17 @@ public class JPAEdmProperty extends JPAEdmBaseViewImpl implements
associationView.addJPAEdmRefConstraintView(refConstraintView);
}
- if (navigationPropertyView == null)
- {
+ if (navigationPropertyView == null) {
navigationPropertyView = new JPAEdmNavigationProperty(schemaView);
}
currentEntityName = entityTypeView.getJPAEntityType().getName();
- if (currentAttribute.isCollection())
+ if (currentAttribute.isCollection()) {
targetEntityName = ((PluralAttribute<?, ?, ?>) currentAttribute).getElementType().getJavaType()
.getSimpleName();
- else
+ } else {
targetEntityName = currentAttribute.getJavaType().getSimpleName();
+ }
Integer sequenceNumber = associationCount.get(currentEntityName + targetEntityName);
if (sequenceNumber == null) {
sequenceNumber = new Integer(1);
@@ -316,7 +314,8 @@ public class JPAEdmProperty extends JPAEdmBaseViewImpl implements
sequenceNumber = new Integer(sequenceNumber.intValue() + 1);
}
associationCount.put(currentEntityName + targetEntityName, sequenceNumber);
- JPAEdmNavigationPropertyView localNavigationPropertyView = new JPAEdmNavigationProperty(associationView, JPAEdmProperty.this, sequenceNumber.intValue());
+ JPAEdmNavigationPropertyView localNavigationPropertyView =
+ new JPAEdmNavigationProperty(associationView, JPAEdmProperty.this, sequenceNumber.intValue());
localNavigationPropertyView.getBuilder().build();
navigationPropertyView.addJPAEdmNavigationPropertyView(localNavigationPropertyView);
break;
@@ -359,15 +358,18 @@ public class JPAEdmProperty extends JPAEdmBaseViewImpl implements
return complexTypeView;
}
- private boolean isExcluded(final JPAEdmPropertyView jpaEdmPropertyView, final String jpaEntityTypeName, final String jpaAttributeName) {
+ private boolean isExcluded(final JPAEdmPropertyView jpaEdmPropertyView, final String jpaEntityTypeName,
+ final String jpaAttributeName) {
JPAEdmMappingModelAccess mappingModelAccess = jpaEdmPropertyView
.getJPAEdmMappingModelAccess();
boolean isExcluded = false;
if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) {
// Exclusion of a simple property in a complex type
- if (isBuildModeComplexType && mappingModelAccess.checkExclusionOfJPAEmbeddableAttributeType(jpaEntityTypeName, jpaAttributeName)
+ if (isBuildModeComplexType
+ && mappingModelAccess.checkExclusionOfJPAEmbeddableAttributeType(jpaEntityTypeName, jpaAttributeName)
// Exclusion of a simple property of an Entity Type
- || (!isBuildModeComplexType && mappingModelAccess.checkExclusionOfJPAAttributeType(jpaEntityTypeName, jpaAttributeName))) {
+ || (!isBuildModeComplexType && mappingModelAccess.checkExclusionOfJPAAttributeType(jpaEntityTypeName,
+ jpaAttributeName))) {
isExcluded = true;
}
}
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/model/JPAEdmReferentialConstraint.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmReferentialConstraint.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmReferentialConstraint.java
index 850e473..2888a9a 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmReferentialConstraint.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmReferentialConstraint.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.model;
@@ -47,7 +47,8 @@ public class JPAEdmReferentialConstraint extends JPAEdmBaseViewImpl implements J
private String relationShipName;
- public JPAEdmReferentialConstraint(final JPAEdmAssociationView associationView, final JPAEdmEntityTypeView entityTypeView, final JPAEdmPropertyView propertyView) {
+ public JPAEdmReferentialConstraint(final JPAEdmAssociationView associationView,
+ final JPAEdmEntityTypeView entityTypeView, final JPAEdmPropertyView propertyView) {
super(associationView);
this.associationView = associationView;
this.propertyView = propertyView;
@@ -127,10 +128,12 @@ public class JPAEdmReferentialConstraint extends JPAEdmBaseViewImpl implements J
firstBuild = false;
if (principalRoleView == null && dependentRoleView == null) {
- principalRoleView = new JPAEdmReferentialConstraintRole(RoleType.PRINCIPAL, entityTypeView, propertyView, associationView);
+ principalRoleView =
+ new JPAEdmReferentialConstraintRole(RoleType.PRINCIPAL, entityTypeView, propertyView, associationView);
principalRoleView.getBuilder().build();
- dependentRoleView = new JPAEdmReferentialConstraintRole(RoleType.DEPENDENT, entityTypeView, propertyView, associationView);
+ dependentRoleView =
+ new JPAEdmReferentialConstraintRole(RoleType.DEPENDENT, entityTypeView, propertyView, associationView);
dependentRoleView.getBuilder().build();
if (referentialConstraint == 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/model/JPAEdmReferentialConstraintRole.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmReferentialConstraintRole.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmReferentialConstraintRole.java
index 75a803b..3761d4b 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmReferentialConstraintRole.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmReferentialConstraintRole.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.model;
@@ -66,7 +66,9 @@ public class JPAEdmReferentialConstraintRole extends JPAEdmBaseViewImpl implemen
private JPAEdmRefConstraintRoleBuilder builder;
private ReferentialConstraintRole currentRole;
- public JPAEdmReferentialConstraintRole(final JPAEdmReferentialConstraintRoleView.RoleType roleType, final JPAEdmEntityTypeView entityTypeView, final JPAEdmPropertyView propertyView, final JPAEdmAssociationView associationView) {
+ public JPAEdmReferentialConstraintRole(final JPAEdmReferentialConstraintRoleView.RoleType roleType,
+ final JPAEdmEntityTypeView entityTypeView, final JPAEdmPropertyView propertyView,
+ final JPAEdmAssociationView associationView) {
super(entityTypeView);
this.entityTypeView = entityTypeView;
@@ -167,15 +169,16 @@ public class JPAEdmReferentialConstraintRole extends JPAEdmBaseViewImpl implemen
if (roleType == RoleType.PRINCIPAL) {
jpaAttributeType = jpaAttribute.getJavaType().getSimpleName();
if (jpaAttributeType.equals("List")) {
- Type type = ((ParameterizedType) jpaAttribute.getJavaMember().getDeclaringClass().getDeclaredField(jpaAttribute.getName()).getGenericType()).getActualTypeArguments()[0];
+ Type type =
+ ((ParameterizedType) jpaAttribute.getJavaMember().getDeclaringClass().getDeclaredField(
+ jpaAttribute.getName()).getGenericType()).getActualTypeArguments()[0];
int lastIndexOfDot = type.toString().lastIndexOf(".");
jpaAttributeType = type.toString().substring(lastIndexOfDot + 1);
}
edmEntityType = entityTypeView.searchEdmEntityType(jpaAttributeType);
- }
-
- else if (roleType == RoleType.DEPENDENT) {
- edmEntityType = entityTypeView.searchEdmEntityType(jpaAttribute.getDeclaringType().getJavaType().getSimpleName());
+ } else if (roleType == RoleType.DEPENDENT) {
+ edmEntityType =
+ entityTypeView.searchEdmEntityType(jpaAttribute.getDeclaringType().getJavaType().getSimpleName());
}
List<PropertyRef> propertyRefs = new ArrayList<PropertyRef>();
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/model/JPAEdmSchema.java
----------------------------------------------------------------------
diff --git a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmSchema.java b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmSchema.java
index b073d65..b9ded8b 100644
--- a/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmSchema.java
+++ b/jpa-core/src/main/java/org/apache/olingo/odata2/processor/core/jpa/model/JPAEdmSchema.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.model;
@@ -146,7 +146,7 @@ public class JPAEdmSchema extends JPAEdmBaseViewImpl implements JPAEdmSchemaView
List<ComplexType> complexTypes = complexTypeView.getConsistentEdmComplexTypes();
List<ComplexType> existingComplexTypes = new ArrayList<ComplexType>();
for (ComplexType complexType : complexTypes) {
- if (complexType != null && nonKeyComplexList.contains(complexType.getName())) {//null check for exclude
+ if (complexType != null && nonKeyComplexList.contains(complexType.getName())) {// null check for exclude
existingComplexTypes.add(complexType);
}
}
@@ -165,7 +165,8 @@ public class JPAEdmSchema extends JPAEdmBaseViewImpl implements JPAEdmSchemaView
}
}
- List<EntityType> entityTypes = entityContainerView.getJPAEdmEntitySetView().getJPAEdmEntityTypeView().getConsistentEdmEntityTypes();
+ List<EntityType> entityTypes =
+ entityContainerView.getJPAEdmEntitySetView().getJPAEdmEntityTypeView().getConsistentEdmEntityTypes();
List<NavigationProperty> navigationProperties;
if (entityTypes != null && !entityTypes.isEmpty()) {
for (EntityType entityType : entityTypes) {