diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Action.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Action.java deleted file mode 100644 index 920b0f395..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Action.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - -import java.util.List; - -public interface Action extends Named, Annotatable { - - boolean isBound(); - - String getEntitySetPath(); - - List getParameters(); - - Parameter getParameter(String name); - - ReturnType getReturnType(); - -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/ActionImport.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/ActionImport.java deleted file mode 100644 index 2c5f8c749..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/ActionImport.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - - -public interface ActionImport extends OperationImport { - - String getAction(); -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Annotation.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Annotation.java deleted file mode 100644 index f5f163fca..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Annotation.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - -import org.apache.olingo.client.api.edm.xml.annotation.AnnotationExpression; - -public interface Annotation extends Annotatable { - - String getTerm(); - - String getQualifier(); - - AnnotationExpression getExpression(); -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Annotations.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Annotations.java deleted file mode 100644 index 17a62437f..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Annotations.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - - -public interface Annotations extends Annotatable { - - String getTarget(); - - String getQualifier(); - - Annotation getAnnotation(String term); -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/BindingTarget.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/BindingTarget.java deleted file mode 100644 index c702ebd10..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/BindingTarget.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - -import java.util.List; - -public interface BindingTarget extends Named, Annotatable { - - List getNavigationPropertyBindings(); -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/ComplexType.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/ComplexType.java deleted file mode 100644 index d38839f98..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/ComplexType.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - - -public interface ComplexType extends StructuralType { -//No additional methods needed for now. -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/DataServices.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/DataServices.java index bb9fb0adc..d542cac44 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/DataServices.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/DataServices.java @@ -20,6 +20,8 @@ package org.apache.olingo.client.api.edm.xml; import java.util.List; +import org.apache.olingo.commons.api.edm.provider.Schema; + public interface DataServices { String getDataServiceVersion(); diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntityContainer.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntityContainer.java deleted file mode 100644 index c04270e9c..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntityContainer.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - -import java.util.List; - -public interface EntityContainer extends Named, Annotatable { - - String getExtends(); - - boolean isLazyLoadingEnabled(); - - boolean isDefaultEntityContainer(); - - EntitySet getEntitySet(String name); - - List getEntitySets(); - - List getSingletons(); - - Singleton getSingleton(String name); - - ActionImport getActionImport(String name); - - List getActionImports(String name); - - List getActionImports(); - - FunctionImport getFunctionImport(String name); - - List getFunctionImports(String name); - - List getFunctionImports(); -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntityKey.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntityKey.java deleted file mode 100644 index c1c43ec58..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntityKey.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - -import java.util.List; - -public interface EntityKey { - - List getPropertyRefs(); -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntitySet.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntitySet.java deleted file mode 100644 index 1bf85a2d2..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntitySet.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - -public interface EntitySet extends Named, BindingTarget { - - String getEntityType(); - - boolean isIncludeInServiceDocument(); - -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntityType.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntityType.java deleted file mode 100644 index 8d8eeb420..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntityType.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - -public interface EntityType extends StructuralType { - - EntityKey getKey(); - - boolean isHasStream(); -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EnumType.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EnumType.java deleted file mode 100644 index 318dc17cb..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EnumType.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - -import java.util.List; - -public interface EnumType extends Named { - - String getUnderlyingType(); - - boolean isFlags(); - - List getMembers(); - - Member getMember(String name); - - Member getMember(Integer value); -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Function.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Function.java deleted file mode 100644 index 90df25c07..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Function.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - - -public interface Function extends Action { - - boolean isComposable(); -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/FunctionImport.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/FunctionImport.java deleted file mode 100644 index 8d4449ae2..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/FunctionImport.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - - -public interface FunctionImport extends OperationImport, Named { - - String getFunction(); - - boolean isIncludeInServiceDocument(); -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Member.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Member.java deleted file mode 100644 index 0cb9b7479..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Member.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - -public interface Member { - - String getName(); - - String getValue(); -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/NavigationProperty.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/NavigationProperty.java deleted file mode 100644 index 7985561e8..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/NavigationProperty.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - -import java.util.List; - -public interface NavigationProperty extends Named, Annotatable { - - String getType(); - - boolean isNullable(); - - String getPartner(); - - List getReferentialConstraints(); - - OnDelete getOnDelete(); - - boolean isContainsTarget(); -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/NavigationPropertyBinding.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/NavigationPropertyBinding.java deleted file mode 100644 index 6dda47d75..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/NavigationPropertyBinding.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - -public interface NavigationPropertyBinding { - - String getPath(); - - String getTarget(); - -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/OnDelete.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/OnDelete.java deleted file mode 100644 index 7ebbfb395..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/OnDelete.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - -public interface OnDelete { - - OnDeleteAction getAction(); -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/OperationImport.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/OperationImport.java deleted file mode 100644 index 12729219b..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/OperationImport.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - - -public interface OperationImport extends Named, Annotatable { - - String getEntitySet(); - - void setEntitySet(String entitySet); -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Property.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Property.java deleted file mode 100644 index 62909f1b0..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Property.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - -import org.apache.olingo.commons.api.edm.geo.SRID; - - -public interface Property extends Named, Annotatable { - - String getType(); - - boolean isNullable(); - - String getDefaultValue(); - - Integer getMaxLength(); - - Integer getPrecision(); - - Integer getScale(); - - boolean isUnicode(); - - SRID getSrid(); - -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/PropertyRef.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/PropertyRef.java deleted file mode 100644 index 8de4a2273..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/PropertyRef.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - -public interface PropertyRef extends Named { - - String getAlias(); - -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Reference.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Reference.java index 599aa6a03..d85fd6e08 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Reference.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Reference.java @@ -21,6 +21,8 @@ package org.apache.olingo.client.api.edm.xml; import java.net.URI; import java.util.List; +import org.apache.olingo.commons.api.edm.provider.Annotatable; + public interface Reference extends Annotatable { URI getUri(); diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/ReferentialConstraint.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/ReferentialConstraint.java deleted file mode 100644 index 559bf2ca5..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/ReferentialConstraint.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - - -public interface ReferentialConstraint extends Annotatable { - - String getProperty(); - - String getReferencedProperty(); - -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/ReturnType.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/ReturnType.java deleted file mode 100644 index 85d503083..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/ReturnType.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - -import org.apache.olingo.commons.api.edm.geo.SRID; - -public interface ReturnType { - - Integer getMaxLength(); - - Integer getPrecision(); - - Integer getScale(); - - SRID getSrid(); - - String getType(); - - boolean isNullable(); -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Schema.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Schema.java deleted file mode 100644 index 820c327ec..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Schema.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - -import java.util.List; -import java.util.Map; - -public interface Schema { - - String getNamespace(); - - String getAlias(); - - List getEnumTypes(); - - EnumType getEnumType(String name); - - /** - * Gets default entity container. - * - * @return default entity container. - */ - EntityContainer getDefaultEntityContainer(); - - /** - * Gets entity container with the given name. - * - * @param name name. - * @return entity container. - */ - EntityContainer getEntityContainer(String name); - - List getEntityContainers(); - - EntityContainer getEntityContainer(); - - ComplexType getComplexType(String name); - - List getComplexTypes(); - - EntityType getEntityType(String name); - - List getEntityTypes(); - - List getActions(); - - List getActions(String name); - - Annotation getAnnotation(String term); - - Map getAnnotatables(); - - List getFunctions(); - - List getFunctions(String name); - - Term getTerm(String name); - - List getTerms(); - - TypeDefinition getTypeDefinition(String name); - - List getTypeDefinitions(); - - List getAnnotationGroups(); - - Annotations getAnnotationGroup(String target); - - //TODO: Check if there are annotations in V4 - List getAnnotations(); - -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Singleton.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Singleton.java deleted file mode 100644 index 7fd76e4af..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Singleton.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - - -public interface Singleton extends EntitySet, BindingTarget { -//No additional methods needed for now. -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/StructuralType.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/StructuralType.java deleted file mode 100644 index 5800d7882..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/StructuralType.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - -import java.util.List; - -public interface StructuralType extends Named, Annotatable{ - - boolean isAbstractType(); - - String getBaseType(); - - boolean isOpenType(); - - Property getProperty(String name); - - List getProperties(); - - NavigationProperty getNavigationProperty(String name); - - List getNavigationProperties(); - -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Term.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Term.java deleted file mode 100644 index fe9712e69..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Term.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - -import java.util.List; - -import org.apache.olingo.commons.api.edm.geo.SRID; - -public interface Term extends Named, Annotatable { - - List getAppliesTo(); - - String getBaseTerm(); - - String getDefaultValue(); - - Integer getMaxLength(); - - Integer getPrecision(); - - Integer getScale(); - - SRID getSrid(); - - String getType(); - - boolean isNullable(); -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/TypeDefinition.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/TypeDefinition.java deleted file mode 100644 index 45ad41e15..000000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/TypeDefinition.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.edm.xml; - -import java.util.List; - -import org.apache.olingo.commons.api.edm.geo.SRID; - -public interface TypeDefinition extends Named, Annotatable { - - List getAnnotations(); - - Integer getMaxLength(); - - Integer getPrecision(); - - Integer getScale(); - - SRID getSrid(); - - String getUnderlyingType(); - - boolean isUnicode(); -} diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/XMLMetadata.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/XMLMetadata.java index 9cf10b984..c1231a129 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/XMLMetadata.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/XMLMetadata.java @@ -21,6 +21,8 @@ package org.apache.olingo.client.api.edm.xml; import java.util.List; import java.util.Map; +import org.apache.olingo.commons.api.edm.provider.Schema; + /** * Entry point for access information about EDM metadata. */ diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataReader.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataReader.java index 611666abe..e89534130 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataReader.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataReader.java @@ -21,7 +21,6 @@ package org.apache.olingo.client.api.serialization; import java.io.InputStream; import java.util.Map; -import org.apache.olingo.client.api.edm.xml.Schema; import org.apache.olingo.commons.api.data.ResWrap; import org.apache.olingo.commons.api.domain.ODataEntity; import org.apache.olingo.commons.api.domain.ODataEntitySet; @@ -29,6 +28,7 @@ import org.apache.olingo.commons.api.domain.ODataError; import org.apache.olingo.commons.api.domain.ODataProperty; import org.apache.olingo.commons.api.domain.ODataServiceDocument; import org.apache.olingo.commons.api.edm.Edm; +import org.apache.olingo.commons.api.edm.provider.Schema; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.commons.api.serialization.ODataDeserializerException; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/XMLMetadataRequestImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/XMLMetadataRequestImpl.java index c7bba68af..20d1da174 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/XMLMetadataRequestImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/XMLMetadataRequestImpl.java @@ -27,15 +27,15 @@ import org.apache.http.client.methods.HttpUriRequest; import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.api.communication.request.retrieve.XMLMetadataRequest; import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse; -import org.apache.olingo.client.api.edm.xml.Annotation; -import org.apache.olingo.client.api.edm.xml.Annotations; import org.apache.olingo.client.api.edm.xml.Include; import org.apache.olingo.client.api.edm.xml.IncludeAnnotations; import org.apache.olingo.client.api.edm.xml.Reference; -import org.apache.olingo.client.api.edm.xml.Schema; import org.apache.olingo.client.api.edm.xml.XMLMetadata; import org.apache.olingo.client.core.edm.xml.AnnotationsImpl; import org.apache.olingo.client.core.edm.xml.SchemaImpl; +import org.apache.olingo.commons.api.edm.provider.Annotation; +import org.apache.olingo.commons.api.edm.provider.Annotations; +import org.apache.olingo.commons.api.edm.provider.Schema; import org.apache.olingo.commons.api.format.ODataFormat; public class XMLMetadataRequestImpl diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmActionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmActionImpl.java index 63cfa423c..c1dcfa49b 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmActionImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmActionImpl.java @@ -18,11 +18,11 @@ */ package org.apache.olingo.client.core.edm; -import org.apache.olingo.client.api.edm.xml.Action; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAction; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; +import org.apache.olingo.commons.api.edm.provider.Action; public class EdmActionImpl extends EdmOperationImpl implements EdmAction { diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmActionImportImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmActionImportImpl.java index d826486a7..eedcb7279 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmActionImportImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmActionImportImpl.java @@ -20,7 +20,6 @@ package org.apache.olingo.client.core.edm; import java.util.List; -import org.apache.olingo.client.api.edm.xml.ActionImport; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAction; import org.apache.olingo.commons.api.edm.EdmActionImport; @@ -28,6 +27,7 @@ import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmEntityContainer; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.ActionImport; import org.apache.olingo.commons.core.edm.EdmAnnotationHelper; import org.apache.olingo.commons.core.edm.EdmTypeInfo; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmAnnotationHelperImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmAnnotationHelperImpl.java index f6d0a25c7..b29d0a902 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmAnnotationHelperImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmAnnotationHelperImpl.java @@ -21,11 +21,11 @@ package org.apache.olingo.client.core.edm; import java.util.ArrayList; import java.util.List; -import org.apache.olingo.client.api.edm.xml.Annotatable; -import org.apache.olingo.client.api.edm.xml.Annotation; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmTerm; +import org.apache.olingo.commons.api.edm.provider.Annotatable; +import org.apache.olingo.commons.api.edm.provider.Annotation; import org.apache.olingo.commons.core.edm.EdmAnnotationHelper; public class EdmAnnotationHelperImpl implements EdmAnnotationHelper { diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmAnnotationImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmAnnotationImpl.java index de46faed6..a8a165cd5 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmAnnotationImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmAnnotationImpl.java @@ -21,11 +21,6 @@ package org.apache.olingo.client.core.edm; import java.util.ArrayList; import java.util.List; -import org.apache.olingo.client.api.edm.xml.Annotatable; -import org.apache.olingo.client.api.edm.xml.Annotation; -import org.apache.olingo.client.api.edm.xml.annotation.AnnotationExpression; -import org.apache.olingo.client.api.edm.xml.annotation.DynamicAnnotationExpression; -import org.apache.olingo.client.api.edm.xml.annotation.PropertyValue; import org.apache.olingo.client.core.edm.annotation.EdmCastImpl; import org.apache.olingo.client.core.edm.annotation.EdmConstantAnnotationExpressionImpl; import org.apache.olingo.client.core.edm.annotation.EdmIsOfImpl; @@ -38,6 +33,11 @@ import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.annotation.EdmAnnotationExpression; import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression; import org.apache.olingo.commons.api.edm.annotation.EdmPropertyValue; +import org.apache.olingo.commons.api.edm.provider.Annotatable; +import org.apache.olingo.commons.api.edm.provider.Annotation; +import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression; +import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression; +import org.apache.olingo.commons.api.edm.provider.annotation.PropertyValue; import org.apache.olingo.commons.core.edm.EdmAnnotationHelper; import org.apache.olingo.commons.core.edm.annotation.EdmAndImpl; import org.apache.olingo.commons.core.edm.annotation.EdmAnnotationPathImpl; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmAnnotationsImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmAnnotationsImpl.java index ebd953d7c..91cf5fcc1 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmAnnotationsImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmAnnotationsImpl.java @@ -22,8 +22,6 @@ import java.util.ArrayList; import java.util.List; import org.apache.commons.lang3.StringUtils; -import org.apache.olingo.client.api.edm.xml.Annotation; -import org.apache.olingo.client.api.edm.xml.Annotations; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmAnnotations; @@ -34,6 +32,8 @@ import org.apache.olingo.commons.api.edm.EdmSchema; import org.apache.olingo.commons.api.edm.EdmStructuredType; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.Annotation; +import org.apache.olingo.commons.api.edm.provider.Annotations; public class EdmAnnotationsImpl implements EdmAnnotations { diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmBindingTargetImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmBindingTargetImpl.java index 21b7e9b59..a75ed6120 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmBindingTargetImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmBindingTargetImpl.java @@ -21,14 +21,14 @@ package org.apache.olingo.client.core.edm; import java.util.ArrayList; import java.util.List; -import org.apache.olingo.client.api.edm.xml.BindingTarget; -import org.apache.olingo.client.api.edm.xml.NavigationPropertyBinding; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmEntityContainer; import org.apache.olingo.commons.api.edm.EdmNavigationPropertyBinding; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.BindingTarget; +import org.apache.olingo.commons.api.edm.provider.NavigationPropertyBinding; import org.apache.olingo.commons.core.edm.AbstractEdmBindingTarget; import org.apache.olingo.commons.core.edm.EdmAnnotationHelper; import org.apache.olingo.commons.core.edm.EdmNavigationPropertyBindingImpl; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmClientImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmClientImpl.java index 31a738435..409cb5840 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmClientImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmClientImpl.java @@ -32,19 +32,6 @@ import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; -import org.apache.olingo.client.api.edm.xml.Action; -import org.apache.olingo.client.api.edm.xml.Annotatable; -import org.apache.olingo.client.api.edm.xml.Annotation; -import org.apache.olingo.client.api.edm.xml.Annotations; -import org.apache.olingo.client.api.edm.xml.ComplexType; -import org.apache.olingo.client.api.edm.xml.EntityContainer; -import org.apache.olingo.client.api.edm.xml.EntityType; -import org.apache.olingo.client.api.edm.xml.EnumType; -import org.apache.olingo.client.api.edm.xml.Function; -import org.apache.olingo.client.api.edm.xml.Parameter; -import org.apache.olingo.client.api.edm.xml.Schema; -import org.apache.olingo.client.api.edm.xml.Term; -import org.apache.olingo.client.api.edm.xml.TypeDefinition; import org.apache.olingo.commons.api.edm.EdmAction; import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmAnnotations; @@ -57,6 +44,19 @@ import org.apache.olingo.commons.api.edm.EdmSchema; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.Action; +import org.apache.olingo.commons.api.edm.provider.Annotatable; +import org.apache.olingo.commons.api.edm.provider.Annotation; +import org.apache.olingo.commons.api.edm.provider.Annotations; +import org.apache.olingo.commons.api.edm.provider.ComplexType; +import org.apache.olingo.commons.api.edm.provider.EntityContainer; +import org.apache.olingo.commons.api.edm.provider.EntityType; +import org.apache.olingo.commons.api.edm.provider.EnumType; +import org.apache.olingo.commons.api.edm.provider.Function; +import org.apache.olingo.commons.api.edm.provider.Parameter; +import org.apache.olingo.commons.api.edm.provider.Schema; +import org.apache.olingo.commons.api.edm.provider.Term; +import org.apache.olingo.commons.api.edm.provider.TypeDefinition; import org.apache.olingo.commons.core.edm.AbstractEdm; import org.apache.olingo.commons.core.edm.EdmTypeInfo; @@ -106,7 +106,7 @@ public class EdmClientImpl extends AbstractEdm { final Schema schema = xmlSchemaByNamespace.get(containerName.getNamespace()); if (schema != null) { - final EntityContainer xmlEntityContainer = schema.getDefaultEntityContainer(); + final EntityContainer xmlEntityContainer = schema.getEntityContainer(); if (xmlEntityContainer != null) { result = new EdmEntityContainerImpl(this, containerName, xmlEntityContainer); } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmComplexTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmComplexTypeImpl.java index d985110c8..5861640b8 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmComplexTypeImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmComplexTypeImpl.java @@ -21,13 +21,13 @@ package org.apache.olingo.client.core.edm; import java.util.List; import java.util.Map; -import org.apache.olingo.client.api.edm.xml.ComplexType; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmNavigationProperty; import org.apache.olingo.commons.api.edm.EdmProperty; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.ComplexType; import org.apache.olingo.commons.core.edm.AbstractEdmComplexType; import org.apache.olingo.commons.core.edm.EdmAnnotationHelper; import org.apache.olingo.commons.core.edm.EdmStructuredTypeHelper; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntityContainerImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntityContainerImpl.java index 3d1a62407..7e3f7f039 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntityContainerImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntityContainerImpl.java @@ -21,11 +21,6 @@ package org.apache.olingo.client.core.edm; import java.util.Collections; import java.util.List; -import org.apache.olingo.client.api.edm.xml.ActionImport; -import org.apache.olingo.client.api.edm.xml.EntityContainer; -import org.apache.olingo.client.api.edm.xml.EntitySet; -import org.apache.olingo.client.api.edm.xml.FunctionImport; -import org.apache.olingo.client.api.edm.xml.Singleton; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmActionImport; import org.apache.olingo.commons.api.edm.EdmAnnotation; @@ -34,6 +29,11 @@ import org.apache.olingo.commons.api.edm.EdmFunctionImport; import org.apache.olingo.commons.api.edm.EdmSingleton; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.ActionImport; +import org.apache.olingo.commons.api.edm.provider.EntityContainer; +import org.apache.olingo.commons.api.edm.provider.EntitySet; +import org.apache.olingo.commons.api.edm.provider.FunctionImport; +import org.apache.olingo.commons.api.edm.provider.Singleton; import org.apache.olingo.commons.core.edm.AbstractEdmEntityContainer; import org.apache.olingo.commons.core.edm.EdmAnnotationHelper; import org.apache.olingo.commons.core.edm.EdmTypeInfo; @@ -47,8 +47,8 @@ public class EdmEntityContainerImpl extends AbstractEdmEntityContainer { public EdmEntityContainerImpl(final Edm edm, final FullQualifiedName entityContainerName, final EntityContainer xmlEntityContainer) { - super(edm, entityContainerName, xmlEntityContainer.getExtends() == null - ? null : new FullQualifiedName(xmlEntityContainer.getExtends())); + super(edm, entityContainerName, xmlEntityContainer.getExtendsContainer() == null + ? null : new FullQualifiedName(xmlEntityContainer.getExtendsContainer())); this.xmlEntityContainer = xmlEntityContainer; this.helper = new EdmAnnotationHelperImpl(edm, xmlEntityContainer); @@ -65,7 +65,7 @@ public class EdmEntityContainerImpl extends AbstractEdmEntityContainer { return singleton == null ? null : new EdmSingletonImpl(edm, this, singletonName, new EdmTypeInfo.Builder(). - setTypeExpression(singleton.getEntityType()). + setTypeExpression(singleton.getType()). setDefaultNamespace(entityContainerName.getNamespace()). build().getFullQualifiedName(), singleton); } @@ -76,7 +76,7 @@ public class EdmEntityContainerImpl extends AbstractEdmEntityContainer { final EntitySet entitySet = xmlEntityContainer.getEntitySet(entitySetName); if (entitySet != null) { - final FullQualifiedName entityType = new EdmTypeInfo.Builder().setTypeExpression(entitySet.getEntityType()). + final FullQualifiedName entityType = new EdmTypeInfo.Builder().setTypeExpression(entitySet.getType()). setDefaultNamespace(entityContainerName.getNamespace()).build().getFullQualifiedName(); result = new EdmEntitySetImpl(edm, this, entitySetName, entityType, entitySet); } @@ -113,7 +113,7 @@ public class EdmEntityContainerImpl extends AbstractEdmEntityContainer { if (localEntitySets != null) { for (EntitySet entitySet : localEntitySets) { EdmEntitySet edmSet; - final FullQualifiedName entityType = new EdmTypeInfo.Builder().setTypeExpression(entitySet.getEntityType()). + final FullQualifiedName entityType = new EdmTypeInfo.Builder().setTypeExpression(entitySet.getType()). setDefaultNamespace(entityContainerName.getNamespace()).build().getFullQualifiedName(); edmSet = new EdmEntitySetImpl(edm, this, entitySet.getName(), entityType, entitySet); entitySets.put(edmSet.getName(), edmSet); @@ -138,7 +138,7 @@ public class EdmEntityContainerImpl extends AbstractEdmEntityContainer { for (Singleton singleton : localSingletons) { singletons.put(singleton.getName(), new EdmSingletonImpl(edm, this, singleton.getName(), new EdmTypeInfo.Builder(). - setTypeExpression(singleton.getEntityType()).setDefaultNamespace(entityContainerName.getNamespace()). + setTypeExpression(singleton.getType()).setDefaultNamespace(entityContainerName.getNamespace()). build().getFullQualifiedName(), singleton)); } } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntitySetImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntitySetImpl.java index d4aa18313..85934cb0e 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntitySetImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntitySetImpl.java @@ -18,11 +18,11 @@ */ package org.apache.olingo.client.core.edm; -import org.apache.olingo.client.api.edm.xml.EntitySet; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmEntityContainer; import org.apache.olingo.commons.api.edm.EdmEntitySet; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.EntitySet; public class EdmEntitySetImpl extends EdmBindingTargetImpl implements EdmEntitySet { diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntityTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntityTypeImpl.java index 4fef9a288..c35de081b 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntityTypeImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntityTypeImpl.java @@ -22,8 +22,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import org.apache.olingo.client.api.edm.xml.EntityType; -import org.apache.olingo.client.api.edm.xml.PropertyRef; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmEntityType; @@ -32,6 +30,8 @@ import org.apache.olingo.commons.api.edm.EdmNavigationProperty; import org.apache.olingo.commons.api.edm.EdmProperty; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.EntityType; +import org.apache.olingo.commons.api.edm.provider.PropertyRef; import org.apache.olingo.commons.core.edm.AbstractEdmEntityType; import org.apache.olingo.commons.core.edm.EdmAnnotationHelper; import org.apache.olingo.commons.core.edm.EdmStructuredTypeHelper; @@ -56,12 +56,11 @@ public class EdmEntityTypeImpl extends AbstractEdmEntityType { final List edmKey; // Abstract EntityTypes do not necessarily have keys - if (entityType.isAbstractType() && entityType.getKey() == null) { + if (entityType.isAbstract() && entityType.getKey() == null) { edmKey = new ArrayList(); } else { - edmKey = new ArrayList( - entityType.getKey().getPropertyRefs().size()); - for (PropertyRef ref : entityType.getKey().getPropertyRefs()) { + edmKey = new ArrayList(entityType.getKey().size()); + for (PropertyRef ref : entityType.getKey()) { edmKey.add(new EdmKeyPropertyRefImpl(instance, ref)); } } @@ -76,7 +75,7 @@ public class EdmEntityTypeImpl extends AbstractEdmEntityType { private EdmEntityTypeImpl(final Edm edm, final FullQualifiedName fqn, final FullQualifiedName baseTypeName, final EntityType entityType) { - super(edm, fqn, baseTypeName, entityType.isHasStream()); + super(edm, fqn, baseTypeName, entityType.hasStream()); this.typeHelper = new EdmStructuredTypeHelperImpl(edm, getFullQualifiedName(), entityType); this.annotationHelper = new EdmAnnotationHelperImpl(edm, entityType); } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEnumTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEnumTypeImpl.java index 297aecaaa..d044f8c7b 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEnumTypeImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEnumTypeImpl.java @@ -26,14 +26,14 @@ import java.util.List; import java.util.Map; import org.apache.commons.lang3.ArrayUtils; -import org.apache.olingo.client.api.edm.xml.EnumType; -import org.apache.olingo.client.api.edm.xml.Member; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.EdmMember; import org.apache.olingo.commons.api.edm.EdmPrimitiveType; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.EnumMember; +import org.apache.olingo.commons.api.edm.provider.EnumType; import org.apache.olingo.commons.core.edm.AbstractEdmEnumType; import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; @@ -69,10 +69,10 @@ public class EdmEnumTypeImpl extends AbstractEdmEnumType { this.underlyingType = EdmPrimitiveTypeFactory.getInstance(underlyingTipeKind); } - final List xmlMembers = xmlEnumType.getMembers(); + final List xmlMembers = xmlEnumType.getMembers(); final List _memberNames = new ArrayList(); final Map _members = new LinkedHashMap(xmlMembers.size()); - for (Member xmlMember : xmlMembers) { + for (EnumMember xmlMember : xmlMembers) { _memberNames.add(xmlMember.getName()); _members.put(xmlMember.getName(), new EdmMemberImpl(edm, fqn, xmlMember)); } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmFunctionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmFunctionImpl.java index 1e7f9f6dd..0930bf2e2 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmFunctionImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmFunctionImpl.java @@ -18,11 +18,11 @@ */ package org.apache.olingo.client.core.edm; -import org.apache.olingo.client.api.edm.xml.Function; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; +import org.apache.olingo.commons.api.edm.provider.Function; public class EdmFunctionImpl extends EdmOperationImpl implements EdmFunction { diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmFunctionImportImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmFunctionImportImpl.java index 170c046d7..ad9babab1 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmFunctionImportImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmFunctionImportImpl.java @@ -20,7 +20,6 @@ package org.apache.olingo.client.core.edm; import java.util.List; -import org.apache.olingo.client.api.edm.xml.FunctionImport; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmEntityContainer; @@ -28,6 +27,7 @@ import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.EdmFunctionImport; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.FunctionImport; import org.apache.olingo.commons.core.edm.EdmAnnotationHelper; import org.apache.olingo.commons.core.edm.EdmTypeInfo; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmKeyPropertyRefImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmKeyPropertyRefImpl.java index 9dca19981..796b602e0 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmKeyPropertyRefImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmKeyPropertyRefImpl.java @@ -18,8 +18,8 @@ */ package org.apache.olingo.client.core.edm; -import org.apache.olingo.client.api.edm.xml.PropertyRef; import org.apache.olingo.commons.api.edm.EdmEntityType; +import org.apache.olingo.commons.api.edm.provider.PropertyRef; import org.apache.olingo.commons.core.edm.AbstractEdmKeyPropertyRef; public class EdmKeyPropertyRefImpl extends AbstractEdmKeyPropertyRef { diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmMemberImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmMemberImpl.java index bf19703bd..b14fece52 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmMemberImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmMemberImpl.java @@ -21,12 +21,12 @@ package org.apache.olingo.client.core.edm; import java.util.Collections; import java.util.List; -import org.apache.olingo.client.api.edm.xml.Member; -import org.apache.olingo.client.core.edm.xml.MemberImpl; +import org.apache.olingo.client.core.edm.xml.EnumMemberImpl; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.EnumMember; import org.apache.olingo.commons.core.edm.AbstractEdmMember; import org.apache.olingo.commons.core.edm.EdmAnnotationHelper; @@ -34,10 +34,10 @@ public class EdmMemberImpl extends AbstractEdmMember { private EdmAnnotationHelper helper; - public EdmMemberImpl(final Edm edm, final FullQualifiedName enumFQN, final Member member) { + public EdmMemberImpl(final Edm edm, final FullQualifiedName enumFQN, final EnumMember member) { super(edm, enumFQN, member.getName(), member.getValue()); - this.helper = member instanceof MemberImpl - ? new EdmAnnotationHelperImpl(edm, (MemberImpl) member) + this.helper = member instanceof EnumMemberImpl + ? new EdmAnnotationHelperImpl(edm, member) : null; } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmNavigationPropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmNavigationPropertyImpl.java index c3aec23c7..5b8e7845c 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmNavigationPropertyImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmNavigationPropertyImpl.java @@ -21,13 +21,13 @@ package org.apache.olingo.client.core.edm; import java.util.ArrayList; import java.util.List; -import org.apache.olingo.client.api.edm.xml.NavigationProperty; -import org.apache.olingo.client.api.edm.xml.ReferentialConstraint; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmReferentialConstraint; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.NavigationProperty; +import org.apache.olingo.commons.api.edm.provider.ReferentialConstraint; import org.apache.olingo.commons.core.edm.AbstractEdmNavigationProperty; import org.apache.olingo.commons.core.edm.EdmAnnotationHelper; import org.apache.olingo.commons.core.edm.EdmTypeInfo; @@ -71,7 +71,7 @@ public class EdmNavigationPropertyImpl extends AbstractEdmNavigationProperty { } @Override - public Boolean isNullable() { + public boolean isNullable() { return navigationProperty.isNullable(); } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmOperationImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmOperationImpl.java index 0df592c6e..69fb1920e 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmOperationImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmOperationImpl.java @@ -22,20 +22,20 @@ import java.util.ArrayList; import java.util.List; import org.apache.commons.lang3.StringUtils; -import org.apache.olingo.client.api.edm.xml.Action; -import org.apache.olingo.client.api.edm.xml.Parameter; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmParameter; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; +import org.apache.olingo.commons.api.edm.provider.Operation; +import org.apache.olingo.commons.api.edm.provider.Parameter; import org.apache.olingo.commons.core.edm.AbstractEdmOperation; import org.apache.olingo.commons.core.edm.EdmAnnotationHelper; public abstract class EdmOperationImpl extends AbstractEdmOperation { - protected final Action operation; + protected final Operation operation; protected final EdmAnnotationHelper helper; @@ -63,7 +63,7 @@ public abstract class EdmOperationImpl extends AbstractEdmOperation { return instance; } - protected EdmOperationImpl(final Edm edm, final FullQualifiedName name, final Action operation, + protected EdmOperationImpl(final Edm edm, final FullQualifiedName name, final Operation operation, final EdmTypeKind kind) { super(edm, name, kind); diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmParameterImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmParameterImpl.java index a82e25284..27bc5f490 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmParameterImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmParameterImpl.java @@ -21,13 +21,13 @@ package org.apache.olingo.client.core.edm; import java.util.Collections; import java.util.List; -import org.apache.olingo.client.api.edm.xml.Parameter; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmMapping; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.geo.SRID; +import org.apache.olingo.commons.api.edm.provider.Parameter; import org.apache.olingo.commons.core.edm.AbstractEdmParameter; import org.apache.olingo.commons.core.edm.EdmAnnotationHelper; import org.apache.olingo.commons.core.edm.EdmTypeInfo; @@ -58,7 +58,7 @@ public class EdmParameterImpl extends AbstractEdmParameter { } @Override - public Boolean isNullable() { + public boolean isNullable() { return parameter.isNullable(); } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmPropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmPropertyImpl.java index 9c34472a5..be3e49e32 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmPropertyImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmPropertyImpl.java @@ -21,13 +21,13 @@ package org.apache.olingo.client.core.edm; import java.util.Collections; import java.util.List; -import org.apache.olingo.client.api.edm.xml.Property; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmMapping; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.geo.SRID; +import org.apache.olingo.commons.api.edm.provider.Property; import org.apache.olingo.commons.core.edm.AbstractEdmProperty; import org.apache.olingo.commons.core.edm.EdmAnnotationHelper; import org.apache.olingo.commons.core.edm.EdmTypeInfo; @@ -47,7 +47,9 @@ public class EdmPropertyImpl extends AbstractEdmProperty { this.structuredTypeName = structuredTypeName; this.property = property; - this.typeInfo = new EdmTypeInfo.Builder().setEdm(edm).setTypeExpression(property.getType()).build(); + this.typeInfo = + new EdmTypeInfo.Builder().setEdm(edm).setTypeExpression(property.getType()) + .build(); this.helper = new EdmAnnotationHelperImpl(edm, property); } @@ -67,7 +69,7 @@ public class EdmPropertyImpl extends AbstractEdmProperty { } @Override - public Boolean isNullable() { + public boolean isNullable() { return property.isNullable(); } @@ -87,7 +89,7 @@ public class EdmPropertyImpl extends AbstractEdmProperty { } @Override - public Boolean isUnicode() { + public boolean isUnicode() { return property.isUnicode(); } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmReferentialConstraintImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmReferentialConstraintImpl.java index c9a80e91c..aafc05dbe 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmReferentialConstraintImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmReferentialConstraintImpl.java @@ -20,10 +20,10 @@ package org.apache.olingo.client.core.edm; import java.util.List; -import org.apache.olingo.client.api.edm.xml.ReferentialConstraint; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmTerm; +import org.apache.olingo.commons.api.edm.provider.ReferentialConstraint; import org.apache.olingo.commons.core.edm.AbstractEdmReferentialConstraint; import org.apache.olingo.commons.core.edm.EdmAnnotationHelper; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmReturnTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmReturnTypeImpl.java index 071cbfa43..03d15377a 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmReturnTypeImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmReturnTypeImpl.java @@ -18,9 +18,9 @@ */ package org.apache.olingo.client.core.edm; -import org.apache.olingo.client.api.edm.xml.ReturnType; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.geo.SRID; +import org.apache.olingo.commons.api.edm.provider.ReturnType; import org.apache.olingo.commons.core.edm.AbstractEdmReturnType; import org.apache.olingo.commons.core.edm.EdmTypeInfo; @@ -47,7 +47,7 @@ public class EdmReturnTypeImpl extends AbstractEdmReturnType { } @Override - public Boolean isNullable() { + public boolean isNullable() { return returnType.isNullable(); } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmSchemaImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmSchemaImpl.java index 30ca77a9c..41c4900c3 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmSchemaImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmSchemaImpl.java @@ -23,17 +23,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.olingo.client.api.edm.xml.Action; -import org.apache.olingo.client.api.edm.xml.Annotation; -import org.apache.olingo.client.api.edm.xml.Annotations; -import org.apache.olingo.client.api.edm.xml.ComplexType; -import org.apache.olingo.client.api.edm.xml.EntityContainer; -import org.apache.olingo.client.api.edm.xml.EntityType; -import org.apache.olingo.client.api.edm.xml.EnumType; -import org.apache.olingo.client.api.edm.xml.Function; -import org.apache.olingo.client.api.edm.xml.Schema; -import org.apache.olingo.client.api.edm.xml.Term; -import org.apache.olingo.client.api.edm.xml.TypeDefinition; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAction; import org.apache.olingo.commons.api.edm.EdmAnnotation; @@ -46,6 +35,17 @@ import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.Action; +import org.apache.olingo.commons.api.edm.provider.Annotation; +import org.apache.olingo.commons.api.edm.provider.Annotations; +import org.apache.olingo.commons.api.edm.provider.ComplexType; +import org.apache.olingo.commons.api.edm.provider.EntityContainer; +import org.apache.olingo.commons.api.edm.provider.EntityType; +import org.apache.olingo.commons.api.edm.provider.EnumType; +import org.apache.olingo.commons.api.edm.provider.Function; +import org.apache.olingo.commons.api.edm.provider.Schema; +import org.apache.olingo.commons.api.edm.provider.Term; +import org.apache.olingo.commons.api.edm.provider.TypeDefinition; import org.apache.olingo.commons.core.edm.AbstractEdmSchema; public class EdmSchemaImpl extends AbstractEdmSchema { @@ -88,7 +88,7 @@ public class EdmSchemaImpl extends AbstractEdmSchema { } private EdmEntityContainer createEntityContainer(final String name) { - final EntityContainer defaultContainer = schema.getEntityContainer(name); + final EntityContainer defaultContainer = schema.getEntityContainer(); if (defaultContainer != null) { final FullQualifiedName entityContainerName = new FullQualifiedName(schema.getNamespace(), defaultContainer.getName()); @@ -99,7 +99,7 @@ public class EdmSchemaImpl extends AbstractEdmSchema { @Override protected EdmEntityContainer createEntityContainer() { - final EntityContainer defaultContainer = schema.getDefaultEntityContainer(); + final EntityContainer defaultContainer = schema.getEntityContainer(); if (defaultContainer != null) { return createEntityContainer(defaultContainer.getName()); } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmSingletonImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmSingletonImpl.java index 4735569a1..421672737 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmSingletonImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmSingletonImpl.java @@ -18,11 +18,11 @@ */ package org.apache.olingo.client.core.edm; -import org.apache.olingo.client.api.edm.xml.Singleton; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmEntityContainer; import org.apache.olingo.commons.api.edm.EdmSingleton; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.Singleton; public class EdmSingletonImpl extends EdmBindingTargetImpl implements EdmSingleton { diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmStructuredTypeHelperImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmStructuredTypeHelperImpl.java index b9ed216e6..bc6e17331 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmStructuredTypeHelperImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmStructuredTypeHelperImpl.java @@ -21,13 +21,13 @@ package org.apache.olingo.client.core.edm; import java.util.LinkedHashMap; import java.util.Map; -import org.apache.olingo.client.api.edm.xml.NavigationProperty; -import org.apache.olingo.client.api.edm.xml.Property; -import org.apache.olingo.client.api.edm.xml.StructuralType; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmNavigationProperty; import org.apache.olingo.commons.api.edm.EdmProperty; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.NavigationProperty; +import org.apache.olingo.commons.api.edm.provider.Property; +import org.apache.olingo.commons.api.edm.provider.StructuralType; import org.apache.olingo.commons.core.edm.EdmStructuredTypeHelper; public class EdmStructuredTypeHelperImpl implements EdmStructuredTypeHelper { @@ -80,6 +80,6 @@ public class EdmStructuredTypeHelperImpl implements EdmStructuredTypeHelper { @Override public boolean isAbstract() { - return structuralType.isAbstractType(); + return structuralType.isAbstract(); } } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmTermImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmTermImpl.java index 4d85e513a..2885ce2fc 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmTermImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmTermImpl.java @@ -22,7 +22,6 @@ import java.util.ArrayList; import java.util.List; import org.apache.commons.lang3.ClassUtils; -import org.apache.olingo.client.api.edm.xml.Term; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmException; @@ -30,6 +29,7 @@ import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.geo.SRID; +import org.apache.olingo.commons.api.edm.provider.Term; import org.apache.olingo.commons.core.edm.EdmAnnotationHelper; import org.apache.olingo.commons.core.edm.EdmNamedImpl; import org.apache.olingo.commons.core.edm.EdmTypeInfo; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmTypeDefinitionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmTypeDefinitionImpl.java index d82e5f655..1b6f1f5f6 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmTypeDefinitionImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmTypeDefinitionImpl.java @@ -20,7 +20,6 @@ package org.apache.olingo.client.core.edm; import java.util.List; -import org.apache.olingo.client.api.edm.xml.TypeDefinition; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmException; @@ -29,6 +28,7 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.geo.SRID; +import org.apache.olingo.commons.api.edm.provider.TypeDefinition; import org.apache.olingo.commons.core.edm.AbstractEdmTypeDefinition; import org.apache.olingo.commons.core.edm.EdmAnnotationHelper; import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/annotation/EdmCastImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/annotation/EdmCastImpl.java index 68a9d6698..6d510a557 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/annotation/EdmCastImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/annotation/EdmCastImpl.java @@ -18,12 +18,12 @@ */ package org.apache.olingo.client.core.edm.annotation; -import org.apache.olingo.client.api.edm.xml.annotation.Cast; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.commons.api.edm.annotation.EdmCast; import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression; import org.apache.olingo.commons.api.edm.geo.SRID; +import org.apache.olingo.commons.api.edm.provider.annotation.Cast; import org.apache.olingo.commons.core.edm.EdmTypeInfo; import org.apache.olingo.commons.core.edm.annotation.AbstractEdmAnnotatableDynamicAnnotationExpression; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/annotation/EdmConstantAnnotationExpressionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/annotation/EdmConstantAnnotationExpressionImpl.java index d97354537..397163a0c 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/annotation/EdmConstantAnnotationExpressionImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/annotation/EdmConstantAnnotationExpressionImpl.java @@ -22,7 +22,6 @@ import java.util.ArrayList; import java.util.List; import org.apache.commons.lang3.StringUtils; -import org.apache.olingo.client.api.edm.xml.annotation.ConstantAnnotationExpression; import org.apache.olingo.commons.api.Constants; import org.apache.olingo.commons.api.domain.ODataEnumValue; import org.apache.olingo.commons.api.domain.ODataValue; @@ -31,6 +30,7 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.annotation.EdmConstantAnnotationExpression; import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression; +import org.apache.olingo.commons.api.edm.provider.annotation.ConstantAnnotationExpression; import org.apache.olingo.commons.core.domain.ODataCollectionValueImpl; import org.apache.olingo.commons.core.domain.ODataEnumValueImpl; import org.apache.olingo.commons.core.domain.ODataPrimitiveValueImpl; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/annotation/EdmIsOfImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/annotation/EdmIsOfImpl.java index 8ff4757c0..b732d3498 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/annotation/EdmIsOfImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/annotation/EdmIsOfImpl.java @@ -18,12 +18,12 @@ */ package org.apache.olingo.client.core.edm.annotation; -import org.apache.olingo.client.api.edm.xml.annotation.IsOf; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression; import org.apache.olingo.commons.api.edm.annotation.EdmIsOf; import org.apache.olingo.commons.api.edm.geo.SRID; +import org.apache.olingo.commons.api.edm.provider.annotation.IsOf; import org.apache.olingo.commons.core.edm.EdmTypeInfo; import org.apache.olingo.commons.core.edm.annotation.AbstractEdmAnnotatableDynamicAnnotationExpression; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractStructuralType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractStructuralType.java deleted file mode 100644 index a8d0401b5..000000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractStructuralType.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml; - -import org.apache.olingo.client.api.edm.xml.NavigationProperty; -import org.apache.olingo.client.api.edm.xml.Property; -import org.apache.olingo.client.api.edm.xml.StructuralType; - -public abstract class AbstractStructuralType extends AbstractEdmItem implements StructuralType { - - private static final long serialVersionUID = 1137297128124390440L; - - private String name; - - @Override - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; - } - - @Override - public Property getProperty(final String name) { - return getOneByName(name, getProperties()); - } - - @Override - public NavigationProperty getNavigationProperty(final String name) { - return getOneByName(name, getNavigationProperties()); - } -} diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ActionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ActionImpl.java index b73a97b2d..4496daa9a 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ActionImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ActionImpl.java @@ -18,82 +18,12 @@ */ package org.apache.olingo.client.core.edm.xml; -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.client.api.edm.xml.Action; -import org.apache.olingo.client.api.edm.xml.Annotation; -import org.apache.olingo.client.api.edm.xml.Parameter; -import org.apache.olingo.client.api.edm.xml.ReturnType; +import org.apache.olingo.commons.api.edm.provider.Action; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @JsonDeserialize(using = ActionDeserializer.class) -public class ActionImpl extends AbstractEdmItem implements Action { +public class ActionImpl extends Action { private static final long serialVersionUID = 5321541275349234088L; - - private String name; - - private boolean bound = false; - - private String entitySetPath; - - private final List parameters = new ArrayList(); - - private ReturnType returnType; - - private final List annotations = new ArrayList(); - - @Override - public List getAnnotations() { - return annotations; - } - - @Override - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; - } - - @Override - public boolean isBound() { - return bound; - } - - public void setBound(final boolean bound) { - this.bound = bound; - } - - @Override - public String getEntitySetPath() { - return entitySetPath; - } - - public void setEntitySetPath(final String entitySetPath) { - this.entitySetPath = entitySetPath; - } - - @Override - public Parameter getParameter(final String name) { - return getOneByName(name, getParameters()); - } - - @Override - public List getParameters() { - return parameters; - } - - @Override - public ReturnType getReturnType() { - return returnType; - } - - public void setReturnType(final ReturnType returnType) { - this.returnType = returnType; - } - } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ActionImportImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ActionImportImpl.java index cdfc650ba..318786893 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ActionImportImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ActionImportImpl.java @@ -1,77 +1,51 @@ /* * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file + * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file + * 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 - * + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.olingo.client.core.edm.xml; -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.client.api.edm.xml.ActionImport; -import org.apache.olingo.client.api.edm.xml.Annotation; +import org.apache.olingo.commons.api.edm.provider.ActionImport; import com.fasterxml.jackson.annotation.JsonProperty; -public class ActionImportImpl extends AbstractEdmItem implements ActionImport { +public class ActionImportImpl extends ActionImport { private static final long serialVersionUID = 2971468441177647068L; - @JsonProperty(value = "Name", required = true) - private String name; - - @JsonProperty(value = "Action", required = true) - private String action; - - @JsonProperty(value = "EntitySet") - private String entitySet; - - private final List annotations = new ArrayList(); - @Override - public List getAnnotations() { - return annotations; + @JsonProperty(value = "Action", required = true) + public ActionImport setAction(final String action) { + super.setAction(action); + return this; } @Override - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; + @JsonProperty(value = "Name", required = true) + public ActionImport setName(final String name) { + super.setName(name); + return this; } @Override - public String getAction() { - return action; - } - - public void setAction(final String action) { - this.action = action; - } - - @Override - public String getEntitySet() { - return entitySet; - } - - @Override - public void setEntitySet(final String entitySet) { - this.entitySet = entitySet; + @JsonProperty(value = "EntitySet") + public ActionImport setEntitySet(final String entitySet) { + super.setEntitySet(entitySet); + return this; } + } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationImpl.java index 1489f2ed2..c482877fd 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationImpl.java @@ -21,13 +21,13 @@ package org.apache.olingo.client.core.edm.xml; import java.util.ArrayList; import java.util.List; -import org.apache.olingo.client.api.edm.xml.Annotation; -import org.apache.olingo.client.api.edm.xml.annotation.AnnotationExpression; +import org.apache.olingo.commons.api.edm.provider.Annotation; +import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @JsonDeserialize(using = AnnotationDeserializer.class) -public class AnnotationImpl extends AbstractEdmItem implements Annotation { +public class AnnotationImpl extends Annotation { private static final long serialVersionUID = 5464714417411058033L; @@ -49,8 +49,9 @@ public class AnnotationImpl extends AbstractEdmItem implements Annotation { return term; } - public void setTerm(final String term) { + public AnnotationImpl setTerm(final String term) { this.term = term; + return this; } @Override @@ -58,8 +59,9 @@ public class AnnotationImpl extends AbstractEdmItem implements Annotation { return qualifier; } - public void setQualifier(final String qualifier) { + public AnnotationImpl setQualifier(final String qualifier) { this.qualifier = qualifier; + return this; } @Override diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationsImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationsImpl.java index e5450fe3e..053fdf21c 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationsImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationsImpl.java @@ -18,59 +18,13 @@ */ package org.apache.olingo.client.core.edm.xml; -import java.util.ArrayList; -import java.util.List; +import org.apache.olingo.commons.api.edm.provider.Annotations; -import org.apache.olingo.client.api.edm.xml.Annotation; -import org.apache.olingo.client.api.edm.xml.Annotations; - -import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @JsonDeserialize(using = AnnotationsDeserializer.class) -public class AnnotationsImpl extends AbstractEdmItem implements Annotations { +public class AnnotationsImpl extends Annotations { private static final long serialVersionUID = -5961207981571644200L; - private final List annotations = new ArrayList(); - - @JsonProperty(value = "Target", required = true) - private String target; - - @JsonProperty("Qualifier") - private String qualifier; - - @Override - public String getTarget() { - return target; - } - - public void setTarget(final String target) { - this.target = target; - } - - @Override - public String getQualifier() { - return qualifier; - } - - public void setQualifier(final String qualifier) { - this.qualifier = qualifier; - } - - @Override - public List getAnnotations() { - return annotations; - } - - @Override - public Annotation getAnnotation(final String term) { - Annotation result = null; - for (Annotation annotation : getAnnotations()) { - if (term.equals(annotation.getTerm())) { - result = annotation; - } - } - return result; - } } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeDeserializer.java index fe143ec0c..65077dc24 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeDeserializer.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeDeserializer.java @@ -27,10 +27,10 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; -public class ComplexTypeDeserializer extends AbstractEdmDeserializer { +public class ComplexTypeDeserializer extends AbstractEdmDeserializer { @Override - protected AbstractStructuralType doDeserialize(final JsonParser jp, final DeserializationContext ctxt) + protected ComplexTypeImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException, JsonProcessingException { final ComplexTypeImpl complexType = new ComplexTypeImpl(); @@ -41,7 +41,7 @@ public class ComplexTypeDeserializer extends AbstractEdmDeserializer properties = new ArrayList(); - - private final List navigationProperties = new ArrayList(); - - private final List annotations = new ArrayList(); - - @Override - public boolean isAbstractType() { - return abstractEntityType; - } - - public void setAbstractEntityType(final boolean abstractEntityType) { - this.abstractEntityType = abstractEntityType; - } - - @Override - public String getBaseType() { - return baseType; - } - - public void setBaseType(final String baseType) { - this.baseType = baseType; - } - - @Override - public boolean isOpenType() { - return openType; - } - - public void setOpenType(final boolean openType) { - this.openType = openType; - } - - @Override - public Property getProperty(final String name) { - return super.getProperty(name); - } - - @Override - public List getProperties() { - return properties; - } - - @Override - public NavigationProperty getNavigationProperty(final String name) { - return super.getNavigationProperty(name); - } - - @Override - public List getNavigationProperties() { - return navigationProperties; - } - - @Override - public List getAnnotations() { - return annotations; - } - } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesImpl.java index 00460a7bc..208f77bc8 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesImpl.java @@ -22,7 +22,8 @@ import java.util.ArrayList; import java.util.List; import org.apache.olingo.client.api.edm.xml.DataServices; -import org.apache.olingo.client.api.edm.xml.Schema; +import org.apache.olingo.commons.api.edm.provider.AbstractEdmItem; +import org.apache.olingo.commons.api.edm.provider.Schema; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxImpl.java index eaa658ab1..583670424 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxImpl.java @@ -24,6 +24,7 @@ import java.util.List; import org.apache.olingo.client.api.edm.xml.DataServices; import org.apache.olingo.client.api.edm.xml.Edmx; import org.apache.olingo.client.api.edm.xml.Reference; +import org.apache.olingo.commons.api.edm.provider.AbstractEdmItem; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerDeserializer.java index 3a308e09b..c778f4394 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerDeserializer.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerDeserializer.java @@ -20,8 +20,6 @@ package org.apache.olingo.client.core.edm.xml; import java.io.IOException; -import org.apache.commons.lang3.BooleanUtils; - import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonToken; @@ -41,9 +39,7 @@ public class EntityContainerDeserializer extends AbstractEdmDeserializer entitySets = new ArrayList(); - - private final List singletons = new ArrayList(); - - private final List actionImports = new ArrayList(); - - private final List functionImports = new ArrayList(); - - private final List annotations = new ArrayList(); - - private String name; - - private String _extends; - - private boolean lazyLoadingEnabled; - - @Override - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; - } - - @Override - public String getExtends() { - return _extends; - } - - public void setExtends(final String _extends) { - this._extends = _extends; - } - - @Override - public boolean isLazyLoadingEnabled() { - return lazyLoadingEnabled; - } - - public void setLazyLoadingEnabled(final boolean lazyLoadingEnabled) { - this.lazyLoadingEnabled = lazyLoadingEnabled; - } - - @Override - public EntitySet getEntitySet(final String name) { - return getOneByName(name, getEntitySets()); - } - - /** - * Gets the first function import with given name. - * - * @param name name. - * @return function import. - */ - @Override - public FunctionImport getFunctionImport(final String name) { - return getOneByName(name, getFunctionImports()); - } - - /** - * Gets all function imports with given name. - * - * @param name name. - * @return function imports. - */ - @Override - public List getFunctionImports(final String name) { - return getAllByName(name, getFunctionImports()); - } - - //TODO: No default container in V4 so we should delete this. - @Override - public boolean isDefaultEntityContainer() { - return true; - } - - @Override - public List getEntitySets() { - return entitySets; - } - - @Override - public List getSingletons() { - return singletons; - } - - @Override - public Singleton getSingleton(final String name) { - return getOneByName(name, getSingletons()); - } - - /** - * Gets the first action import with given name. - * - * @param name name. - * @return action import. - */ - @Override - public ActionImport getActionImport(final String name) { - return getOneByName(name, getActionImports()); - } - - /** - * Gets all action imports with given name. - * - * @param name name. - * @return action imports. - */ - @Override - public List getActionImports(final String name) { - return getAllByName(name, getActionImports()); - } - - @Override - public List getActionImports() { - return actionImports; - } - - @Override - public List getFunctionImports() { - return functionImports; - } - - @Override - public List getAnnotations() { - return annotations; - } - } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityKeyDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityKeyDeserializer.java index e44a09f5e..561c3ec9a 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityKeyDeserializer.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityKeyDeserializer.java @@ -38,7 +38,7 @@ public class EntityKeyDeserializer extends AbstractEdmDeserializer propertyRefs = new ArrayList(); - @Override public List getPropertyRefs() { return propertyRefs; } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetDeserializer.java index bae65b3d0..53cec31e7 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetDeserializer.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetDeserializer.java @@ -21,7 +21,7 @@ package org.apache.olingo.client.core.edm.xml; import java.io.IOException; import org.apache.commons.lang3.BooleanUtils; -import org.apache.olingo.client.api.edm.xml.EntitySet; +import org.apache.olingo.commons.api.edm.provider.EntitySet; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; @@ -42,7 +42,7 @@ public class EntitySetDeserializer extends AbstractEdmDeserializer { if ("Name".equals(jp.getCurrentName())) { entitySet.setName(jp.nextTextValue()); } else if ("EntityType".equals(jp.getCurrentName())) { - entitySet.setEntityType(jp.nextTextValue()); + entitySet.setType(jp.nextTextValue()); } else if ("IncludeInServiceDocument".equals(jp.getCurrentName())) { entitySet.setIncludeInServiceDocument(BooleanUtils.toBoolean(jp.nextTextValue())); } else if ("NavigationPropertyBinding".equals(jp.getCurrentName())) { diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetImpl.java index 078af9b62..d27b5a5e2 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetImpl.java @@ -18,65 +18,13 @@ */ package org.apache.olingo.client.core.edm.xml; -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.client.api.edm.xml.Annotation; -import org.apache.olingo.client.api.edm.xml.EntitySet; -import org.apache.olingo.client.api.edm.xml.NavigationPropertyBinding; +import org.apache.olingo.commons.api.edm.provider.EntitySet; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @JsonDeserialize(using = EntitySetDeserializer.class) -public class EntitySetImpl extends AbstractEdmItem implements EntitySet { +public class EntitySetImpl extends EntitySet { private static final long serialVersionUID = -5553885465204370676L; - private boolean includeInServiceDocument = true; - - private final List annotations = new ArrayList(); - - private final List navigationPropertyBindings = new ArrayList(); - - private String name; - - private String entityType; - - @Override - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; - } - - @Override - public String getEntityType() { - return entityType; - } - - public void setEntityType(final String entityType) { - this.entityType = entityType; - } - - @Override - public boolean isIncludeInServiceDocument() { - return includeInServiceDocument; - } - - public void setIncludeInServiceDocument(final boolean includeInServiceDocument) { - this.includeInServiceDocument = includeInServiceDocument; - } - - @Override - public List getNavigationPropertyBindings() { - return navigationPropertyBindings; - } - - @Override - public List getAnnotations() { - return annotations; - } - } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeDeserializer.java index c1639b3dc..df30d0747 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeDeserializer.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeDeserializer.java @@ -21,7 +21,7 @@ package org.apache.olingo.client.core.edm.xml; import java.io.IOException; import org.apache.commons.lang3.BooleanUtils; -import org.apache.olingo.client.api.edm.xml.EntityType; +import org.apache.olingo.commons.api.edm.provider.EntityType; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; @@ -42,7 +42,7 @@ public class EntityTypeDeserializer extends AbstractEdmDeserializer if ("Name".equals(jp.getCurrentName())) { entityType.setName(jp.nextTextValue()); } else if ("Abstract".equals(jp.getCurrentName())) { - entityType.setAbstractEntityType(BooleanUtils.toBoolean(jp.nextTextValue())); + entityType.setAbstract(BooleanUtils.toBoolean(jp.nextTextValue())); } else if ("BaseType".equals(jp.getCurrentName())) { entityType.setBaseType(jp.nextTextValue()); } else if ("OpenType".equals(jp.getCurrentName())) { @@ -51,7 +51,8 @@ public class EntityTypeDeserializer extends AbstractEdmDeserializer entityType.setHasStream(BooleanUtils.toBoolean(jp.nextTextValue())); } else if ("Key".equals(jp.getCurrentName())) { jp.nextToken(); - entityType.setKey(jp.readValueAs(EntityKeyImpl.class)); + EntityKeyImpl keyImpl = jp.readValueAs(EntityKeyImpl.class); + entityType.setKey(keyImpl.getPropertyRefs()); } else if ("Property".equals(jp.getCurrentName())) { jp.nextToken(); entityType.getProperties().add(jp.readValueAs(PropertyImpl.class)); diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeImpl.java index 217747de0..548e11296 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeImpl.java @@ -18,106 +18,12 @@ */ package org.apache.olingo.client.core.edm.xml; -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.client.api.edm.xml.Annotation; -import org.apache.olingo.client.api.edm.xml.EntityKey; -import org.apache.olingo.client.api.edm.xml.EntityType; -import org.apache.olingo.client.api.edm.xml.NavigationProperty; -import org.apache.olingo.client.api.edm.xml.Property; +import org.apache.olingo.commons.api.edm.provider.EntityType; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @JsonDeserialize(using = EntityTypeDeserializer.class) -public class EntityTypeImpl extends AbstractStructuralType implements EntityType { +public class EntityTypeImpl extends EntityType { private static final long serialVersionUID = -3986417775876689669L; - - private final List properties = new ArrayList(); - - private final List navigationProperties = new ArrayList(); - - private final List annotations = new ArrayList(); - - private boolean abstractEntityType = false; - - private String baseType; - - private boolean openType = false; - - private boolean hasStream = false; - - private EntityKeyImpl key; - - @Override - public boolean isAbstractType() { - return abstractEntityType; - } - - public void setAbstractEntityType(final boolean abstractEntityType) { - this.abstractEntityType = abstractEntityType; - } - - @Override - public String getBaseType() { - return baseType; - } - - public void setBaseType(final String baseType) { - this.baseType = baseType; - } - - @Override - public boolean isOpenType() { - return openType; - } - - public void setOpenType(final boolean openType) { - this.openType = openType; - } - - @Override - public EntityKeyImpl getKey() { - return key; - } - - public void setKey(final EntityKey key) { - this.key = (EntityKeyImpl) key; - } - - @Override - public boolean isHasStream() { - return hasStream; - } - - public void setHasStream(final boolean hasStream) { - this.hasStream = hasStream; - } - - @Override - public Property getProperty(final String name) { - return super.getProperty(name); - } - - @Override - public List getProperties() { - return properties; - } - - @Override - public NavigationProperty getNavigationProperty(final String name) { - return super.getNavigationProperty(name); - } - - @Override - public List getNavigationProperties() { - return navigationProperties; - } - - @Override - public List getAnnotations() { - return annotations; - } - } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumMemberImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumMemberImpl.java new file mode 100644 index 000000000..7af81715e --- /dev/null +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumMemberImpl.java @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.client.core.edm.xml; + +import org.apache.olingo.commons.api.edm.provider.EnumMember; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class EnumMemberImpl extends EnumMember { + + private static final long serialVersionUID = -6138606817225829791L; + + @Override + @JsonProperty(value = "Name", required = true) + public EnumMember setName(final String name) { + super.setName(name); + return this; + } + + @Override + @JsonProperty("Value") + public EnumMember setValue(final String value) { + super.setValue(value); + return this; + } + +} diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeDeserializer.java index 8559813ca..0f6033a08 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeDeserializer.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeDeserializer.java @@ -46,7 +46,7 @@ public class EnumTypeDeserializer extends AbstractEdmDeserializer enumType.setFlags(BooleanUtils.toBoolean(jp.nextTextValue())); } else if ("Member".equals(jp.getCurrentName())) { jp.nextToken(); - enumType.getMembers().add(jp.readValueAs(MemberImpl.class)); + enumType.getMembers().add(jp.readValueAs(EnumMemberImpl.class)); } else if ("Annotation".equals(jp.getCurrentName())) { jp.nextToken(); enumType.getAnnotations().add(jp.readValueAs(AnnotationImpl.class)); diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeImpl.java index a95ff1a8e..5b01a3f7b 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeImpl.java @@ -18,88 +18,13 @@ */ package org.apache.olingo.client.core.edm.xml; -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.client.api.edm.xml.Annotatable; -import org.apache.olingo.client.api.edm.xml.Annotation; -import org.apache.olingo.client.api.edm.xml.EnumType; -import org.apache.olingo.client.api.edm.xml.Member; +import org.apache.olingo.commons.api.edm.provider.EnumType; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @JsonDeserialize(using = EnumTypeDeserializer.class) -public class EnumTypeImpl extends AbstractEdmItem implements EnumType, Annotatable { +public class EnumTypeImpl extends EnumType { private static final long serialVersionUID = 9191189755592743333L; - private final List annotations = new ArrayList(); - - private String name; - - private String underlyingType; - - private boolean flags; - - private final List members = new ArrayList(); - - @Override - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; - } - - @Override - public String getUnderlyingType() { - return underlyingType; - } - - public void setUnderlyingType(final String underlyingType) { - this.underlyingType = underlyingType; - } - - @Override - public boolean isFlags() { - return flags; - } - - public void setFlags(final boolean flags) { - this.flags = flags; - } - - @Override - public Member getMember(final String name) { - Member result = null; - for (Member member : getMembers()) { - if (name.equals(member.getName())) { - result = member; - } - } - return result; - } - - @Override - public Member getMember(final Integer value) { - Member result = null; - for (Member member : getMembers()) { - if (String.valueOf(value).equals(member.getValue())) { - result = member; - } - } - return result; - } - - @Override - public List getMembers() { - return members; - } - - @Override - public List getAnnotations() { - return annotations; - } - } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionImpl.java index 9c67d0970..b795cb69c 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionImpl.java @@ -18,24 +18,13 @@ */ package org.apache.olingo.client.core.edm.xml; -import org.apache.olingo.client.api.edm.xml.Function; +import org.apache.olingo.commons.api.edm.provider.Function; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @JsonDeserialize(using = FunctionDeserializer.class) -public class FunctionImpl extends ActionImpl implements Function { +public class FunctionImpl extends Function { private static final long serialVersionUID = -5494898295282843362L; - private boolean composable = false; - - @Override - public boolean isComposable() { - return composable; - } - - public void setComposable(final boolean composable) { - this.composable = composable; - } - } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionImportImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionImportImpl.java index 21b0d122a..460c94ccf 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionImportImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionImportImpl.java @@ -18,69 +18,12 @@ */ package org.apache.olingo.client.core.edm.xml; -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.client.api.edm.xml.Annotation; -import org.apache.olingo.client.api.edm.xml.FunctionImport; +import org.apache.olingo.commons.api.edm.provider.FunctionImport; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @JsonDeserialize(using = FunctionImportDeserializer.class) -public class FunctionImportImpl implements FunctionImport { +public class FunctionImportImpl extends FunctionImport { private static final long serialVersionUID = -1686801084142932402L; - - private String name; - - private String function; - - private String entitySet; - - private boolean includeInServiceDocument = false; - - private final List annotations = new ArrayList(); - - @Override - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; - } - - @Override - public String getFunction() { - return function; - } - - public void setFunction(final String function) { - this.function = function; - } - - @Override - public String getEntitySet() { - return entitySet; - } - - @Override - public void setEntitySet(final String entitySet) { - this.entitySet = entitySet; - } - - @Override - public boolean isIncludeInServiceDocument() { - return includeInServiceDocument; - } - - public void setIncludeInServiceDocument(final boolean includeInServiceDocument) { - this.includeInServiceDocument = includeInServiceDocument; - } - - @Override - public List getAnnotations() { - return annotations; - } - } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/IncludeAnnotationsImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/IncludeAnnotationsImpl.java index 03cd3e67f..f5d7ed73f 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/IncludeAnnotationsImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/IncludeAnnotationsImpl.java @@ -19,6 +19,7 @@ package org.apache.olingo.client.core.edm.xml; import org.apache.olingo.client.api.edm.xml.IncludeAnnotations; +import org.apache.olingo.commons.api.edm.provider.AbstractEdmItem; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/IncludeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/IncludeImpl.java index 69062579b..973e27f3f 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/IncludeImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/IncludeImpl.java @@ -19,6 +19,7 @@ package org.apache.olingo.client.core.edm.xml; import org.apache.olingo.client.api.edm.xml.Include; +import org.apache.olingo.commons.api.edm.provider.AbstractEdmItem; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/MemberImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/MemberImpl.java deleted file mode 100644 index 2221804f3..000000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/MemberImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.client.api.edm.xml.Annotatable; -import org.apache.olingo.client.api.edm.xml.Annotation; -import org.apache.olingo.client.api.edm.xml.Member; - -import com.fasterxml.jackson.annotation.JsonProperty; - -public class MemberImpl extends AbstractEdmItem implements Member, Annotatable { - - private static final long serialVersionUID = -6138606817225829791L; - - private final List annotations = new ArrayList(); - - @JsonProperty(value = "Name", required = true) - private String name; - - @JsonProperty("Value") - private String value; - - @Override - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; - } - - @Override - public String getValue() { - return value; - } - - public void setValue(final String value) { - this.value = value; - } - - @Override - public List getAnnotations() { - return annotations; - } - -} diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyBindingImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyBindingImpl.java index 283b0d5fc..cded45dd8 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyBindingImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyBindingImpl.java @@ -1,53 +1,42 @@ /* * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file + * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file + * 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 - * + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.olingo.client.core.edm.xml; -import org.apache.olingo.client.api.edm.xml.NavigationPropertyBinding; +import org.apache.olingo.commons.api.edm.provider.NavigationPropertyBinding; import com.fasterxml.jackson.annotation.JsonProperty; -public class NavigationPropertyBindingImpl extends AbstractEdmItem implements NavigationPropertyBinding { +public class NavigationPropertyBindingImpl extends NavigationPropertyBinding { private static final long serialVersionUID = -7056978592235483660L; + @Override @JsonProperty(value = "Path", required = true) - private String path; + public NavigationPropertyBinding setPath(final String path) { + super.setPath(path); + return this; + } + @Override @JsonProperty(value = "Target", required = true) - private String target; - - @Override - public String getPath() { - return path; + public NavigationPropertyBinding setTarget(final String target) { + super.setTarget(target); + return this; } - - public void setPath(final String path) { - this.path = path; - } - - @Override - public String getTarget() { - return target; - } - - public void setTarget(final String target) { - this.target = target; - } - } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyImpl.java index 75b366e5c..072f3e9b9 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyImpl.java @@ -1,119 +1,44 @@ /* * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file + * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file + * 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 - * + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.olingo.client.core.edm.xml; -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.client.api.edm.xml.Annotation; -import org.apache.olingo.client.api.edm.xml.NavigationProperty; -import org.apache.olingo.client.api.edm.xml.OnDelete; -import org.apache.olingo.client.api.edm.xml.ReferentialConstraint; +import org.apache.olingo.commons.api.edm.provider.NavigationProperty; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @JsonDeserialize(using = NavigationPropertyDeserializer.class) -public class NavigationPropertyImpl extends AbstractEdmItem implements NavigationProperty { +public class NavigationPropertyImpl extends NavigationProperty { private static final long serialVersionUID = 6240231735592427582L; + @Override @JsonProperty(value = "Name", required = true) - private String name; - + public NavigationProperty setName(final String name) { + super.setName(name); + return this; + } + + @Override @JsonProperty(value = "ContainsTarget") - private boolean containsTarget = false; - - private String type; - - private boolean nullable = true; - - private String partner; - - private final List referentialConstraints = new ArrayList(); - - private OnDelete onDelete; - - private final List annotations = new ArrayList(); - - @Override - public String getType() { - return type; + public NavigationProperty setContainsTarget(final boolean containsTarget) { + super.setContainsTarget(containsTarget); + return this; } - - public void setType(final String type) { - this.type = type; - } - - @Override - public boolean isNullable() { - return nullable; - } - - public void setNullable(final boolean nullable) { - this.nullable = nullable; - } - - @Override - public String getPartner() { - return partner; - } - - public void setPartner(final String partner) { - this.partner = partner; - } - - @Override - public List getReferentialConstraints() { - return referentialConstraints; - } - - @Override - public OnDelete getOnDelete() { - return onDelete; - } - - public void setOnDelete(final OnDelete onDelete) { - this.onDelete = onDelete; - } - - @Override - public List getAnnotations() { - return annotations; - } - - @Override - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; - } - - @Override - public boolean isContainsTarget() { - return containsTarget; - } - - public void setContainsTarget(final boolean containsTarget) { - this.containsTarget = containsTarget; - } - } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/OnDeleteImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/OnDeleteImpl.java index 81b476c60..9062e016b 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/OnDeleteImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/OnDeleteImpl.java @@ -18,25 +18,19 @@ */ package org.apache.olingo.client.core.edm.xml; -import org.apache.olingo.client.api.edm.xml.OnDelete; -import org.apache.olingo.client.api.edm.xml.OnDeleteAction; +import org.apache.olingo.commons.api.edm.provider.OnDelete; +import org.apache.olingo.commons.api.edm.provider.OnDeleteAction; import com.fasterxml.jackson.annotation.JsonProperty; -public class OnDeleteImpl extends AbstractEdmItem implements OnDelete { +public class OnDeleteImpl extends OnDelete { private static final long serialVersionUID = -7130889202653716784L; - @JsonProperty(value = "Action", required = true) - private OnDeleteAction action = OnDeleteAction.None; - @Override - public OnDeleteAction getAction() { - return action; + @JsonProperty(value = "Action", required = true) + public OnDelete setAction(final OnDeleteAction action) { + super.setAction(action); + return this; } - - public void setAction(final OnDeleteAction action) { - this.action = action; - } - } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterImpl.java index 4fc1a20aa..e7f74dbc2 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterImpl.java @@ -18,102 +18,12 @@ */ package org.apache.olingo.client.core.edm.xml; -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.client.api.edm.xml.Annotation; -import org.apache.olingo.client.api.edm.xml.Parameter; -import org.apache.olingo.commons.api.edm.geo.SRID; +import org.apache.olingo.commons.api.edm.provider.Parameter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @JsonDeserialize(using = ParameterDeserializer.class) -public class ParameterImpl extends AbstractEdmItem implements Parameter { +public class ParameterImpl extends Parameter { private static final long serialVersionUID = 7119478691341167904L; - - private SRID srid; - - private final List annotations = new ArrayList(); - - private String name; - - private String type; - - private boolean nullable = true; - - private Integer maxLength; - - private Integer precision; - - private Integer scale; - - @Override - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; - } - - @Override - public String getType() { - return type; - } - - public void setType(final String type) { - this.type = type; - } - - @Override - public boolean isNullable() { - return nullable; - } - - public void setNullable(final boolean nullable) { - this.nullable = nullable; - } - - @Override - public Integer getMaxLength() { - return maxLength; - } - - public void setMaxLength(final Integer maxLength) { - this.maxLength = maxLength; - } - - @Override - public Integer getPrecision() { - return precision; - } - - public void setPrecision(final Integer precision) { - this.precision = precision; - } - - @Override - public Integer getScale() { - return scale; - } - - public void setScale(final Integer scale) { - this.scale = scale; - } - - @Override - public SRID getSrid() { - return srid; - } - - public void setSrid(final SRID srid) { - this.srid = srid; - } - - @Override - public List getAnnotations() { - return annotations; - } - } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyImpl.java index 17a6b7c2f..697fd9cc6 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyImpl.java @@ -18,123 +18,11 @@ */ package org.apache.olingo.client.core.edm.xml; -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.client.api.edm.xml.Annotation; -import org.apache.olingo.client.api.edm.xml.Property; -import org.apache.olingo.commons.api.edm.geo.SRID; - import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @JsonDeserialize(using = PropertyDeserializer.class) -public class PropertyImpl extends AbstractEdmItem implements Property { +public class PropertyImpl extends org.apache.olingo.commons.api.edm.provider.Property { - private static final long serialVersionUID = 4544336801968719526L; + private static final long serialVersionUID = -4521766603286651372L; - private final List annotations = new ArrayList(); - - private String name; - - private String type; - - private boolean nullable = true; - - private String defaultValue; - - private Integer maxLength; - - private Integer precision; - - private Integer scale; - - private boolean unicode = true; - - private SRID srid; - - @Override - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; - } - - @Override - public String getType() { - return type; - } - - public void setType(final String type) { - this.type = type; - } - - @Override - public boolean isNullable() { - return nullable; - } - - public void setNullable(final boolean nullable) { - this.nullable = nullable; - } - - @Override - public String getDefaultValue() { - return defaultValue; - } - - public void setDefaultValue(final String defaultValue) { - this.defaultValue = defaultValue; - } - - @Override - public Integer getMaxLength() { - return maxLength; - } - - public void setMaxLength(final Integer maxLength) { - this.maxLength = maxLength; - } - - @Override - public Integer getPrecision() { - return precision; - } - - public void setPrecision(final Integer precision) { - this.precision = precision; - } - - @Override - public Integer getScale() { - return scale; - } - - public void setScale(final Integer scale) { - this.scale = scale; - } - - @Override - public boolean isUnicode() { - return unicode; - } - - public void setUnicode(final boolean unicode) { - this.unicode = unicode; - } - - @Override - public SRID getSrid() { - return srid; - } - - public void setSrid(final SRID srid) { - this.srid = srid; - } - - @Override - public List getAnnotations() { - return annotations; - } } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyRefImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyRefImpl.java index 011b30ab0..5b3a41c8f 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyRefImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyRefImpl.java @@ -1,53 +1,42 @@ /* * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file + * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file + * 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 - * + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.olingo.client.core.edm.xml; -import org.apache.olingo.client.api.edm.xml.PropertyRef; +import org.apache.olingo.commons.api.edm.provider.PropertyRef; import com.fasterxml.jackson.annotation.JsonProperty; -public class PropertyRefImpl extends AbstractEdmItem implements PropertyRef { +public class PropertyRefImpl extends PropertyRef { private static final long serialVersionUID = 1504095609268590326L; + @Override @JsonProperty(value = "Name", required = true) - private String name; + public PropertyRef setName(final String name) { + super.setName(name); + return this; + } + @Override @JsonProperty(value = "Alias") - private String alias; - - @Override - public String getName() { - return name; + public PropertyRef setAlias(final String alias) { + super.setAlias(alias); + return this; } - - public void setName(final String name) { - this.name = name; - } - - @Override - public String getAlias() { - return alias; - } - - public void setAlias(final String alias) { - this.alias = alias; - } - } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferenceImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferenceImpl.java index ab7a4d80b..8a90c6112 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferenceImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferenceImpl.java @@ -22,10 +22,11 @@ import java.net.URI; import java.util.ArrayList; import java.util.List; -import org.apache.olingo.client.api.edm.xml.Annotation; import org.apache.olingo.client.api.edm.xml.Include; import org.apache.olingo.client.api.edm.xml.IncludeAnnotations; import org.apache.olingo.client.api.edm.xml.Reference; +import org.apache.olingo.commons.api.edm.provider.AbstractEdmItem; +import org.apache.olingo.commons.api.edm.provider.Annotation; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferentialConstraintImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferentialConstraintImpl.java index fd34fce5c..8e7dfbb11 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferentialConstraintImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferentialConstraintImpl.java @@ -1,64 +1,43 @@ /* * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file + * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file + * 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 - * + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.olingo.client.core.edm.xml; -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.client.api.edm.xml.Annotation; -import org.apache.olingo.client.api.edm.xml.ReferentialConstraint; +import org.apache.olingo.commons.api.edm.provider.ReferentialConstraint; import com.fasterxml.jackson.annotation.JsonProperty; -public class ReferentialConstraintImpl extends AbstractEdmItem implements ReferentialConstraint { +public class ReferentialConstraintImpl extends ReferentialConstraint { private static final long serialVersionUID = -5822115908069878139L; + @Override @JsonProperty(value = "Property", required = true) - private String property; + public ReferentialConstraint setProperty(final String property) { + super.setProperty(property); + return this; + } + @Override @JsonProperty(value = "ReferencedProperty", required = true) - private String referencedProperty; - - private final List annotations = new ArrayList(); - - @Override - public List getAnnotations() { - return annotations; - } - - @Override - public String getProperty() { - return property; - } - - public void setProperty(final String property) { - this.property = property; - } - - @Override - public String getReferencedProperty() { - return referencedProperty; - } - - public void setReferencedProperty(final String referencedProperty) { - this.referencedProperty = referencedProperty; + public ReferentialConstraint setReferencedProperty(final String referencedProperty) { + super.setReferencedProperty(referencedProperty); + return this; } } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReturnTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReturnTypeImpl.java index 113543793..69cd715ef 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReturnTypeImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReturnTypeImpl.java @@ -18,80 +18,12 @@ */ package org.apache.olingo.client.core.edm.xml; -import org.apache.olingo.client.api.edm.xml.ReturnType; -import org.apache.olingo.commons.api.edm.geo.SRID; +import org.apache.olingo.commons.api.edm.provider.ReturnType; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @JsonDeserialize(using = ReturnTypeDeserializer.class) -public class ReturnTypeImpl extends AbstractEdmItem implements ReturnType { +public class ReturnTypeImpl extends ReturnType { private static final long serialVersionUID = 6261092793901735110L; - - private String type; - - private boolean nullable = true; - - private Integer maxLength; - - private Integer precision; - - private Integer scale; - - private SRID srid; - - @Override - public String getType() { - return type; - } - - public void setType(final String type) { - this.type = type; - } - - @Override - public boolean isNullable() { - return nullable; - } - - public void setNullable(final boolean nullable) { - this.nullable = nullable; - } - - @Override - public Integer getMaxLength() { - return maxLength; - } - - public void setMaxLength(final Integer maxLength) { - this.maxLength = maxLength; - } - - @Override - public Integer getPrecision() { - return precision; - } - - public void setPrecision(final Integer precision) { - this.precision = precision; - } - - @Override - public Integer getScale() { - return scale; - } - - public void setScale(final Integer scale) { - this.scale = scale; - } - - @Override - public SRID getSrid() { - return srid; - } - - public void setSrid(final SRID srid) { - this.srid = srid; - } - } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaImpl.java index 77b741228..f1b4f93ff 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaImpl.java @@ -18,261 +18,13 @@ */ package org.apache.olingo.client.core.edm.xml; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.olingo.client.api.edm.xml.Action; -import org.apache.olingo.client.api.edm.xml.ActionImport; -import org.apache.olingo.client.api.edm.xml.Annotatable; -import org.apache.olingo.client.api.edm.xml.Annotation; -import org.apache.olingo.client.api.edm.xml.Annotations; -import org.apache.olingo.client.api.edm.xml.ComplexType; -import org.apache.olingo.client.api.edm.xml.EntityContainer; -import org.apache.olingo.client.api.edm.xml.EntitySet; -import org.apache.olingo.client.api.edm.xml.EntityType; -import org.apache.olingo.client.api.edm.xml.EnumType; -import org.apache.olingo.client.api.edm.xml.Function; -import org.apache.olingo.client.api.edm.xml.FunctionImport; -import org.apache.olingo.client.api.edm.xml.Schema; -import org.apache.olingo.client.api.edm.xml.Singleton; -import org.apache.olingo.client.api.edm.xml.Term; -import org.apache.olingo.client.api.edm.xml.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.Schema; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @JsonDeserialize(using = SchemaDeserializer.class) -public class SchemaImpl extends AbstractEdmItem implements Schema { +public class SchemaImpl extends Schema { private static final long serialVersionUID = 1911087363912024939L; - private final List actions = new ArrayList(); - - private final List annotationGroups = new ArrayList(); - - private final List annotations = new ArrayList(); - - private final List complexTypes = new ArrayList(); - - private EntityContainer entityContainer; - - private final List enumTypes = new ArrayList(); - - private final List entityTypes = new ArrayList(); - - private final List functions = new ArrayList(); - - private final List terms = new ArrayList(); - - private final List typeDefinitions = new ArrayList(); - - private Map annotatables; - - private String namespace; - - private String alias; - - @Override - public String getNamespace() { - return namespace; - } - - public void setNamespace(final String namespace) { - this.namespace = namespace; - } - - @Override - public String getAlias() { - return alias; - } - - public void setAlias(final String alias) { - this.alias = alias; - } - - @Override - public EnumType getEnumType(final String name) { - return getOneByName(name, getEnumTypes()); - } - - @Override - public ComplexType getComplexType(final String name) { - return getOneByName(name, getComplexTypes()); - } - - @Override - public EntityType getEntityType(final String name) { - return getOneByName(name, getEntityTypes()); - } - - @Override - public List getActions() { - return actions; - } - - @Override - public List getActions(final String name) { - return getAllByName(name, getActions()); - } - - @Override - public List getAnnotationGroups() { - return annotationGroups; - } - - @Override - public Annotations getAnnotationGroup(final String target) { - Annotations result = null; - for (Annotations annots : getAnnotationGroups()) { - if (target.equals(annots.getTarget())) { - result = annots; - } - } - return result; - } - - @Override - public Annotation getAnnotation(final String term) { - Annotation result = null; - for (Annotation annot : getAnnotations()) { - if (term.equals(annot.getTerm())) { - result = annot; - } - } - return result; - } - - @Override - public List getAnnotations() { - return annotations; - } - - @Override - public List getFunctions() { - return functions; - } - - @Override - public List getFunctions(final String name) { - return getAllByName(name, getFunctions()); - } - - @Override - public Term getTerm(final String name) { - return getOneByName(name, getTerms()); - } - - @Override - public List getTerms() { - return terms; - } - - @Override - public TypeDefinition getTypeDefinition(final String name) { - return getOneByName(name, getTypeDefinitions()); - } - - @Override - public List getTypeDefinitions() { - return typeDefinitions; - } - - @Override - public EntityContainer getEntityContainer() { - return entityContainer; - } - - public void setEntityContainer(final EntityContainerImpl entityContainer) { - this.entityContainer = entityContainer; - } - - @Override - public List getEntityContainers() { - return entityContainer == null - ? Collections.emptyList() : Collections.singletonList(entityContainer); - } - - @Override - public EntityContainer getDefaultEntityContainer() { - return entityContainer; - } - - @Override - public EntityContainer getEntityContainer(final String name) { - if (entityContainer != null && name.equals(entityContainer.getName())) { - return entityContainer; - } - return null; - } - - @Override - public List getEnumTypes() { - return enumTypes; - } - - @Override - public List getComplexTypes() { - return complexTypes; - } - - @Override - public List getEntityTypes() { - return entityTypes; - } - - @Override - public Map getAnnotatables() { - if (annotatables == null) { - annotatables = new HashMap(); - for (Annotations annotationGroup : getAnnotationGroups()) { - annotatables.put(null, annotationGroup); - } - for (Annotation annotation : getAnnotations()) { - annotatables.put(annotation.getTerm(), annotation); - } - for (Action action : getActions()) { - annotatables.put(action.getName(), action); - } - for (ComplexType complexType : getComplexTypes()) { - annotatables.put(complexType.getName(), complexType); - } - for (EntityType entityType : getEntityTypes()) { - annotatables.put(entityType.getName(), entityType); - } - for (EnumType enumType : getEnumTypes()) { - annotatables.put(enumType.getName(), (EnumTypeImpl) enumType); - } - for (Function function : getFunctions()) { - annotatables.put(function.getName(), function); - } - for (Term term : getTerms()) { - annotatables.put(term.getName(), term); - } - for (TypeDefinition typedef : getTypeDefinitions()) { - annotatables.put(typedef.getName(), typedef); - } - if (entityContainer != null) { - annotatables.put(entityContainer.getName(), entityContainer); - for (Annotation annotation : entityContainer.getAnnotations()) { - annotatables.put(annotation.getTerm(), annotation); - } - for (ActionImport actionImport : entityContainer.getActionImports()) { - annotatables.put(actionImport.getName(), actionImport); - } - for (FunctionImport functionImport : entityContainer.getFunctionImports()) { - annotatables.put(functionImport.getName(), functionImport); - } - for (EntitySet entitySet : entityContainer.getEntitySets()) { - annotatables.put(entitySet.getName(), entitySet); - } - for (Singleton singleton : entityContainer.getSingletons()) { - annotatables.put(singleton.getName(), singleton); - } - } - } - return annotatables; - } - } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SingletonDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SingletonDeserializer.java index 1bc3b2d74..5446e8ae4 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SingletonDeserializer.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SingletonDeserializer.java @@ -39,7 +39,7 @@ public class SingletonDeserializer extends AbstractEdmDeserializer navigationPropertyBindings = new ArrayList(); - - private final List annotations = new ArrayList(); - - @Override - public List getAnnotations() { - return annotations; - } - - @Override - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; - } - - @Override - public String getEntityType() { - return entityType; - } - - public void setEntityType(final String entityType) { - this.entityType = entityType; - } - - @Override - public List getNavigationPropertyBindings() { - return navigationPropertyBindings; - } - - //TODO: includeInServiceDocument is always false for singletons - @Override - public boolean isIncludeInServiceDocument() { - return false; - } - } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TermImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TermImpl.java index 7e7b740c7..e039dab1d 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TermImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TermImpl.java @@ -18,131 +18,13 @@ */ package org.apache.olingo.client.core.edm.xml; -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.client.api.edm.xml.Annotation; -import org.apache.olingo.client.api.edm.xml.Term; -import org.apache.olingo.commons.api.edm.geo.SRID; +import org.apache.olingo.commons.api.edm.provider.Term; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @JsonDeserialize(using = TermDeserializer.class) -public class TermImpl extends AbstractEdmItem implements Term { +public class TermImpl extends Term { private static final long serialVersionUID = -8350072064720586186L; - private String name; - - private String type; - - private String baseTerm; - - private String defaultValue; - - private boolean nullable = true; - - private Integer maxLength; - - private Integer precision; - - private Integer scale; - - private SRID srid; - - private final List appliesTo = new ArrayList(); - - private final List annotations = new ArrayList(); - - @Override - public List getAnnotations() { - return annotations; - } - - @Override - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; - } - - @Override - public String getType() { - return type; - } - - public void setType(final String type) { - this.type = type; - } - - @Override - public String getBaseTerm() { - return baseTerm; - } - - public void setBaseTerm(final String baseTerm) { - this.baseTerm = baseTerm; - } - - @Override - public String getDefaultValue() { - return defaultValue; - } - - public void setDefaultValue(final String defaultValue) { - this.defaultValue = defaultValue; - } - - @Override - public boolean isNullable() { - return nullable; - } - - public void setNullable(final boolean nullable) { - this.nullable = nullable; - } - - @Override - public Integer getMaxLength() { - return maxLength; - } - - public void setMaxLength(final Integer maxLength) { - this.maxLength = maxLength; - } - - @Override - public Integer getPrecision() { - return precision; - } - - public void setPrecision(final Integer precision) { - this.precision = precision; - } - - @Override - public Integer getScale() { - return scale; - } - - public void setScale(final Integer scale) { - this.scale = scale; - } - - @Override - public SRID getSrid() { - return srid; - } - - public void setSrid(final SRID srid) { - this.srid = srid; - } - - @Override - public List getAppliesTo() { - return appliesTo; - } - } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TypeDefinitionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TypeDefinitionImpl.java index 0ec8b173a..346a6a8bd 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TypeDefinitionImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TypeDefinitionImpl.java @@ -18,102 +18,13 @@ */ package org.apache.olingo.client.core.edm.xml; -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.client.api.edm.xml.Annotation; -import org.apache.olingo.client.api.edm.xml.TypeDefinition; -import org.apache.olingo.commons.api.edm.geo.SRID; +import org.apache.olingo.commons.api.edm.provider.TypeDefinition; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @JsonDeserialize(using = TypeDefinitionDeserializer.class) -public class TypeDefinitionImpl extends AbstractEdmItem implements TypeDefinition { +public class TypeDefinitionImpl extends TypeDefinition { private static final long serialVersionUID = -902407149079419602L; - private String name; - - private String underlyingType; - - private Integer maxLength; - - private Integer precision; - - private Integer scale; - - private boolean unicode = true; - - private SRID srid; - - private final List annotations = new ArrayList(); - - @Override - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; - } - - @Override - public String getUnderlyingType() { - return underlyingType; - } - - public void setUnderlyingType(final String underlyingType) { - this.underlyingType = underlyingType; - } - - @Override - public Integer getMaxLength() { - return maxLength; - } - - public void setMaxLength(final Integer maxLength) { - this.maxLength = maxLength; - } - - @Override - public Integer getPrecision() { - return precision; - } - - public void setPrecision(final Integer precision) { - this.precision = precision; - } - - @Override - public Integer getScale() { - return scale; - } - - public void setScale(final Integer scale) { - this.scale = scale; - } - - @Override - public boolean isUnicode() { - return unicode; - } - - public void setUnicode(final boolean unicode) { - this.unicode = unicode; - } - - @Override - public SRID getSrid() { - return srid; - } - - public void setSrid(final SRID srid) { - this.srid = srid; - } - - @Override - public List getAnnotations() { - return annotations; - } - } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/XMLMetadataImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/XMLMetadataImpl.java index d4709b619..d7a65ddad 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/XMLMetadataImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/XMLMetadataImpl.java @@ -25,8 +25,9 @@ import java.util.Map; import org.apache.commons.lang3.StringUtils; import org.apache.olingo.client.api.edm.xml.Edmx; import org.apache.olingo.client.api.edm.xml.Reference; -import org.apache.olingo.client.api.edm.xml.Schema; import org.apache.olingo.client.api.edm.xml.XMLMetadata; +import org.apache.olingo.commons.api.edm.provider.AbstractEdmItem; +import org.apache.olingo.commons.api.edm.provider.Schema; /** * Entry point for access information about EDM metadata. diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractAnnotatableDynamicAnnotationExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractAnnotatableDynamicAnnotationExpression.java index da9691e04..c530fc92b 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractAnnotatableDynamicAnnotationExpression.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractAnnotatableDynamicAnnotationExpression.java @@ -21,8 +21,8 @@ package org.apache.olingo.client.core.edm.xml.annotation; import java.util.ArrayList; import java.util.List; -import org.apache.olingo.client.api.edm.xml.Annotatable; -import org.apache.olingo.client.api.edm.xml.Annotation; +import org.apache.olingo.commons.api.edm.provider.Annotatable; +import org.apache.olingo.commons.api.edm.provider.Annotation; abstract class AbstractAnnotatableDynamicAnnotationExpression extends AbstractDynamicAnnotationExpression implements Annotatable { diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractAnnotationExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractAnnotationExpression.java index 82c0a3da4..00def87cc 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractAnnotationExpression.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractAnnotationExpression.java @@ -18,10 +18,10 @@ */ package org.apache.olingo.client.core.edm.xml.annotation; -import org.apache.olingo.client.api.edm.xml.annotation.AnnotationExpression; -import org.apache.olingo.client.api.edm.xml.annotation.ConstantAnnotationExpression; -import org.apache.olingo.client.api.edm.xml.annotation.DynamicAnnotationExpression; -import org.apache.olingo.client.core.edm.xml.AbstractEdmItem; +import org.apache.olingo.commons.api.edm.provider.AbstractEdmItem; +import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression; +import org.apache.olingo.commons.api.edm.provider.annotation.ConstantAnnotationExpression; +import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression; public abstract class AbstractAnnotationExpression extends AbstractEdmItem implements AnnotationExpression { diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractDynamicAnnotationExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractDynamicAnnotationExpression.java index f94bac64d..a8d0bcdb3 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractDynamicAnnotationExpression.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractDynamicAnnotationExpression.java @@ -18,24 +18,24 @@ */ package org.apache.olingo.client.core.edm.xml.annotation; -import org.apache.olingo.client.api.edm.xml.annotation.AnnotationPath; -import org.apache.olingo.client.api.edm.xml.annotation.Apply; -import org.apache.olingo.client.api.edm.xml.annotation.Cast; -import org.apache.olingo.client.api.edm.xml.annotation.Collection; -import org.apache.olingo.client.api.edm.xml.annotation.DynamicAnnotationExpression; -import org.apache.olingo.client.api.edm.xml.annotation.If; -import org.apache.olingo.client.api.edm.xml.annotation.IsOf; -import org.apache.olingo.client.api.edm.xml.annotation.LabeledElement; -import org.apache.olingo.client.api.edm.xml.annotation.LabeledElementReference; -import org.apache.olingo.client.api.edm.xml.annotation.NavigationPropertyPath; -import org.apache.olingo.client.api.edm.xml.annotation.Not; -import org.apache.olingo.client.api.edm.xml.annotation.Null; -import org.apache.olingo.client.api.edm.xml.annotation.Path; -import org.apache.olingo.client.api.edm.xml.annotation.PropertyPath; -import org.apache.olingo.client.api.edm.xml.annotation.PropertyValue; -import org.apache.olingo.client.api.edm.xml.annotation.Record; -import org.apache.olingo.client.api.edm.xml.annotation.TwoParamsOpDynamicAnnotationExpression; -import org.apache.olingo.client.api.edm.xml.annotation.UrlRef; +import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationPath; +import org.apache.olingo.commons.api.edm.provider.annotation.Apply; +import org.apache.olingo.commons.api.edm.provider.annotation.Cast; +import org.apache.olingo.commons.api.edm.provider.annotation.Collection; +import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression; +import org.apache.olingo.commons.api.edm.provider.annotation.If; +import org.apache.olingo.commons.api.edm.provider.annotation.IsOf; +import org.apache.olingo.commons.api.edm.provider.annotation.LabeledElement; +import org.apache.olingo.commons.api.edm.provider.annotation.LabeledElementReference; +import org.apache.olingo.commons.api.edm.provider.annotation.NavigationPropertyPath; +import org.apache.olingo.commons.api.edm.provider.annotation.Not; +import org.apache.olingo.commons.api.edm.provider.annotation.Null; +import org.apache.olingo.commons.api.edm.provider.annotation.Path; +import org.apache.olingo.commons.api.edm.provider.annotation.PropertyPath; +import org.apache.olingo.commons.api.edm.provider.annotation.PropertyValue; +import org.apache.olingo.commons.api.edm.provider.annotation.Record; +import org.apache.olingo.commons.api.edm.provider.annotation.TwoParamsOpDynamicAnnotationExpression; +import org.apache.olingo.commons.api.edm.provider.annotation.UrlRef; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AnnotationPathImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AnnotationPathImpl.java index 089361338..86a7503cc 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AnnotationPathImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AnnotationPathImpl.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.client.core.edm.xml.annotation; -import org.apache.olingo.client.api.edm.xml.annotation.AnnotationPath; +import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationPath; public class AnnotationPathImpl extends AbstractElementOrAttributeExpression implements AnnotationPath { diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ApplyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ApplyImpl.java index 60ed4ae67..da0fad3de 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ApplyImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ApplyImpl.java @@ -21,8 +21,8 @@ package org.apache.olingo.client.core.edm.xml.annotation; import java.util.ArrayList; import java.util.List; -import org.apache.olingo.client.api.edm.xml.annotation.AnnotationExpression; -import org.apache.olingo.client.api.edm.xml.annotation.Apply; +import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression; +import org.apache.olingo.commons.api.edm.provider.annotation.Apply; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/CastImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/CastImpl.java index 48fd3105c..23c86edac 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/CastImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/CastImpl.java @@ -18,9 +18,9 @@ */ package org.apache.olingo.client.core.edm.xml.annotation; -import org.apache.olingo.client.api.edm.xml.annotation.Cast; -import org.apache.olingo.client.api.edm.xml.annotation.DynamicAnnotationExpression; import org.apache.olingo.commons.api.edm.geo.SRID; +import org.apache.olingo.commons.api.edm.provider.annotation.Cast; +import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/CollectionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/CollectionImpl.java index 0dfe18eac..bd48c1a08 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/CollectionImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/CollectionImpl.java @@ -21,8 +21,8 @@ package org.apache.olingo.client.core.edm.xml.annotation; import java.util.ArrayList; import java.util.List; -import org.apache.olingo.client.api.edm.xml.annotation.AnnotationExpression; -import org.apache.olingo.client.api.edm.xml.annotation.Collection; +import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression; +import org.apache.olingo.commons.api.edm.provider.annotation.Collection; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ConstantAnnotationExpressionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ConstantAnnotationExpressionImpl.java index 7530e48e4..5e1cc93bc 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ConstantAnnotationExpressionImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ConstantAnnotationExpressionImpl.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.client.core.edm.xml.annotation; -import org.apache.olingo.client.api.edm.xml.annotation.ConstantAnnotationExpression; +import org.apache.olingo.commons.api.edm.provider.annotation.ConstantAnnotationExpression; public class ConstantAnnotationExpressionImpl extends AbstractAnnotationExpression implements ConstantAnnotationExpression { diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/DynamicAnnotationExpressionDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/DynamicAnnotationExpressionDeserializer.java index e33a5721f..2210a08ac 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/DynamicAnnotationExpressionDeserializer.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/DynamicAnnotationExpressionDeserializer.java @@ -22,21 +22,21 @@ import java.io.IOException; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ClassUtils; -import org.apache.olingo.client.api.edm.xml.annotation.AnnotationPath; -import org.apache.olingo.client.api.edm.xml.annotation.Apply; -import org.apache.olingo.client.api.edm.xml.annotation.Cast; -import org.apache.olingo.client.api.edm.xml.annotation.Collection; -import org.apache.olingo.client.api.edm.xml.annotation.If; -import org.apache.olingo.client.api.edm.xml.annotation.IsOf; -import org.apache.olingo.client.api.edm.xml.annotation.LabeledElement; -import org.apache.olingo.client.api.edm.xml.annotation.NavigationPropertyPath; -import org.apache.olingo.client.api.edm.xml.annotation.Null; -import org.apache.olingo.client.api.edm.xml.annotation.Path; -import org.apache.olingo.client.api.edm.xml.annotation.PropertyPath; -import org.apache.olingo.client.api.edm.xml.annotation.Record; -import org.apache.olingo.client.api.edm.xml.annotation.TwoParamsOpDynamicAnnotationExpression; -import org.apache.olingo.client.api.edm.xml.annotation.UrlRef; import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer; +import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationPath; +import org.apache.olingo.commons.api.edm.provider.annotation.Apply; +import org.apache.olingo.commons.api.edm.provider.annotation.Cast; +import org.apache.olingo.commons.api.edm.provider.annotation.Collection; +import org.apache.olingo.commons.api.edm.provider.annotation.If; +import org.apache.olingo.commons.api.edm.provider.annotation.IsOf; +import org.apache.olingo.commons.api.edm.provider.annotation.LabeledElement; +import org.apache.olingo.commons.api.edm.provider.annotation.NavigationPropertyPath; +import org.apache.olingo.commons.api.edm.provider.annotation.Null; +import org.apache.olingo.commons.api.edm.provider.annotation.Path; +import org.apache.olingo.commons.api.edm.provider.annotation.PropertyPath; +import org.apache.olingo.commons.api.edm.provider.annotation.Record; +import org.apache.olingo.commons.api.edm.provider.annotation.TwoParamsOpDynamicAnnotationExpression; +import org.apache.olingo.commons.api.edm.provider.annotation.UrlRef; import com.fasterxml.jackson.core.JsonLocation; import com.fasterxml.jackson.core.JsonParseException; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/IfImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/IfImpl.java index dd62bd4ee..e6dd688e8 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/IfImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/IfImpl.java @@ -18,8 +18,8 @@ */ package org.apache.olingo.client.core.edm.xml.annotation; -import org.apache.olingo.client.api.edm.xml.annotation.AnnotationExpression; -import org.apache.olingo.client.api.edm.xml.annotation.If; +import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression; +import org.apache.olingo.commons.api.edm.provider.annotation.If; public class IfImpl extends AbstractAnnotatableDynamicAnnotationExpression implements If { diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/IsOfImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/IsOfImpl.java index 1c41c77d6..0eb95de25 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/IsOfImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/IsOfImpl.java @@ -18,9 +18,9 @@ */ package org.apache.olingo.client.core.edm.xml.annotation; -import org.apache.olingo.client.api.edm.xml.annotation.DynamicAnnotationExpression; -import org.apache.olingo.client.api.edm.xml.annotation.IsOf; import org.apache.olingo.commons.api.edm.geo.SRID; +import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression; +import org.apache.olingo.commons.api.edm.provider.annotation.IsOf; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/LabeledElementImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/LabeledElementImpl.java index 9b5a6d227..8b24a4f96 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/LabeledElementImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/LabeledElementImpl.java @@ -18,8 +18,8 @@ */ package org.apache.olingo.client.core.edm.xml.annotation; -import org.apache.olingo.client.api.edm.xml.annotation.DynamicAnnotationExpression; -import org.apache.olingo.client.api.edm.xml.annotation.LabeledElement; +import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression; +import org.apache.olingo.commons.api.edm.provider.annotation.LabeledElement; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/LabeledElementReferenceImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/LabeledElementReferenceImpl.java index 0da0ce5cb..7bd3a147e 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/LabeledElementReferenceImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/LabeledElementReferenceImpl.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.client.core.edm.xml.annotation; -import org.apache.olingo.client.api.edm.xml.annotation.LabeledElementReference; +import org.apache.olingo.commons.api.edm.provider.annotation.LabeledElementReference; public class LabeledElementReferenceImpl extends AbstractElementOrAttributeExpression implements LabeledElementReference { diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/NavigationPropertyPathImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/NavigationPropertyPathImpl.java index c93cd0909..8e04ebb05 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/NavigationPropertyPathImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/NavigationPropertyPathImpl.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.client.core.edm.xml.annotation; -import org.apache.olingo.client.api.edm.xml.annotation.NavigationPropertyPath; +import org.apache.olingo.commons.api.edm.provider.annotation.NavigationPropertyPath; public class NavigationPropertyPathImpl extends AbstractElementOrAttributeExpression implements NavigationPropertyPath { diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/NotImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/NotImpl.java index 7013e30b1..044385d4f 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/NotImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/NotImpl.java @@ -18,8 +18,8 @@ */ package org.apache.olingo.client.core.edm.xml.annotation; -import org.apache.olingo.client.api.edm.xml.annotation.DynamicAnnotationExpression; -import org.apache.olingo.client.api.edm.xml.annotation.Not; +import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression; +import org.apache.olingo.commons.api.edm.provider.annotation.Not; public class NotImpl extends AbstractDynamicAnnotationExpression implements Not { diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/NullImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/NullImpl.java index f779b5fec..0aa5d610d 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/NullImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/NullImpl.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.client.core.edm.xml.annotation; -import org.apache.olingo.client.api.edm.xml.annotation.Null; +import org.apache.olingo.commons.api.edm.provider.annotation.Null; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/PathImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/PathImpl.java index 73e957108..a3597e06e 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/PathImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/PathImpl.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.client.core.edm.xml.annotation; -import org.apache.olingo.client.api.edm.xml.annotation.Path; +import org.apache.olingo.commons.api.edm.provider.annotation.Path; public class PathImpl extends AbstractElementOrAttributeExpression implements Path { diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/PropertyPathImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/PropertyPathImpl.java index f8d191618..97dd2e66f 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/PropertyPathImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/PropertyPathImpl.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.client.core.edm.xml.annotation; -import org.apache.olingo.client.api.edm.xml.annotation.PropertyPath; +import org.apache.olingo.commons.api.edm.provider.annotation.PropertyPath; public class PropertyPathImpl extends AbstractElementOrAttributeExpression implements PropertyPath { diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/PropertyValueImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/PropertyValueImpl.java index 61cf85d25..5f36ec852 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/PropertyValueImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/PropertyValueImpl.java @@ -18,8 +18,8 @@ */ package org.apache.olingo.client.core.edm.xml.annotation; -import org.apache.olingo.client.api.edm.xml.annotation.AnnotationExpression; -import org.apache.olingo.client.api.edm.xml.annotation.PropertyValue; +import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression; +import org.apache.olingo.commons.api.edm.provider.annotation.PropertyValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/RecordImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/RecordImpl.java index 46f322b20..bafb18531 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/RecordImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/RecordImpl.java @@ -21,8 +21,8 @@ package org.apache.olingo.client.core.edm.xml.annotation; import java.util.ArrayList; import java.util.List; -import org.apache.olingo.client.api.edm.xml.annotation.PropertyValue; -import org.apache.olingo.client.api.edm.xml.annotation.Record; +import org.apache.olingo.commons.api.edm.provider.annotation.PropertyValue; +import org.apache.olingo.commons.api.edm.provider.annotation.Record; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/TwoParamsOpDynamicAnnotationExpressionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/TwoParamsOpDynamicAnnotationExpressionImpl.java index 5b1f7fa3d..00857c34f 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/TwoParamsOpDynamicAnnotationExpressionImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/TwoParamsOpDynamicAnnotationExpressionImpl.java @@ -18,8 +18,8 @@ */ package org.apache.olingo.client.core.edm.xml.annotation; -import org.apache.olingo.client.api.edm.xml.annotation.DynamicAnnotationExpression; -import org.apache.olingo.client.api.edm.xml.annotation.TwoParamsOpDynamicAnnotationExpression; +import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression; +import org.apache.olingo.commons.api.edm.provider.annotation.TwoParamsOpDynamicAnnotationExpression; public class TwoParamsOpDynamicAnnotationExpressionImpl extends AbstractDynamicAnnotationExpression implements TwoParamsOpDynamicAnnotationExpression { diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/UrlRefImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/UrlRefImpl.java index 3e7eeba35..9ec31b083 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/UrlRefImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/UrlRefImpl.java @@ -18,8 +18,8 @@ */ package org.apache.olingo.client.core.edm.xml.annotation; -import org.apache.olingo.client.api.edm.xml.annotation.AnnotationExpression; -import org.apache.olingo.client.api.edm.xml.annotation.UrlRef; +import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression; +import org.apache.olingo.commons.api.edm.provider.annotation.UrlRef; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java index 1b3873203..98d817b43 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java @@ -26,7 +26,6 @@ import org.apache.commons.io.IOUtils; import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.api.data.ServiceDocument; import org.apache.olingo.client.api.domain.ODataEntitySetIterator; -import org.apache.olingo.client.api.edm.xml.Schema; import org.apache.olingo.client.api.edm.xml.XMLMetadata; import org.apache.olingo.client.api.serialization.ODataReader; import org.apache.olingo.client.core.edm.EdmClientImpl; @@ -42,6 +41,7 @@ import org.apache.olingo.commons.api.domain.ODataServiceDocument; import org.apache.olingo.commons.api.domain.ODataValue; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; +import org.apache.olingo.commons.api.edm.provider.Schema; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.commons.api.serialization.ODataDeserializerException; import org.slf4j.Logger; diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java index 8a4da6f6f..2bea29091 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java @@ -26,21 +26,7 @@ import static org.junit.Assert.assertTrue; import java.util.List; import org.apache.olingo.client.api.ODataClient; -import org.apache.olingo.client.api.edm.xml.Annotation; -import org.apache.olingo.client.api.edm.xml.Annotations; -import org.apache.olingo.client.api.edm.xml.ComplexType; -import org.apache.olingo.client.api.edm.xml.EntityContainer; -import org.apache.olingo.client.api.edm.xml.EntityType; -import org.apache.olingo.client.api.edm.xml.Function; -import org.apache.olingo.client.api.edm.xml.FunctionImport; -import org.apache.olingo.client.api.edm.xml.Schema; -import org.apache.olingo.client.api.edm.xml.Singleton; import org.apache.olingo.client.api.edm.xml.XMLMetadata; -import org.apache.olingo.client.api.edm.xml.annotation.Apply; -import org.apache.olingo.client.api.edm.xml.annotation.Collection; -import org.apache.olingo.client.api.edm.xml.annotation.ConstantAnnotationExpression; -import org.apache.olingo.client.api.edm.xml.annotation.TwoParamsOpDynamicAnnotationExpression; -import org.apache.olingo.client.api.edm.xml.annotation.UrlRef; import org.apache.olingo.client.core.AbstractTest; import org.apache.olingo.client.core.edm.xml.annotation.ConstantAnnotationExpressionImpl; import org.apache.olingo.client.core.edm.xml.annotation.PathImpl; @@ -63,6 +49,20 @@ import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.annotation.EdmUrlRef; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; +import org.apache.olingo.commons.api.edm.provider.Annotation; +import org.apache.olingo.commons.api.edm.provider.Annotations; +import org.apache.olingo.commons.api.edm.provider.ComplexType; +import org.apache.olingo.commons.api.edm.provider.EntityContainer; +import org.apache.olingo.commons.api.edm.provider.EntityType; +import org.apache.olingo.commons.api.edm.provider.Function; +import org.apache.olingo.commons.api.edm.provider.FunctionImport; +import org.apache.olingo.commons.api.edm.provider.Schema; +import org.apache.olingo.commons.api.edm.provider.Singleton; +import org.apache.olingo.commons.api.edm.provider.annotation.Apply; +import org.apache.olingo.commons.api.edm.provider.annotation.Collection; +import org.apache.olingo.commons.api.edm.provider.annotation.ConstantAnnotationExpression; +import org.apache.olingo.commons.api.edm.provider.annotation.TwoParamsOpDynamicAnnotationExpression; +import org.apache.olingo.commons.api.edm.provider.annotation.UrlRef; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.commons.core.edm.primitivetype.EdmDecimal; import org.apache.olingo.commons.core.edm.primitivetype.EdmInt32; @@ -193,7 +193,6 @@ public class MetadataTest extends AbstractTest { final EntityContainer entityContainer = second.getEntityContainer(); assertNotNull(entityContainer); assertEquals("NorthwindEntities", entityContainer.getName()); - assertTrue(entityContainer.isLazyLoadingEnabled()); } /** @@ -209,7 +208,7 @@ public class MetadataTest extends AbstractTest { assertEquals("Org.OData.Measures.V1", metadata.getReferences().get(1).getIncludes().get(0).getNamespace()); final EntityType product = metadata.getSchema(0).getEntityType("Product"); - assertTrue(product.isHasStream()); + assertTrue(product.hasStream()); assertEquals("UoM.ISOCurrency", product.getProperty("Price").getAnnotations().get(0).getTerm()); assertEquals("Products", product.getNavigationProperty("Supplier").getPartner()); diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmNavigationProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmNavigationProperty.java index 199de6cde..ff0936c3a 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmNavigationProperty.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmNavigationProperty.java @@ -33,7 +33,7 @@ public interface EdmNavigationProperty extends EdmElement, EdmAnnotationsTarget, /** * @return true if nullable or null if not specified */ - Boolean isNullable(); + boolean isNullable(); /** * @return true if containsTarget or null if not specified diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmParameter.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmParameter.java index 42380aa57..79c3e200a 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmParameter.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmParameter.java @@ -28,7 +28,7 @@ public interface EdmParameter extends EdmElement, EdmMappable, EdmAnnotatable { /** * @return true if nullable or null if not specified */ - Boolean isNullable(); + boolean isNullable(); /** * @return the maximum length as an Integer or null if not specified diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmProperty.java index 68bbd947a..50028f353 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmProperty.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmProperty.java @@ -44,7 +44,7 @@ public interface EdmProperty extends EdmElement, EdmMappable, EdmAnnotationsTarg /** * @return true if nullable or null if not specified */ - Boolean isNullable(); + boolean isNullable(); /** * @return the maximum length as an Integer or null if not specified @@ -69,7 +69,7 @@ public interface EdmProperty extends EdmElement, EdmMappable, EdmAnnotationsTarg /** * @return true if unicode or null if not specified */ - Boolean isUnicode(); + boolean isUnicode(); /** * @return the default value as a String or null if not specified diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmReturnType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmReturnType.java index 46d32494c..5b1b22a5b 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmReturnType.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmReturnType.java @@ -28,7 +28,7 @@ public interface EdmReturnType extends EdmTyped { /** * @return true if nullable or null if not specified */ - Boolean isNullable(); + boolean isNullable(); /** * @return the maximum length as an Integer or null if not specified diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/FullQualifiedName.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/FullQualifiedName.java index 4657b20ee..61a6ff1c7 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/FullQualifiedName.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/FullQualifiedName.java @@ -18,13 +18,17 @@ */ package org.apache.olingo.commons.api.edm; +import java.io.Serializable; + import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; /** * A full qualified name of any element in the EDM consists of a name and a namespace. */ -public class FullQualifiedName { +public class FullQualifiedName implements Serializable{ + + private static final long serialVersionUID = -4063629050858999076L; private final String namespace; diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/Target.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/Target.java index 91b1c98af..5fb225950 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/Target.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/Target.java @@ -33,16 +33,20 @@ public class Target { private final Target instance; public Builder(final String target, final EdmEntityContainer defaultContainer) { - final String[] bindingTargetParts = target.split("/"); - - instance = new Target(); - if (bindingTargetParts.length == 1) { - instance.setEntityContainer(defaultContainer.getFullQualifiedName()). - setTargetName(bindingTargetParts[0]); + if (target != null) { + final String[] bindingTargetParts = target.split("/"); + instance = new Target(); + if (bindingTargetParts.length == 1) { + instance.setEntityContainer(defaultContainer.getFullQualifiedName()). + setTargetName(bindingTargetParts[0]); + } else { + instance.setEntityContainer(new FullQualifiedName(bindingTargetParts[0])). + setTargetName(bindingTargetParts[1]); + } } else { - instance.setEntityContainer(new FullQualifiedName(bindingTargetParts[0])). - setTargetName(bindingTargetParts[1]); + instance = null; } + } public Target build() { @@ -74,4 +78,12 @@ public class Target { return this; } + @Override + public String toString() { + if(entityContainer == null){ + return targetName; + } + return entityContainer.getFullQualifiedNameAsString() + "/" + targetName; + } + } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEdmItem.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AbstractEdmItem.java similarity index 95% rename from lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEdmItem.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AbstractEdmItem.java index 4bee0a52e..0c375ae0e 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEdmItem.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AbstractEdmItem.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.core.edm.xml; +package org.apache.olingo.commons.api.edm.provider; import java.io.Serializable; import java.util.ArrayList; @@ -27,7 +27,6 @@ import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; -import org.apache.olingo.client.api.edm.xml.Named; public abstract class AbstractEdmItem implements Serializable { diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Action.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Action.java similarity index 88% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Action.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Action.java index c33d1391c..1a614a7f7 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Action.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Action.java @@ -16,12 +16,14 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; import java.util.List; public class Action extends Operation { + private static final long serialVersionUID = 211295197043448841L; + @Override public Action setName(final String name) { this.name = name; @@ -35,7 +37,7 @@ public class Action extends Operation { } @Override - public Action setEntitySetPath(final EntitySetPath entitySetPath) { + public Action setEntitySetPath(final String entitySetPath) { this.entitySetPath = entitySetPath; return this; } diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ActionImport.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ActionImport.java similarity index 74% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ActionImport.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ActionImport.java index 5086818ac..a7730394a 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ActionImport.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ActionImport.java @@ -16,13 +16,15 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.Target; + public class ActionImport extends OperationImport { + private static final long serialVersionUID = 9186148718228340987L; + private FullQualifiedName action; @Override @@ -32,15 +34,24 @@ public class ActionImport extends OperationImport { } @Override - public ActionImport setEntitySet(final Target entitySet) { + public ActionImport setEntitySet(final String entitySet) { this.entitySet = entitySet; return this; } - public FullQualifiedName getAction() { + public String getAction() { + return action.getFullQualifiedNameAsString(); + } + + public FullQualifiedName getActionFQN() { return action; } + public ActionImport setAction(final String action) { + this.action = new FullQualifiedName(action); + return this; + } + public ActionImport setAction(final FullQualifiedName action) { this.action = action; return this; diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/AliasInfo.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AliasInfo.java similarity index 95% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/AliasInfo.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AliasInfo.java index 9cff2c8b6..b4493f504 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/AliasInfo.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AliasInfo.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; public class AliasInfo { diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Annotatable.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotatable.java similarity index 94% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Annotatable.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotatable.java index 9c99f7135..1e97719a1 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Annotatable.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotatable.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml; +package org.apache.olingo.commons.api.edm.provider; import java.util.List; diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Annotation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotation.java similarity index 69% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Annotation.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotation.java index a4a493765..ed1d8a426 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Annotation.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotation.java @@ -16,29 +16,31 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; - -import org.apache.olingo.commons.api.edm.FullQualifiedName; +package org.apache.olingo.commons.api.edm.provider; import java.util.List; -public class Annotation { +import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression; - private FullQualifiedName term; +public class Annotation extends AbstractEdmItem implements Annotatable{ + + private static final long serialVersionUID = -7137313445729486860L; + + private String term; // Target should be a target path // private String targetPath; private String qualifier; - private Expression expression; + private AnnotationExpression expression; private List annotation; - public FullQualifiedName getTerm() { + public String getTerm() { return term; } - public Annotation setTerm(final FullQualifiedName term) { + public Annotation setTerm(final String term) { this.term = term; return this; } @@ -52,11 +54,11 @@ public class Annotation { return this; } - public Expression getExpression() { + public AnnotationExpression getExpression() { return expression; } - public Annotation setExpression(final Expression expression) { + public Annotation setExpression(final AnnotationExpression expression) { this.expression = expression; return this; } @@ -69,4 +71,10 @@ public class Annotation { this.annotation = annotation; return this; } + + @Override + public List getAnnotations() { + // TODO Auto-generated method stub + return null; + } } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotations.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotations.java new file mode 100644 index 000000000..c01566d78 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotations.java @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider; + +import java.util.ArrayList; +import java.util.List; + +public class Annotations extends AbstractEdmItem implements Annotatable{ + + private static final long serialVersionUID = 8283036066408166150L; + + private final List annotations = new ArrayList(); + + private String target; + + private String qualifier; + + public String getTarget() { + return target; + } + + public Annotations setTarget(final String target) { + this.target = target; + return this; + } + + public String getQualifier() { + return qualifier; + } + + public Annotations setQualifier(final String qualifier) { + this.qualifier = qualifier; + return this; + } + + @Override + public List getAnnotations() { + return annotations; + } + + public Annotation getAnnotation(final String term) { + Annotation result = null; + for (Annotation annotation : getAnnotations()) { + if (term.equals(annotation.getTerm())) { + result = annotation; + } + } + return result; + } +} diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/BindingTarget.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/BindingTarget.java similarity index 69% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/BindingTarget.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/BindingTarget.java index 1ca52ffef..4612857ae 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/BindingTarget.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/BindingTarget.java @@ -16,19 +16,24 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; + +import java.util.ArrayList; +import java.util.List; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import java.util.List; +public abstract class BindingTarget extends AbstractEdmItem implements Named, Annotatable { -public abstract class BindingTarget { + private static final long serialVersionUID = -7011724617956042182L; protected String name; protected FullQualifiedName type; - protected List navigationPropertyBindings; + protected List navigationPropertyBindings = new ArrayList(); + + private final List annotations = new ArrayList(); public String getName() { return name; @@ -39,10 +44,19 @@ public abstract class BindingTarget { return this; } - public FullQualifiedName getType() { + public String getType() { + return type.getFullQualifiedNameAsString(); + } + + public FullQualifiedName getTypeFQN() { return type; } + public BindingTarget setType(final String type) { + this.type = new FullQualifiedName(type); + return this; + } + public BindingTarget setType(final FullQualifiedName type) { this.type = type; return this; @@ -56,5 +70,10 @@ public abstract class BindingTarget { this.navigationPropertyBindings = navigationPropertyBindings; return this; } + + @Override + public List getAnnotations() { + return annotations; + } } diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ComplexType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ComplexType.java similarity index 84% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ComplexType.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ComplexType.java index 9ef47ca80..07f4d3ba9 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ComplexType.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ComplexType.java @@ -16,13 +16,15 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; - -import org.apache.olingo.commons.api.edm.FullQualifiedName; +package org.apache.olingo.commons.api.edm.provider; import java.util.List; -public class ComplexType extends StructuredType { +import org.apache.olingo.commons.api.edm.FullQualifiedName; + +public class ComplexType extends StructuralType { + + private static final long serialVersionUID = 1089771609327713928L; @Override public ComplexType setName(final String name) { @@ -36,6 +38,12 @@ public class ComplexType extends StructuredType { return this; } + @Override + public ComplexType setBaseType(final String baseType) { + this.baseType = new FullQualifiedName(baseType); + return this; + } + @Override public ComplexType setBaseType(final FullQualifiedName baseType) { this.baseType = baseType; diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EdmProvider.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EdmProvider.java similarity index 99% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EdmProvider.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EdmProvider.java index 9058e6b8e..d221ca199 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EdmProvider.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EdmProvider.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntityContainer.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntityContainer.java new file mode 100644 index 000000000..802da4823 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntityContainer.java @@ -0,0 +1,159 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.olingo.commons.api.edm.FullQualifiedName; + +public class EntityContainer extends AbstractEdmItem implements Named, Annotatable { + + private static final long serialVersionUID = 5384682515007129458L; + + private String name; + + private FullQualifiedName extendsContainer; + + private List entitySets = new ArrayList(); + + private List actionImports = new ArrayList(); + + private List functionImports = new ArrayList(); + + private List singletons = new ArrayList(); + + private final List annotations = new ArrayList(); + + // Annotations + public String getName() { + return name; + } + + public EntityContainer setName(final String name) { + this.name = name; + return this; + } + + public String getExtendsContainer() { + if (extendsContainer != null) { + return extendsContainer.getFullQualifiedNameAsString(); + } + return null; + } + + public FullQualifiedName getExtendsContainerFQN() { + return extendsContainer; + } + + public EntityContainer setExtendsContainer(final String extendsContainer) { + this.extendsContainer = new FullQualifiedName(extendsContainer); + return this; + } + + public List getEntitySets() { + return entitySets; + } + + public EntitySet getEntitySet(final String name) { + return getOneByName(name, getEntitySets()); + } + + public EntityContainer setEntitySets(final List entitySets) { + this.entitySets = entitySets; + return this; + } + + public List getActionImports() { + return actionImports; + } + + /** + * Gets the first action import with given name. + * + * @param name name. + * @return action import. + */ + public ActionImport getActionImport(final String name) { + return getOneByName(name, getActionImports()); + } + + /** + * Gets all action imports with given name. + * + * @param name name. + * @return action imports. + */ + public List getActionImports(final String name) { + return getAllByName(name, getActionImports()); + } + + public EntityContainer setActionImports(final List actionImports) { + this.actionImports = actionImports; + return this; + } + + public List getFunctionImports() { + return functionImports; + } + + /** + * Gets the first function import with given name. + * + * @param name name. + * @return function import. + */ + public FunctionImport getFunctionImport(final String name) { + return getOneByName(name, getFunctionImports()); + } + + /** + * Gets all function imports with given name. + * + * @param name name. + * @return function imports. + */ + public List getFunctionImports(final String name) { + return getAllByName(name, getFunctionImports()); + } + + public EntityContainer setFunctionImports(final List functionImports) { + this.functionImports = functionImports; + return this; + } + + public List getSingletons() { + return singletons; + } + + public Singleton getSingleton(final String name) { + return getOneByName(name, getSingletons()); + } + + public EntityContainer setSingletons(final List singletons) { + this.singletons = singletons; + return this; + } + + @Override + public List getAnnotations() { + return annotations; + } + +} diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntityContainerInfo.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntityContainerInfo.java similarity index 96% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntityContainerInfo.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntityContainerInfo.java index 806d71aa4..8de97def0 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntityContainerInfo.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntityContainerInfo.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; import org.apache.olingo.commons.api.edm.FullQualifiedName; diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntitySet.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntitySet.java similarity index 82% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntitySet.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntitySet.java index 361d15a8f..b6356f74d 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntitySet.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntitySet.java @@ -16,14 +16,16 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; - -import org.apache.olingo.commons.api.edm.FullQualifiedName; +package org.apache.olingo.commons.api.edm.provider; import java.util.List; +import org.apache.olingo.commons.api.edm.FullQualifiedName; + public class EntitySet extends BindingTarget { + private static final long serialVersionUID = 5291570018480936643L; + private boolean includeInServiceDocument = true; @Override @@ -39,8 +41,14 @@ public class EntitySet extends BindingTarget { } @Override - public EntitySet setType(final FullQualifiedName entityType) { - type = entityType; + public EntitySet setType(final String type) { + this.type = new FullQualifiedName(type); + return this; + } + + @Override + public EntitySet setType(final FullQualifiedName type) { + this.type = type; return this; } diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntitySetPath.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntitySetPath.java similarity index 96% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntitySetPath.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntitySetPath.java index a48765418..3bc8d4587 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntitySetPath.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntitySetPath.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; public class EntitySetPath { diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntityType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntityType.java similarity index 85% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntityType.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntityType.java index 3f3db5bc6..9994e9e4b 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntityType.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntityType.java @@ -16,17 +16,19 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; - -import org.apache.olingo.commons.api.edm.FullQualifiedName; +package org.apache.olingo.commons.api.edm.provider; import java.util.List; -public class EntityType extends StructuredType { +import org.apache.olingo.commons.api.edm.FullQualifiedName; + +public class EntityType extends StructuralType { + + private static final long serialVersionUID = -1564752618679704024L; private List key; - private boolean hasStream; + private boolean hasStream = false; public boolean hasStream() { return hasStream; @@ -45,7 +47,7 @@ public class EntityType extends StructuredType { this.key = key; return this; } - + @Override public EntityType setName(final String name) { this.name = name; @@ -58,6 +60,12 @@ public class EntityType extends StructuredType { return this; } + @Override + public EntityType setBaseType(final String baseType) { + this.baseType = new FullQualifiedName(baseType); + return this; + } + @Override public EntityType setBaseType(final FullQualifiedName baseType) { this.baseType = baseType; diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EnumMember.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EnumMember.java similarity index 73% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EnumMember.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EnumMember.java index 6b83ab0c3..2787e3f1d 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EnumMember.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EnumMember.java @@ -16,14 +16,21 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; -public class EnumMember { +import java.util.ArrayList; +import java.util.List; + +public class EnumMember extends AbstractEdmItem implements Named, Annotatable{ + + private static final long serialVersionUID = 5618984420582832094L; private String name; private String value; + private final List annotations = new ArrayList(); + public String getName() { return name; } @@ -41,4 +48,10 @@ public class EnumMember { this.value = value; return this; } + + @Override + public List getAnnotations() { + return annotations; + } + } diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EnumType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EnumType.java similarity index 53% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EnumType.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EnumType.java index ee213e5e8..c2c2c6d57 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EnumType.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EnumType.java @@ -16,25 +16,27 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; + +import java.util.ArrayList; +import java.util.List; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import java.util.List; +public class EnumType extends AbstractEdmItem implements Named, Annotatable { -public class EnumType { + private static final long serialVersionUID = -718032622783883403L; private String name; private boolean isFlags; - // Underlying Type can only be primitve... private FullQualifiedName underlyingType; - private List members; + private List members = new ArrayList(); + + private final List annotations = new ArrayList(); - // Facets - // Annotations? public String getName() { return name; } @@ -53,21 +55,60 @@ public class EnumType { return this; } - public FullQualifiedName getUnderlyingType() { - return underlyingType; + //TODO: Underlying type has a default + public String getUnderlyingType() { + if(underlyingType != null){ + return underlyingType.getFullQualifiedNameAsString(); + } + return null; } + public EnumType setUnderlyingType(final String underlyingType) { + this.underlyingType = new FullQualifiedName(underlyingType); + return this; + } + public EnumType setUnderlyingType(final FullQualifiedName underlyingType) { this.underlyingType = underlyingType; return this; } + public List getMembers() { return members; } + public EnumMember getMember(final String name) { + EnumMember result = null; + if (getMembers() != null) { + for (EnumMember member : getMembers()) { + if (name.equals(member.getName())) { + result = member; + } + } + } + return result; + } + + public EnumMember getMember(final Integer value) { + EnumMember result = null; + if (getMembers() != null) { + for (EnumMember member : getMembers()) { + if (String.valueOf(value).equals(member.getValue())) { + result = member; + } + } + } + return result; + } + public EnumType setMembers(final List members) { this.members = members; return this; } + + @Override + public List getAnnotations() { + return annotations; + } } diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Expression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Expression.java similarity index 94% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Expression.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Expression.java index 83091ca3f..1784dadcc 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Expression.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Expression.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; public class Expression { //TODO: Expression implementation diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Function.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Function.java similarity index 87% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Function.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Function.java index 18f24b2f5..04f052144 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Function.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Function.java @@ -16,13 +16,15 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; import java.util.List; public class Function extends Operation { - private boolean isComposable; + private static final long serialVersionUID = 673858921468578957L; + + private boolean isComposable = false; public boolean isComposable() { return isComposable; @@ -46,7 +48,7 @@ public class Function extends Operation { } @Override - public Function setEntitySetPath(final EntitySetPath entitySetPath) { + public Function setEntitySetPath(final String entitySetPath) { this.entitySetPath = entitySetPath; return this; } diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/FunctionImport.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/FunctionImport.java similarity index 78% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/FunctionImport.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/FunctionImport.java index a180d5b3b..71223aefc 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/FunctionImport.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/FunctionImport.java @@ -16,13 +16,15 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.Target; + public class FunctionImport extends OperationImport { + private static final long serialVersionUID = 8479762299534736719L; + private FullQualifiedName function; private boolean includeInServiceDocument; @@ -39,19 +41,29 @@ public class FunctionImport extends OperationImport { } @Override - public FunctionImport setEntitySet(final Target entitySet) { + public FunctionImport setEntitySet(final String entitySet) { this.entitySet = entitySet; return this; } - public FullQualifiedName getFunction() { + public String getFunction() { + return function.getFullQualifiedNameAsString(); + } + + public FullQualifiedName getFunctionFQN() { return function; } + public FunctionImport setFunction(final FullQualifiedName function) { this.function = function; return this; } + + public FunctionImport setFunction(final String function) { + this.function = new FullQualifiedName(function); + return this; + } public boolean isIncludeInServiceDocument() { return includeInServiceDocument; diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Mapping.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Mapping.java similarity index 97% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Mapping.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Mapping.java index b6f48306a..472a28e71 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Mapping.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Mapping.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; import org.apache.olingo.commons.api.edm.EdmMapping; diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Named.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Named.java similarity index 94% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Named.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Named.java index e5f8e2dc9..6b716a60a 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Named.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Named.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml; +package org.apache.olingo.commons.api.edm.provider; import java.io.Serializable; diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/NavigationProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/NavigationProperty.java similarity index 69% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/NavigationProperty.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/NavigationProperty.java index 73f43ff61..bfb74b012 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/NavigationProperty.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/NavigationProperty.java @@ -16,14 +16,16 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; - -import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.constants.EdmOnDelete; +package org.apache.olingo.commons.api.edm.provider; +import java.util.ArrayList; import java.util.List; -public class NavigationProperty { +import org.apache.olingo.commons.api.edm.FullQualifiedName; + +public class NavigationProperty extends AbstractEdmItem implements Named, Annotatable{ + + private static final long serialVersionUID = -788021920718310799L; private String name; @@ -33,17 +35,17 @@ public class NavigationProperty { private String partner; - private boolean containsTarget; + private boolean containsTarget = false; - private List referentialConstraints; + private List referentialConstraints = new ArrayList(); // Facets - private Boolean nullable; + private boolean nullable = true; - // Refactor this onDelete - private EdmOnDelete onDelete; + private OnDelete onDelete; + + private List annotations = new ArrayList(); -//Annotations? public String getName() { return name; } @@ -62,14 +64,26 @@ public class NavigationProperty { return this; } - public FullQualifiedName getType() { + public FullQualifiedName getTypeFQN() { return type; } + + public String getType() { + if(type != null){ + return type.getFullQualifiedNameAsString(); + } + return null; + } public NavigationProperty setType(final FullQualifiedName type) { this.type = type; return this; } + + public NavigationProperty setType(final String type) { + this.type = new FullQualifiedName(type); + return this; + } public String getPartner() { return partner; @@ -98,7 +112,7 @@ public class NavigationProperty { return this; } - public Boolean getNullable() { + public Boolean isNullable() { return nullable; } @@ -107,12 +121,17 @@ public class NavigationProperty { return this; } - public EdmOnDelete getOnDelete() { + public OnDelete getOnDelete() { return onDelete; } - public NavigationProperty setOnDelete(final EdmOnDelete onDelete) { + public NavigationProperty setOnDelete(final OnDelete onDelete) { this.onDelete = onDelete; return this; } + + @Override + public List getAnnotations() { + return annotations; + } } diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/NavigationPropertyBinding.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/NavigationPropertyBinding.java similarity index 77% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/NavigationPropertyBinding.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/NavigationPropertyBinding.java index c32decc82..1ac7d6bba 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/NavigationPropertyBinding.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/NavigationPropertyBinding.java @@ -16,15 +16,16 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; -import org.apache.olingo.commons.api.edm.Target; -public class NavigationPropertyBinding { +public class NavigationPropertyBinding extends AbstractEdmItem { + + private static final long serialVersionUID = 770380971233808502L; private String path; - private Target target; + private String target; public String getPath() { return path; @@ -35,11 +36,11 @@ public class NavigationPropertyBinding { return this; } - public Target getTarget() { + public String getTarget() { return target; } - public NavigationPropertyBinding setTarget(final Target target) { + public NavigationPropertyBinding setTarget(final String target) { this.target = target; return this; } diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Parameter.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OnDelete.java similarity index 67% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Parameter.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OnDelete.java index 0f4ee36f1..e699dbb12 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Parameter.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OnDelete.java @@ -16,21 +16,23 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml; +package org.apache.olingo.commons.api.edm.provider; -import org.apache.olingo.commons.api.edm.geo.SRID; -public interface Parameter extends Named, Annotatable { - String getType(); +public class OnDelete extends AbstractEdmItem { - boolean isNullable(); + private static final long serialVersionUID = -7130889202653716784L; - Integer getMaxLength(); + private OnDeleteAction action = OnDeleteAction.None; - Integer getPrecision(); + public OnDeleteAction getAction() { + return action; + } - Integer getScale(); + public OnDelete setAction(final OnDeleteAction action) { + this.action = action; + return this; + } - SRID getSrid(); } diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/OnDeleteAction.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OnDeleteAction.java similarity index 94% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/OnDeleteAction.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OnDeleteAction.java index c78adda10..a5bf50b3a 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/OnDeleteAction.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OnDeleteAction.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml; +package org.apache.olingo.commons.api.edm.provider; public enum OnDeleteAction { diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Operation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Operation.java similarity index 69% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Operation.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Operation.java index 0b522d3c7..882087c71 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Operation.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Operation.java @@ -16,24 +16,27 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; +import java.util.ArrayList; import java.util.List; -public abstract class Operation { +public abstract class Operation extends AbstractEdmItem implements Named, Annotatable{ + + private static final long serialVersionUID = -3842411084067064086L; protected String name; - protected boolean isBound; + protected boolean isBound = false; - // Do we need EntitySetPath as a class? - protected EntitySetPath entitySetPath; + protected String entitySetPath; - protected List parameters; + protected List parameters = new ArrayList(); protected ReturnType returnType; + + protected final List annotations = new ArrayList(); - // Annotations? public String getName() { return name; } @@ -52,11 +55,11 @@ public abstract class Operation { return this; } - public EntitySetPath getEntitySetPath() { + public String getEntitySetPath() { return entitySetPath; } - public Operation setEntitySetPath(final EntitySetPath entitySetPath) { + public Operation setEntitySetPath(final String entitySetPath) { this.entitySetPath = entitySetPath; return this; } @@ -64,6 +67,10 @@ public abstract class Operation { public List getParameters() { return parameters; } + + public Parameter getParameter(String name) { + return getOneByName(name, getParameters()); + } public Operation setParameters(final List parameters) { this.parameters = parameters; @@ -78,4 +85,8 @@ public abstract class Operation { this.returnType = returnType; return this; } + + public List getAnnotations() { + return annotations; + } } diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/OperationImport.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OperationImport.java similarity index 65% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/OperationImport.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OperationImport.java index cabe656aa..8aa29dbc3 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/OperationImport.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OperationImport.java @@ -16,17 +16,21 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; -import org.apache.olingo.commons.api.edm.Target; +import java.util.ArrayList; +import java.util.List; -public abstract class OperationImport { +public abstract class OperationImport extends AbstractEdmItem implements Named, Annotatable{ + + private static final long serialVersionUID = -8928186067970681061L; protected String name; - protected Target entitySet; + protected String entitySet; + + protected final List annotations = new ArrayList(); - // Annotations? public String getName() { return name; } @@ -36,12 +40,17 @@ public abstract class OperationImport { return this; } - public Target getEntitySet() { + public String getEntitySet() { return entitySet; } - public OperationImport setEntitySet(final Target entitySet) { + public OperationImport setEntitySet(final String entitySet) { this.entitySet = entitySet; return this; } + + @Override + public List getAnnotations() { + return annotations; + } } diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Parameter.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Parameter.java similarity index 69% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Parameter.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Parameter.java index b9bb6a57a..fb29da272 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Parameter.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Parameter.java @@ -16,11 +16,17 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; + +import java.util.ArrayList; +import java.util.List; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.geo.SRID; -public class Parameter { +public class Parameter extends AbstractEdmItem implements Named, Annotatable{ + + private static final long serialVersionUID = -7360900923880732015L; private String name; @@ -30,14 +36,18 @@ public class Parameter { private Mapping mapping; - // Facets? - private Boolean nullable; + // Facets + private boolean nullable = true; private Integer maxLength; private Integer precision; private Integer scale; + + private SRID srid; + + private final List annotations = new ArrayList(); public String getName() { return name; @@ -48,10 +58,19 @@ public class Parameter { return this; } - public FullQualifiedName getType() { + public String getType() { + return type.getFullQualifiedNameAsString(); + } + + public FullQualifiedName getTypeFQN() { return type; } + public Parameter setType(final String type) { + this.type = new FullQualifiedName(type); + return this; + } + public Parameter setType(final FullQualifiedName type) { this.type = type; return this; @@ -66,11 +85,11 @@ public class Parameter { return this; } - public Boolean getNullable() { + public boolean isNullable() { return nullable; } - public Parameter setNullable(final Boolean nullable) { + public Parameter setNullable(final boolean nullable) { this.nullable = nullable; return this; } @@ -101,6 +120,20 @@ public class Parameter { this.scale = scale; return this; } + + public SRID getSrid() { + return srid; + } + + public Parameter setSrid(final SRID srid) { + this.srid = srid; + return this; + } + + @Override + public List getAnnotations() { + return annotations; + } public Mapping getMapping() { return mapping; diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Property.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Property.java similarity index 68% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Property.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Property.java index d58cb6a46..e556e67df 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Property.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Property.java @@ -16,16 +16,21 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; + +import java.util.ArrayList; +import java.util.List; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.geo.SRID; -public class Property { +public class Property extends AbstractEdmItem implements Named, Annotatable{ + + private static final long serialVersionUID = -4224390853690843450L; private String name; - // Can be simple or complex - private FullQualifiedName type; + private String type; private boolean collection; @@ -37,7 +42,7 @@ public class Property { // Facets private String defaultValue; - private Boolean nullable; + private boolean nullable = true; private Integer maxLength; @@ -45,7 +50,12 @@ public class Property { private Integer scale; - private Boolean unicode; + private boolean unicode = true; + + private SRID srid; + + private List annotations = new ArrayList(); + public String getName() { return name; @@ -56,14 +66,23 @@ public class Property { return this; } - public FullQualifiedName getType() { + public String getType() { return type; } - public Property setType(final FullQualifiedName type) { + public Property setType(final String type) { this.type = type; return this; } + + public FullQualifiedName getTypeAsFQNObject(){ + return new FullQualifiedName(type); + } + + public Property setType(FullQualifiedName fqnName){ + this.type = fqnName.getFullQualifiedNameAsString(); + return this; + } public boolean isCollection() { return collection; @@ -83,11 +102,11 @@ public class Property { return this; } - public Boolean getNullable() { + public boolean isNullable() { return nullable; } - public Property setNullable(final Boolean nullable) { + public Property setNullable(final boolean nullable) { this.nullable = nullable; return this; } @@ -119,12 +138,12 @@ public class Property { return this; } - public Boolean isUnicode() { + public boolean isUnicode() { return unicode; } - public Property setUnicode(final Boolean isUnicode) { - unicode = isUnicode; + public Property setUnicode(final boolean unicode) { + this.unicode = unicode; return this; } @@ -145,4 +164,18 @@ public class Property { this.mapping = mapping; return this; } + + @Override + public List getAnnotations() { + return annotations; + } + + public Property setSrid(final SRID srid) { + this.srid = srid; + return this; + } + + public SRID getSrid() { + return srid; + } } diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/PropertyRef.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/PropertyRef.java similarity index 83% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/PropertyRef.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/PropertyRef.java index 3c98a426d..6588aaa89 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/PropertyRef.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/PropertyRef.java @@ -16,15 +16,17 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; -public class PropertyRef { +public class PropertyRef extends AbstractEdmItem implements Named{ + + private static final long serialVersionUID = 9082892362895660037L; private String name; private String alias; - public String getPropertyName() { + public String getName() { return name; } diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ReferentialConstraint.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ReferentialConstraint.java similarity index 75% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ReferentialConstraint.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ReferentialConstraint.java index bc444fe0c..72c84c168 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ReferentialConstraint.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ReferentialConstraint.java @@ -16,15 +16,21 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; -public class ReferentialConstraint { +import java.util.ArrayList; +import java.util.List; + +public class ReferentialConstraint extends AbstractEdmItem implements Annotatable { + + private static final long serialVersionUID = -7467707499798840075L; private String property; private String referencedProperty; - // Annotations + private final List annotations = new ArrayList(); + public String getProperty() { return property; } @@ -42,4 +48,9 @@ public class ReferentialConstraint { this.referencedProperty = referencedProperty; return this; } + + @Override + public List getAnnotations() { + return annotations; + } } diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ReturnType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ReturnType.java similarity index 71% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ReturnType.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ReturnType.java index 0dd380d7f..1d58ae1c0 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ReturnType.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ReturnType.java @@ -16,29 +16,43 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.geo.SRID; -public class ReturnType { +public class ReturnType extends AbstractEdmItem{ + + private static final long serialVersionUID = 4816954124986010965L; private FullQualifiedName type; private boolean isCollection; // facets - private Boolean nullable; + private boolean nullable = true; private Integer maxLength; private Integer precision; private Integer scale; + + private SRID srid; - public FullQualifiedName getType() { + public String getType() { + return type.getFullQualifiedNameAsString(); + } + + public FullQualifiedName getTypeFQN() { return type; } + public ReturnType setType(final String type) { + this.type = new FullQualifiedName(type); + return this; + } + public ReturnType setType(final FullQualifiedName type) { this.type = type; return this; @@ -53,11 +67,11 @@ public class ReturnType { return this; } - public Boolean getNullable() { + public boolean isNullable() { return nullable; } - public ReturnType setNullable(final Boolean nullable) { + public ReturnType setNullable(final boolean nullable) { this.nullable = nullable; return this; } @@ -88,4 +102,13 @@ public class ReturnType { this.scale = scale; return this; } + + public SRID getSrid() { + return srid; + } + + public ReturnType setSrid(final SRID srid) { + this.srid = srid; + return this; + } } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Schema.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Schema.java new file mode 100644 index 000000000..183478fe4 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Schema.java @@ -0,0 +1,265 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class Schema extends AbstractEdmItem implements Annotatable{ + + private static final long serialVersionUID = -1527213201328056750L; + + private String namespace; + + private String alias; + + private List enumTypes = new ArrayList(); + + private List typeDefinitions = new ArrayList(); + + private List entityTypes = new ArrayList(); + + private List complexTypes = new ArrayList(); + + private List actions = new ArrayList(); + + private List functions = new ArrayList(); + + private EntityContainer entityContainer; + + private List terms = new ArrayList(); + + private final List annotationGroups = new ArrayList(); + + private final List annotations = new ArrayList(); + + private Map annotatables; + + + public String getNamespace() { + return namespace; + } + + public Schema setNamespace(final String namespace) { + this.namespace = namespace; + return this; + } + + public String getAlias() { + return alias; + } + + public Schema setAlias(final String alias) { + this.alias = alias; + return this; + } + + public List getEnumTypes() { + return enumTypes; + } + + public EnumType getEnumType(final String name) { + return getOneByName(name, getEnumTypes()); + } + + public Schema setEnumTypes(final List enumTypes) { + this.enumTypes = enumTypes; + return this; + } + + public List getTypeDefinitions() { + return typeDefinitions; + } + + public TypeDefinition getTypeDefinition(final String name) { + return getOneByName(name, getTypeDefinitions()); + } + + public Schema setTypeDefinitions(final List typeDefinitions) { + this.typeDefinitions = typeDefinitions; + return this; + } + + public List getEntityTypes() { + return entityTypes; + } + + public EntityType getEntityType(final String name) { + return getOneByName(name, getEntityTypes()); + } + + public Schema setEntityTypes(final List entityTypes) { + this.entityTypes = entityTypes; + return this; + } + + public List getComplexTypes() { + return complexTypes; + } + + public ComplexType getComplexType(final String name) { + return getOneByName(name, getComplexTypes()); + } + + public Schema setComplexTypes(final List complexTypes) { + this.complexTypes = complexTypes; + return this; + } + + public List getActions() { + return actions; + } + + /** + * All actions with the given name + * @param name + * @return + */ + public List getActions(final String name) { + return getAllByName(name, getActions()); + } + + public Schema setActions(final List actions) { + this.actions = actions; + return this; + } + + public List getFunctions() { + return functions; + } + + /** + * All functions with the given name + * @param name + * @return + */ + public List getFunctions(final String name) { + return getAllByName(name, getFunctions()); + } + + public Schema setFunctions(final List functions) { + this.functions = functions; + return this; + } + + public EntityContainer getEntityContainer() { + return entityContainer; + } + + public Schema setEntityContainer(final EntityContainer entityContainer) { + this.entityContainer = entityContainer; + return this; + } + + public List getTerms() { + return terms; + } + + public Term getTerm(final String name) { + return getOneByName(name, getTerms()); + } + + + public Schema setTerms(final List terms) { + this.terms = terms; + return this; + } + + public List getAnnotationGroups() { + return annotationGroups; + } + + public Annotations getAnnotationGroup(final String target) { + Annotations result = null; + for (Annotations annots : getAnnotationGroups()) { + if (target.equals(annots.getTarget())) { + result = annots; + } + } + return result; + } + + public Annotation getAnnotation(final String term) { + Annotation result = null; + for (Annotation annot : getAnnotations()) { + if (term.equals(annot.getTerm())) { + result = annot; + } + } + return result; + } + + public List getAnnotations() { + return annotations; + } + + public Map getAnnotatables() { + if (annotatables == null) { + annotatables = new HashMap(); + for (Annotations annotationGroup : getAnnotationGroups()) { + annotatables.put(null, annotationGroup); + } + for (Annotation annotation : getAnnotations()) { + annotatables.put(annotation.getTerm(), annotation); + } + for (Action action : getActions()) { + annotatables.put(action.getName(), action); + } + for (ComplexType complexType : getComplexTypes()) { + annotatables.put(complexType.getName(), complexType); + } + for (EntityType entityType : getEntityTypes()) { + annotatables.put(entityType.getName(), entityType); + } + for (EnumType enumType : getEnumTypes()) { + annotatables.put(enumType.getName(), enumType); + } + for (Function function : getFunctions()) { + annotatables.put(function.getName(), function); + } + for (Term term : getTerms()) { + annotatables.put(term.getName(), term); + } + for (TypeDefinition typedef : getTypeDefinitions()) { + annotatables.put(typedef.getName(), typedef); + } + if (entityContainer != null) { + annotatables.put(entityContainer.getName(), entityContainer); + for (Annotation annotation : entityContainer.getAnnotations()) { + annotatables.put(annotation.getTerm(), annotation); + } + for (ActionImport actionImport : entityContainer.getActionImports()) { + annotatables.put(actionImport.getName(), actionImport); + } + for (FunctionImport functionImport : entityContainer.getFunctionImports()) { + annotatables.put(functionImport.getName(), functionImport); + } + for (EntitySet entitySet : entityContainer.getEntitySets()) { + annotatables.put(entitySet.getName(), entitySet); + } + for (Singleton singleton : entityContainer.getSingletons()) { + annotatables.put(singleton.getName(), singleton); + } + } + } + return annotatables; + } +} diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Singleton.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Singleton.java similarity index 84% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Singleton.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Singleton.java index c7dc88538..e2e14f4a1 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Singleton.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Singleton.java @@ -16,20 +16,28 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; - -import org.apache.olingo.commons.api.edm.FullQualifiedName; +package org.apache.olingo.commons.api.edm.provider; import java.util.List; +import org.apache.olingo.commons.api.edm.FullQualifiedName; + public class Singleton extends BindingTarget { + private static final long serialVersionUID = -3997943079062565895L; + @Override public Singleton setName(final String name) { this.name = name; return this; } + @Override + public Singleton setType(final String type) { + this.type = new FullQualifiedName(type); + return this; + } + @Override public Singleton setType(final FullQualifiedName type) { this.type = type; diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/StructuredType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/StructuralType.java similarity index 53% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/StructuredType.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/StructuralType.java index 8f0d8666c..61d70c7f3 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/StructuredType.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/StructuralType.java @@ -16,32 +16,36 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; + +import java.util.ArrayList; +import java.util.List; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import java.util.List; +public abstract class StructuralType extends AbstractEdmItem implements Named, Annotatable { -public abstract class StructuredType { + private static final long serialVersionUID = 8662852373514258646L; protected String name; - protected boolean isOpenType; + protected boolean isOpenType = false; protected FullQualifiedName baseType; protected boolean isAbstract; - protected List properties; + protected List properties = new ArrayList(); - protected List navigationProperties; + protected List navigationProperties = new ArrayList(); + + protected final List annotations = new ArrayList(); - // What about mapping and annotations? public String getName() { return name; } - public StructuredType setName(final String name) { + public StructuralType setName(final String name) { this.name = name; return this; } @@ -50,16 +54,28 @@ public abstract class StructuredType { return isOpenType; } - public StructuredType setOpenType(final boolean isOpenType) { + public StructuralType setOpenType(final boolean isOpenType) { this.isOpenType = isOpenType; return this; } - public FullQualifiedName getBaseType() { + public String getBaseType() { + if (baseType != null) { + return baseType.getFullQualifiedNameAsString(); + } + return null; + } + + public FullQualifiedName getBaseTypeFQN() { return baseType; } - public StructuredType setBaseType(final FullQualifiedName baseType) { + public StructuralType setBaseType(final String baseType) { + this.baseType = new FullQualifiedName(baseType); + return this; + } + + public StructuralType setBaseType(final FullQualifiedName baseType) { this.baseType = baseType; return this; } @@ -68,7 +84,7 @@ public abstract class StructuredType { return isAbstract; } - public StructuredType setAbstract(final boolean isAbstract) { + public StructuralType setAbstract(final boolean isAbstract) { this.isAbstract = isAbstract; return this; } @@ -77,7 +93,11 @@ public abstract class StructuredType { return properties; } - public StructuredType setProperties(final List properties) { + public Property getProperty(String name) { + return getOneByName(name, properties); + } + + public StructuralType setProperties(final List properties) { this.properties = properties; return this; } @@ -86,8 +106,17 @@ public abstract class StructuredType { return navigationProperties; } - public StructuredType setNavigationProperties(final List navigationProperties) { + public NavigationProperty getNavigationProperty(String name) { + return getOneByName(name, navigationProperties); + } + + public StructuralType setNavigationProperties(final List navigationProperties) { this.navigationProperties = navigationProperties; return this; } + + @Override + public List getAnnotations() { + return annotations; + } } diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Term.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Term.java similarity index 71% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Term.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Term.java index 4ba3eb7d8..45b9afe2d 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Term.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Term.java @@ -16,37 +16,41 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; - -import org.apache.olingo.commons.api.edm.FullQualifiedName; +package org.apache.olingo.commons.api.edm.provider; +import java.util.ArrayList; import java.util.List; -public class Term { +import org.apache.olingo.commons.api.edm.geo.SRID; + +public class Term extends AbstractEdmItem implements Named, Annotatable{ + + private static final long serialVersionUID = 3843929000407818103L; private String name; - private FullQualifiedName type; + private String type; - private FullQualifiedName baseTerm; + private String baseTerm; - private String appliesTo; + private List appliesTo = new ArrayList(); private boolean isCollection; // Facets private String defaultValue; - private Boolean nullable; + private boolean nullable = true; private Integer maxLength; private Integer precision; private Integer scale; + + private SRID srid; - // Annotation - private List annotations; + private List annotations = new ArrayList(); public String getName() { return name; @@ -57,29 +61,29 @@ public class Term { return this; } - public FullQualifiedName getType() { + public String getType() { return type; } - public Term setType(final FullQualifiedName type) { + public Term setType(final String type) { this.type = type; return this; } - public FullQualifiedName getBaseTerm() { + public String getBaseTerm() { return baseTerm; } - public Term setBaseTerm(final FullQualifiedName baseTerm) { + public Term setBaseTerm(final String baseTerm) { this.baseTerm = baseTerm; return this; } - public String getAppliesTo() { + public List getAppliesTo() { return appliesTo; } - public Term setAppliesTo(final String appliesTo) { + public Term setAppliesTo(final List appliesTo) { this.appliesTo = appliesTo; return this; } @@ -102,11 +106,11 @@ public class Term { return this; } - public Boolean getNullable() { + public boolean isNullable() { return nullable; } - public Term setNullable(final Boolean nullable) { + public Term setNullable(final boolean nullable) { this.nullable = nullable; return this; } @@ -146,4 +150,13 @@ public class Term { this.annotations = annotations; return this; } + + public SRID getSrid() { + return srid; + } + + public Term setSrid(final SRID srid) { + this.srid = srid; + return this; + } } diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/TypeDefinition.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/TypeDefinition.java similarity index 63% rename from lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/TypeDefinition.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/TypeDefinition.java index 1ddcbe248..7ef8b365b 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/TypeDefinition.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/TypeDefinition.java @@ -16,15 +16,20 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.server.api.edm.provider; +package org.apache.olingo.commons.api.edm.provider; + +import java.util.ArrayList; +import java.util.List; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.geo.SRID; -public class TypeDefinition { +public class TypeDefinition extends AbstractEdmItem implements Named, Annotatable { + + private static final long serialVersionUID = 3718980071229613048L; private String name; - // TODO: UnderlyingType can only be primitve... private FullQualifiedName underlyingType; // Facets @@ -34,9 +39,12 @@ public class TypeDefinition { private Integer scale; - private Boolean isUnicode; + private boolean unicode = true; + + private SRID srid; + + private final List annotations = new ArrayList(); - // Annotations public String getName() { return name; } @@ -46,10 +54,15 @@ public class TypeDefinition { return this; } - public FullQualifiedName getUnderlyingType() { - return underlyingType; + public String getUnderlyingType() { + return underlyingType.getFullQualifiedNameAsString(); } + public TypeDefinition setUnderlyingType(final String underlyingType) { + this.underlyingType = new FullQualifiedName(underlyingType); + return this; + } + public TypeDefinition setUnderlyingType(final FullQualifiedName underlyingType) { this.underlyingType = underlyingType; return this; @@ -82,13 +95,26 @@ public class TypeDefinition { return this; } - public Boolean getIsUnicode() { - return isUnicode; + public boolean isUnicode() { + return unicode; } - public TypeDefinition setIsUnicode(final Boolean isUnicode) { - this.isUnicode = isUnicode; + public TypeDefinition setUnicode(final boolean unicode) { + this.unicode = unicode; return this; } + public SRID getSrid() { + return srid; + } + + public TypeDefinition setSrid(final SRID srid) { + this.srid = srid; + return this; + } + + @Override + public List getAnnotations() { + return annotations; + } } diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/AnnotationExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AnnotationExpression.java similarity index 94% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/AnnotationExpression.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AnnotationExpression.java index 470f10a2c..0a8796cc0 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/AnnotationExpression.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AnnotationExpression.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml.annotation; +package org.apache.olingo.commons.api.edm.provider.annotation; public interface AnnotationExpression { diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/AnnotationPath.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AnnotationPath.java similarity index 93% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/AnnotationPath.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AnnotationPath.java index 09b043e03..c000b8821 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/AnnotationPath.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AnnotationPath.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml.annotation; +package org.apache.olingo.commons.api.edm.provider.annotation; public interface AnnotationPath extends DynamicAnnotationExpression { diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/Apply.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Apply.java similarity index 88% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/Apply.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Apply.java index 28b31e480..0cea34479 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/Apply.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Apply.java @@ -16,11 +16,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml.annotation; +package org.apache.olingo.commons.api.edm.provider.annotation; import java.util.List; -import org.apache.olingo.client.api.edm.xml.Annotatable; +import org.apache.olingo.commons.api.edm.provider.Annotatable; public interface Apply extends DynamicAnnotationExpression, Annotatable { diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/Cast.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Cast.java similarity index 89% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/Cast.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Cast.java index 4a8cff591..a091fe006 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/Cast.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Cast.java @@ -16,10 +16,10 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml.annotation; +package org.apache.olingo.commons.api.edm.provider.annotation; -import org.apache.olingo.client.api.edm.xml.Annotatable; import org.apache.olingo.commons.api.edm.geo.SRID; +import org.apache.olingo.commons.api.edm.provider.Annotatable; public interface Cast extends DynamicAnnotationExpression, Annotatable { diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/Collection.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Collection.java similarity index 93% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/Collection.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Collection.java index 61ec91421..6c7862a72 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/Collection.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Collection.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml.annotation; +package org.apache.olingo.commons.api.edm.provider.annotation; import java.util.List; diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/ConstantAnnotationExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/ConstantAnnotationExpression.java similarity index 95% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/ConstantAnnotationExpression.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/ConstantAnnotationExpression.java index 596d266ea..72889e567 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/ConstantAnnotationExpression.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/ConstantAnnotationExpression.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml.annotation; +package org.apache.olingo.commons.api.edm.provider.annotation; public interface ConstantAnnotationExpression extends AnnotationExpression { diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/DynamicAnnotationExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/DynamicAnnotationExpression.java similarity index 96% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/DynamicAnnotationExpression.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/DynamicAnnotationExpression.java index 2e99d3d77..83ff1cd7f 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/DynamicAnnotationExpression.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/DynamicAnnotationExpression.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml.annotation; +package org.apache.olingo.commons.api.edm.provider.annotation; public interface DynamicAnnotationExpression extends AnnotationExpression { diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/If.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/If.java similarity index 88% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/If.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/If.java index f73857fbb..86661c29e 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/If.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/If.java @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml.annotation; +package org.apache.olingo.commons.api.edm.provider.annotation; -import org.apache.olingo.client.api.edm.xml.Annotatable; +import org.apache.olingo.commons.api.edm.provider.Annotatable; public interface If extends DynamicAnnotationExpression, Annotatable { diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/IsOf.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/IsOf.java similarity index 89% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/IsOf.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/IsOf.java index dcaa4fa5a..6bbc6b5cb 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/IsOf.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/IsOf.java @@ -16,10 +16,10 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml.annotation; +package org.apache.olingo.commons.api.edm.provider.annotation; -import org.apache.olingo.client.api.edm.xml.Annotatable; import org.apache.olingo.commons.api.edm.geo.SRID; +import org.apache.olingo.commons.api.edm.provider.Annotatable; public interface IsOf extends DynamicAnnotationExpression, Annotatable { diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/LabeledElement.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElement.java similarity index 88% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/LabeledElement.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElement.java index 9a509e969..2f1aace84 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/LabeledElement.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElement.java @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml.annotation; +package org.apache.olingo.commons.api.edm.provider.annotation; -import org.apache.olingo.client.api.edm.xml.Annotatable; +import org.apache.olingo.commons.api.edm.provider.Annotatable; public interface LabeledElement extends DynamicAnnotationExpression, Annotatable { diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/LabeledElementReference.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElementReference.java similarity index 93% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/LabeledElementReference.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElementReference.java index 68ea20353..1772921c2 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/LabeledElementReference.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElementReference.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml.annotation; +package org.apache.olingo.commons.api.edm.provider.annotation; public interface LabeledElementReference extends DynamicAnnotationExpression { diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/NavigationPropertyPath.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/NavigationPropertyPath.java similarity index 93% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/NavigationPropertyPath.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/NavigationPropertyPath.java index 4d2d06c73..8538f530e 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/NavigationPropertyPath.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/NavigationPropertyPath.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml.annotation; +package org.apache.olingo.commons.api.edm.provider.annotation; public interface NavigationPropertyPath extends DynamicAnnotationExpression { diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/Not.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Not.java similarity index 93% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/Not.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Not.java index 123dc935a..1acdede90 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/Not.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Not.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml.annotation; +package org.apache.olingo.commons.api.edm.provider.annotation; public interface Not extends DynamicAnnotationExpression { diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/Null.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Null.java similarity index 88% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/Null.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Null.java index 63af639c9..40345eede 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/Null.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Null.java @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml.annotation; +package org.apache.olingo.commons.api.edm.provider.annotation; -import org.apache.olingo.client.api.edm.xml.Annotatable; +import org.apache.olingo.commons.api.edm.provider.Annotatable; public interface Null extends DynamicAnnotationExpression, Annotatable { //No additional methods needed for now. diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/Path.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Path.java similarity index 93% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/Path.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Path.java index b24ceefa2..7edd73ed6 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/Path.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Path.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml.annotation; +package org.apache.olingo.commons.api.edm.provider.annotation; public interface Path extends DynamicAnnotationExpression { diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/PropertyPath.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/PropertyPath.java similarity index 93% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/PropertyPath.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/PropertyPath.java index 99ad87a48..a7d26d260 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/PropertyPath.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/PropertyPath.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml.annotation; +package org.apache.olingo.commons.api.edm.provider.annotation; public interface PropertyPath extends DynamicAnnotationExpression { diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/PropertyValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/PropertyValue.java similarity index 88% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/PropertyValue.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/PropertyValue.java index fbf4b407f..acdf92e36 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/PropertyValue.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/PropertyValue.java @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml.annotation; +package org.apache.olingo.commons.api.edm.provider.annotation; -import org.apache.olingo.client.api.edm.xml.Annotatable; +import org.apache.olingo.commons.api.edm.provider.Annotatable; public interface PropertyValue extends DynamicAnnotationExpression, Annotatable { diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/Record.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Record.java similarity index 88% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/Record.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Record.java index b5975580e..1344c30f4 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/Record.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Record.java @@ -16,11 +16,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml.annotation; +package org.apache.olingo.commons.api.edm.provider.annotation; import java.util.List; -import org.apache.olingo.client.api.edm.xml.Annotatable; +import org.apache.olingo.commons.api.edm.provider.Annotatable; public interface Record extends DynamicAnnotationExpression, Annotatable { diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/TwoParamsOpDynamicAnnotationExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/TwoParamsOpDynamicAnnotationExpression.java similarity index 95% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/TwoParamsOpDynamicAnnotationExpression.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/TwoParamsOpDynamicAnnotationExpression.java index 276ba3ddc..c07c9a33b 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/TwoParamsOpDynamicAnnotationExpression.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/TwoParamsOpDynamicAnnotationExpression.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml.annotation; +package org.apache.olingo.commons.api.edm.provider.annotation; public interface TwoParamsOpDynamicAnnotationExpression extends DynamicAnnotationExpression { diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/UrlRef.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/UrlRef.java similarity index 93% rename from lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/UrlRef.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/UrlRef.java index 9f7c44cc9..0d8250248 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/annotation/UrlRef.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/UrlRef.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.client.api.edm.xml.annotation; +package org.apache.olingo.commons.api.edm.provider.annotation; public interface UrlRef extends DynamicAnnotationExpression { diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmBindingTarget.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmBindingTarget.java index ecfe38f6d..d3d9bf6f0 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmBindingTarget.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmBindingTarget.java @@ -69,13 +69,16 @@ public abstract class AbstractEdmBindingTarget extends EdmNamedImpl implements E @Override public EdmBindingTarget getRelatedBindingTarget(final String path) { + if(path == null){ + return null; + } EdmBindingTarget bindingTarget = null; boolean found = false; for (final Iterator itor = getNavigationPropertyBindings().iterator(); itor.hasNext() && !found;) { final EdmNavigationPropertyBinding binding = itor.next(); - if (binding.getPath().equals(path)) { + if (path.startsWith(binding.getPath())) { final Target edmTarget = new Target.Builder(binding.getTarget(), container).build(); final EdmEntityContainer entityContainer = edm.getEntityContainer(edmTarget.getEntityContainer()); diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmParameter.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmParameter.java index 6b7189435..0264573f0 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmParameter.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmParameter.java @@ -20,7 +20,6 @@ package org.apache.olingo.commons.core.edm; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmException; -import org.apache.olingo.commons.api.edm.EdmMapping; import org.apache.olingo.commons.api.edm.EdmParameter; import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.commons.api.edm.FullQualifiedName; @@ -47,20 +46,4 @@ public abstract class AbstractEdmParameter extends EdmElementImpl implements Edm return typeImpl; } - - @Override - public abstract EdmMapping getMapping(); - - @Override - public abstract Boolean isNullable(); - - @Override - public abstract Integer getMaxLength(); - - @Override - public abstract Integer getPrecision(); - - @Override - public abstract Integer getScale(); - } diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java index eddd0da53..8db1ada22 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java @@ -21,11 +21,11 @@ package org.apache.olingo.server.api; import java.util.List; import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.server.api.deserializer.DeserializerException; import org.apache.olingo.server.api.deserializer.FixedFormatDeserializer; import org.apache.olingo.server.api.deserializer.ODataDeserializer; -import org.apache.olingo.server.api.edm.provider.EdmProvider; import org.apache.olingo.server.api.edmx.EdmxReference; import org.apache.olingo.server.api.serializer.FixedFormatSerializer; import org.apache.olingo.server.api.serializer.ODataSerializer; diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntityContainer.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntityContainer.java deleted file mode 100644 index 3b993e15f..000000000 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntityContainer.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.server.api.edm.provider; - -import org.apache.olingo.commons.api.edm.FullQualifiedName; - -import java.util.List; - -public class EntityContainer { - - private String name; - - private FullQualifiedName extendsContainer; - - private List entitySets; - - private List actionImports; - - private List functionImports; - - private List singletons; - - // Annotations - public String getName() { - return name; - } - - public EntityContainer setName(final String name) { - this.name = name; - return this; - } - - public FullQualifiedName getExtendsContainer() { - return extendsContainer; - } - - public EntityContainer setExtendsContainer(final FullQualifiedName extendsContainer) { - this.extendsContainer = extendsContainer; - return this; - } - - public List getEntitySets() { - return entitySets; - } - - public EntityContainer setEntitySets(final List entitySets) { - this.entitySets = entitySets; - return this; - } - - public List getActionImports() { - return actionImports; - } - - public EntityContainer setActionImports(final List actionImports) { - this.actionImports = actionImports; - return this; - } - - public List getFunctionImports() { - return functionImports; - } - - public EntityContainer setFunctionImports(final List functionImports) { - this.functionImports = functionImports; - return this; - } - - public List getSingletons() { - return singletons; - } - - public EntityContainer setSingletons(final List singletons) { - this.singletons = singletons; - return this; - } -} diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Schema.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Schema.java deleted file mode 100644 index 235a16e09..000000000 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Schema.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.server.api.edm.provider; - -import java.util.List; - -public class Schema { - - private String namespace; - - private String alias; - - private List enumTypes; - - private List typeDefinitions; - - private List entityTypes; - - private List complexTypes; - - private List actions; - - private List functions; - - private EntityContainer entityContainer; - - private List terms; - - // Annotations - public String getNamespace() { - return namespace; - } - - public Schema setNamespace(final String namespace) { - this.namespace = namespace; - return this; - } - - public String getAlias() { - return alias; - } - - public Schema setAlias(final String alias) { - this.alias = alias; - return this; - } - - public List getEnumTypes() { - return enumTypes; - } - - public Schema setEnumTypes(final List enumTypes) { - this.enumTypes = enumTypes; - return this; - } - - public List getTypeDefinitions() { - return typeDefinitions; - } - - public Schema setTypeDefinitions(final List typeDefinitions) { - this.typeDefinitions = typeDefinitions; - return this; - } - - public List getEntityTypes() { - return entityTypes; - } - - public Schema setEntityTypes(final List entityTypes) { - this.entityTypes = entityTypes; - return this; - } - - public List getComplexTypes() { - return complexTypes; - } - - public Schema setComplexTypes(final List complexTypes) { - this.complexTypes = complexTypes; - return this; - } - - public List getActions() { - return actions; - } - - public Schema setActions(final List actions) { - this.actions = actions; - return this; - } - - public List getFunctions() { - return functions; - } - - public Schema setFunctions(final List functions) { - this.functions = functions; - return this; - } - - public EntityContainer getEntityContainer() { - return entityContainer; - } - - public Schema setEntityContainer(final EntityContainer entityContainer) { - this.entityContainer = entityContainer; - return this; - } - - public List getTerms() { - return terms; - } - - public Schema setTerms(final List terms) { - this.terms = terms; - return this; - } -} diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java index 9e43e716a..c05b4ae23 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java @@ -20,6 +20,7 @@ package org.apache.olingo.server.core; import java.util.List; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.server.api.OData; import org.apache.olingo.server.api.ODataHttpHandler; @@ -27,7 +28,6 @@ import org.apache.olingo.server.api.ServiceMetadata; import org.apache.olingo.server.api.deserializer.DeserializerException; import org.apache.olingo.server.api.deserializer.FixedFormatDeserializer; import org.apache.olingo.server.api.deserializer.ODataDeserializer; -import org.apache.olingo.server.api.edm.provider.EdmProvider; import org.apache.olingo.server.api.edmx.EdmxReference; import org.apache.olingo.server.api.serializer.FixedFormatSerializer; import org.apache.olingo.server.api.serializer.ODataSerializer; diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ServiceMetadataImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ServiceMetadataImpl.java index 06743d58e..0dfc81355 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ServiceMetadataImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ServiceMetadataImpl.java @@ -20,9 +20,9 @@ package org.apache.olingo.server.core; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; import org.apache.olingo.server.api.edmx.EdmxReference; import org.apache.olingo.server.api.ServiceMetadata; -import org.apache.olingo.server.api.edm.provider.EdmProvider; import org.apache.olingo.server.core.edm.provider.EdmProviderImpl; import java.util.ArrayList; diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java index 6892affad..4533c6a1d 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java @@ -237,7 +237,7 @@ public class ODataJsonDeserializer implements ODataDeserializer { JsonNode jsonNode = node.get(navigationPropertyName); if (jsonNode != null) { EdmNavigationProperty edmNavigationProperty = edmEntityType.getNavigationProperty(navigationPropertyName); - boolean isNullable = edmNavigationProperty.isNullable() == null ? true : edmNavigationProperty.isNullable(); + boolean isNullable = edmNavigationProperty.isNullable(); if (jsonNode.isNull() && !isNullable) { throw new DeserializerException("Property: " + navigationPropertyName + " must not be null.", DeserializerException.MessageKeys.INVALID_NULL_PROPERTY, navigationPropertyName); @@ -463,7 +463,7 @@ public class ODataJsonDeserializer implements ODataDeserializer { } private boolean isNullable(EdmProperty edmProperty) { - return edmProperty.isNullable() == null ? true : edmProperty.isNullable(); + return edmProperty.isNullable(); } private Object readTypeDefinitionValue(EdmProperty edmProperty, JsonNode jsonNode) throws DeserializerException { diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmActionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmActionImpl.java index e96e16556..95e4abb18 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmActionImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmActionImpl.java @@ -22,7 +22,7 @@ import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAction; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.server.api.edm.provider.Action; +import org.apache.olingo.commons.api.edm.provider.Action; public class EdmActionImpl extends EdmOperationImpl implements EdmAction { diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmActionImportImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmActionImportImpl.java index 0278f6ba7..c0af4fff8 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmActionImportImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmActionImportImpl.java @@ -22,7 +22,7 @@ import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAction; import org.apache.olingo.commons.api.edm.EdmActionImport; import org.apache.olingo.commons.api.edm.EdmEntityContainer; -import org.apache.olingo.server.api.edm.provider.ActionImport; +import org.apache.olingo.commons.api.edm.provider.ActionImport; public class EdmActionImportImpl extends EdmOperationImportImpl implements EdmActionImport { @@ -36,7 +36,7 @@ public class EdmActionImportImpl extends EdmOperationImportImpl implements EdmAc @Override public EdmAction getUnboundAction() { - return edm.getUnboundAction(actionImport.getAction()); + return edm.getUnboundAction(actionImport.getActionFQN()); } @Override diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmBindingTargetImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmBindingTargetImpl.java index bd3df0af4..8bda19358 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmBindingTargetImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmBindingTargetImpl.java @@ -18,17 +18,16 @@ */ package org.apache.olingo.server.core.edm.provider; +import java.util.ArrayList; +import java.util.List; + import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmEntityContainer; import org.apache.olingo.commons.api.edm.EdmNavigationPropertyBinding; -import org.apache.olingo.commons.api.edm.Target; +import org.apache.olingo.commons.api.edm.provider.BindingTarget; +import org.apache.olingo.commons.api.edm.provider.NavigationPropertyBinding; import org.apache.olingo.commons.core.edm.AbstractEdmBindingTarget; import org.apache.olingo.commons.core.edm.EdmNavigationPropertyBindingImpl; -import org.apache.olingo.server.api.edm.provider.BindingTarget; -import org.apache.olingo.server.api.edm.provider.NavigationPropertyBinding; - -import java.util.ArrayList; -import java.util.List; public abstract class EdmBindingTargetImpl extends AbstractEdmBindingTarget { @@ -36,7 +35,7 @@ public abstract class EdmBindingTargetImpl extends AbstractEdmBindingTarget { private List navigationPropertyBindings; public EdmBindingTargetImpl(final Edm edm, final EdmEntityContainer container, final BindingTarget target) { - super(edm, container, target.getName(), target.getType()); + super(edm, container, target.getName(), target.getTypeFQN()); this.target = target; } @@ -47,13 +46,7 @@ public abstract class EdmBindingTargetImpl extends AbstractEdmBindingTarget { navigationPropertyBindings = new ArrayList(); if (providerBindings != null) { for (NavigationPropertyBinding binding : providerBindings) { - Target providerTarget = binding.getTarget(); - String targetString = ""; - if (providerTarget.getEntityContainer() != null) { - targetString = targetString + providerTarget.getEntityContainer().getFullQualifiedNameAsString() + "/"; - } - targetString = targetString + providerTarget.getTargetName(); - navigationPropertyBindings.add(new EdmNavigationPropertyBindingImpl(binding.getPath(), targetString)); + navigationPropertyBindings.add(new EdmNavigationPropertyBindingImpl(binding.getPath(), binding.getTarget())); } } } diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmComplexTypeImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmComplexTypeImpl.java index 89305d2f6..87b2be8b6 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmComplexTypeImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmComplexTypeImpl.java @@ -24,9 +24,9 @@ import org.apache.olingo.commons.api.edm.EdmNavigationProperty; import org.apache.olingo.commons.api.edm.EdmProperty; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.ComplexType; import org.apache.olingo.commons.core.edm.AbstractEdmComplexType; import org.apache.olingo.commons.core.edm.EdmStructuredTypeHelper; -import org.apache.olingo.server.api.edm.provider.ComplexType; import java.util.List; import java.util.Map; @@ -42,7 +42,7 @@ public class EdmComplexTypeImpl extends AbstractEdmComplexType { } private EdmComplexTypeImpl(final Edm edm, final FullQualifiedName name, final ComplexType complexType) { - super(edm, name, complexType.getBaseType()); + super(edm, name, complexType.getBaseTypeFQN()); helper = new EdmStructuredTypeHelperImpl(edm, name, complexType); } diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmEntityContainerImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmEntityContainerImpl.java index 3cf7bd24b..8ecc8446d 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmEntityContainerImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmEntityContainerImpl.java @@ -28,14 +28,14 @@ import org.apache.olingo.commons.api.edm.EdmFunctionImport; import org.apache.olingo.commons.api.edm.EdmSingleton; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.ActionImport; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.EntityContainer; +import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.EntitySet; +import org.apache.olingo.commons.api.edm.provider.FunctionImport; +import org.apache.olingo.commons.api.edm.provider.Singleton; import org.apache.olingo.commons.core.edm.AbstractEdmEntityContainer; -import org.apache.olingo.server.api.edm.provider.ActionImport; -import org.apache.olingo.server.api.edm.provider.EdmProvider; -import org.apache.olingo.server.api.edm.provider.EntityContainer; -import org.apache.olingo.server.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.server.api.edm.provider.EntitySet; -import org.apache.olingo.server.api.edm.provider.FunctionImport; -import org.apache.olingo.server.api.edm.provider.Singleton; import java.util.List; @@ -53,7 +53,7 @@ public class EdmEntityContainerImpl extends AbstractEdmEntityContainer { public EdmEntityContainerImpl(final Edm edm, final EdmProvider provider, final FullQualifiedName containerFQN, final EntityContainer entityContainer) { - super(edm, containerFQN, entityContainer.getExtendsContainer()); + super(edm, containerFQN, entityContainer.getExtendsContainerFQN()); this.provider = provider; container = entityContainer; } diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmEntitySetImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmEntitySetImpl.java index c657a0236..4ab66fd58 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmEntitySetImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmEntitySetImpl.java @@ -23,7 +23,7 @@ import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmEntityContainer; import org.apache.olingo.commons.api.edm.EdmEntitySet; import org.apache.olingo.commons.api.edm.EdmTerm; -import org.apache.olingo.server.api.edm.provider.EntitySet; +import org.apache.olingo.commons.api.edm.provider.EntitySet; import java.util.List; diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmEntityTypeImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmEntityTypeImpl.java index 755f35841..7be37602c 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmEntityTypeImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmEntityTypeImpl.java @@ -26,10 +26,10 @@ import org.apache.olingo.commons.api.edm.EdmNavigationProperty; import org.apache.olingo.commons.api.edm.EdmProperty; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.EntityType; +import org.apache.olingo.commons.api.edm.provider.PropertyRef; import org.apache.olingo.commons.core.edm.AbstractEdmEntityType; import org.apache.olingo.commons.core.edm.EdmStructuredTypeHelper; -import org.apache.olingo.server.api.edm.provider.EntityType; -import org.apache.olingo.server.api.edm.provider.PropertyRef; import java.util.ArrayList; import java.util.List; @@ -50,7 +50,7 @@ public class EdmEntityTypeImpl extends AbstractEdmEntityType { } private EdmEntityTypeImpl(final Edm edm, final FullQualifiedName name, final EntityType entityType) { - super(edm, name, entityType.getBaseType(), entityType.hasStream()); + super(edm, name, entityType.getBaseTypeFQN(), entityType.hasStream()); this.entityType = entityType; helper = new EdmStructuredTypeHelperImpl(edm, name, entityType); } diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmEnumTypeImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmEnumTypeImpl.java index ac1c83dbe..86fb92aa0 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmEnumTypeImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmEnumTypeImpl.java @@ -26,10 +26,10 @@ import org.apache.olingo.commons.api.edm.EdmMember; import org.apache.olingo.commons.api.edm.EdmPrimitiveType; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.EnumMember; +import org.apache.olingo.commons.api.edm.provider.EnumType; import org.apache.olingo.commons.core.edm.AbstractEdmEnumType; import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; -import org.apache.olingo.server.api.edm.provider.EnumMember; -import org.apache.olingo.server.api.edm.provider.EnumType; public class EdmEnumTypeImpl extends AbstractEdmEnumType { @@ -46,8 +46,7 @@ public class EdmEnumTypeImpl extends AbstractEdmEnumType { underlyingType = EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Int32); } else { underlyingType = EdmPrimitiveTypeFactory.getInstance( - EdmPrimitiveTypeKind.valueOf(enumType.getUnderlyingType().getName())); - // TODO: Should we validate that the underlying type is of byte, sbyte, in16, int32 or int64? + EdmPrimitiveTypeKind.valueOfFQN(enumType.getUnderlyingType())); } this.enumType = enumType; diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImpl.java index f23e0a817..d45f5c8d1 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImpl.java @@ -24,7 +24,7 @@ import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.EdmReturnType; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.server.api.edm.provider.Function; +import org.apache.olingo.commons.api.edm.provider.Function; public class EdmFunctionImpl extends EdmOperationImpl implements EdmFunction { diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImportImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImportImpl.java index f832b39d6..b676ff67d 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImportImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImportImpl.java @@ -24,7 +24,7 @@ import org.apache.olingo.commons.api.edm.EdmEntityContainer; import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.EdmFunctionImport; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.server.api.edm.provider.FunctionImport; +import org.apache.olingo.commons.api.edm.provider.FunctionImport; import java.util.List; @@ -40,7 +40,7 @@ public class EdmFunctionImportImpl extends EdmOperationImportImpl implements Edm @Override public FullQualifiedName getFunctionFqn() { - return functionImport.getFunction(); + return functionImport.getFunctionFQN(); } @Override diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmKeyPropertyRefImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmKeyPropertyRefImpl.java index 564e74508..2e5a34285 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmKeyPropertyRefImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmKeyPropertyRefImpl.java @@ -19,8 +19,8 @@ package org.apache.olingo.server.core.edm.provider; import org.apache.olingo.commons.api.edm.EdmEntityType; +import org.apache.olingo.commons.api.edm.provider.PropertyRef; import org.apache.olingo.commons.core.edm.AbstractEdmKeyPropertyRef; -import org.apache.olingo.server.api.edm.provider.PropertyRef; public class EdmKeyPropertyRefImpl extends AbstractEdmKeyPropertyRef { @@ -33,7 +33,7 @@ public class EdmKeyPropertyRefImpl extends AbstractEdmKeyPropertyRef { @Override public String getName() { - return ref.getPropertyName(); + return ref.getName(); } @Override diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmNavigationPropertyImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmNavigationPropertyImpl.java index ab41a86fa..f643914c5 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmNavigationPropertyImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmNavigationPropertyImpl.java @@ -23,9 +23,9 @@ import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmReferentialConstraint; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.NavigationProperty; +import org.apache.olingo.commons.api.edm.provider.ReferentialConstraint; import org.apache.olingo.commons.core.edm.AbstractEdmNavigationProperty; -import org.apache.olingo.server.api.edm.provider.NavigationProperty; -import org.apache.olingo.server.api.edm.provider.ReferentialConstraint; import java.util.ArrayList; import java.util.List; @@ -49,7 +49,7 @@ public class EdmNavigationPropertyImpl extends AbstractEdmNavigationProperty { @Override protected FullQualifiedName getTypeFQN() { - return navigationProperty.getType(); + return navigationProperty.getTypeFQN(); } @Override @@ -58,8 +58,8 @@ public class EdmNavigationPropertyImpl extends AbstractEdmNavigationProperty { } @Override - public Boolean isNullable() { - return navigationProperty.getNullable(); + public boolean isNullable() { + return navigationProperty.isNullable(); } @Override diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmOperationImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmOperationImpl.java index 75d47d9d5..3958d7dfb 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmOperationImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmOperationImpl.java @@ -18,19 +18,18 @@ */ package org.apache.olingo.server.core.edm.provider; +import java.util.ArrayList; +import java.util.List; + import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmParameter; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; +import org.apache.olingo.commons.api.edm.provider.Operation; +import org.apache.olingo.commons.api.edm.provider.Parameter; import org.apache.olingo.commons.core.edm.AbstractEdmOperation; -import org.apache.olingo.server.api.edm.provider.EntitySetPath; -import org.apache.olingo.server.api.edm.provider.Operation; -import org.apache.olingo.server.api.edm.provider.Parameter; - -import java.util.ArrayList; -import java.util.List; public abstract class EdmOperationImpl extends AbstractEdmOperation { @@ -46,9 +45,9 @@ public abstract class EdmOperationImpl extends AbstractEdmOperation { instance.setParameters(_parameters); } - final EntitySetPath entitySetPath = instance.operation.getEntitySetPath(); - if (entitySetPath != null && entitySetPath.getPath() != null) { - instance.setEntitySetPath(entitySetPath.getPath()); + final String entitySetPath = instance.operation.getEntitySetPath(); + if (entitySetPath != null) { + instance.setEntitySetPath(entitySetPath); } instance.setIsBound(instance.operation.isBound()); @@ -71,7 +70,7 @@ public abstract class EdmOperationImpl extends AbstractEdmOperation { public FullQualifiedName getBindingParameterTypeFqn() { if (isBound()) { Parameter bindingParameter = operation.getParameters().get(0); - return bindingParameter.getType(); + return bindingParameter.getTypeFQN(); } return null; } diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmOperationImportImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmOperationImportImpl.java index fc1ab3189..07da5658e 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmOperationImportImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmOperationImportImpl.java @@ -22,8 +22,9 @@ import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmEntityContainer; import org.apache.olingo.commons.api.edm.EdmTerm; +import org.apache.olingo.commons.api.edm.Target; +import org.apache.olingo.commons.api.edm.provider.OperationImport; import org.apache.olingo.commons.core.edm.AbstractEdmOperationImport; -import org.apache.olingo.server.api.edm.provider.OperationImport; import java.util.List; @@ -31,7 +32,8 @@ public abstract class EdmOperationImportImpl extends AbstractEdmOperationImport public EdmOperationImportImpl(final Edm edm, final EdmEntityContainer container, final OperationImport operationImport) { - super(edm, container, operationImport.getName(), operationImport.getEntitySet()); + super(edm, container, operationImport.getName(), new Target.Builder(operationImport.getEntitySet(), container + ).build()); } @Override diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmParameterImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmParameterImpl.java index 8a1e84003..397dc64d8 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmParameterImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmParameterImpl.java @@ -23,8 +23,8 @@ import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmMapping; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.geo.SRID; +import org.apache.olingo.commons.api.edm.provider.Parameter; import org.apache.olingo.commons.core.edm.AbstractEdmParameter; -import org.apache.olingo.server.api.edm.provider.Parameter; import java.util.List; @@ -33,7 +33,7 @@ public class EdmParameterImpl extends AbstractEdmParameter { private final Parameter parameter; public EdmParameterImpl(final Edm edm, final Parameter parameter) { - super(edm, parameter.getName(), parameter.getType()); + super(edm, parameter.getName(), parameter.getTypeFQN()); this.parameter = parameter; } @@ -48,8 +48,8 @@ public class EdmParameterImpl extends AbstractEdmParameter { } @Override - public Boolean isNullable() { - return parameter.getNullable(); + public boolean isNullable() { + return parameter.isNullable(); } @Override @@ -69,7 +69,7 @@ public class EdmParameterImpl extends AbstractEdmParameter { @Override public SRID getSrid() { - return null; // TODO: provide implementation + return parameter.getSrid(); } @Override diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmPropertyImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmPropertyImpl.java index 3f6b8d1de..1c8d5eb43 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmPropertyImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmPropertyImpl.java @@ -26,9 +26,9 @@ import org.apache.olingo.commons.api.edm.EdmMapping; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.geo.SRID; +import org.apache.olingo.commons.api.edm.provider.Property; import org.apache.olingo.commons.core.edm.AbstractEdmProperty; import org.apache.olingo.commons.core.edm.EdmTypeInfo; -import org.apache.olingo.server.api.edm.provider.Property; public class EdmPropertyImpl extends AbstractEdmProperty { @@ -67,8 +67,8 @@ public class EdmPropertyImpl extends AbstractEdmProperty { } @Override - public Boolean isNullable() { - return property.getNullable(); + public boolean isNullable() { + return property.isNullable(); } @Override @@ -88,11 +88,11 @@ public class EdmPropertyImpl extends AbstractEdmProperty { @Override public SRID getSrid() { - return null; // TODO: provide implementation + return property.getSrid(); } @Override - public Boolean isUnicode() { + public boolean isUnicode() { return property.isUnicode(); } diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmProviderImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmProviderImpl.java index e5f35fddf..649401b08 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmProviderImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmProviderImpl.java @@ -32,18 +32,18 @@ import org.apache.olingo.commons.api.edm.EdmSchema; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.Action; +import org.apache.olingo.commons.api.edm.provider.AliasInfo; +import org.apache.olingo.commons.api.edm.provider.ComplexType; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.EntityType; +import org.apache.olingo.commons.api.edm.provider.EnumType; +import org.apache.olingo.commons.api.edm.provider.Function; +import org.apache.olingo.commons.api.edm.provider.Parameter; +import org.apache.olingo.commons.api.edm.provider.Schema; +import org.apache.olingo.commons.api.edm.provider.TypeDefinition; import org.apache.olingo.commons.core.edm.AbstractEdm; -import org.apache.olingo.server.api.edm.provider.Action; -import org.apache.olingo.server.api.edm.provider.AliasInfo; -import org.apache.olingo.server.api.edm.provider.ComplexType; -import org.apache.olingo.server.api.edm.provider.EdmProvider; -import org.apache.olingo.server.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.server.api.edm.provider.EntityType; -import org.apache.olingo.server.api.edm.provider.EnumType; -import org.apache.olingo.server.api.edm.provider.Function; -import org.apache.olingo.server.api.edm.provider.Parameter; -import org.apache.olingo.server.api.edm.provider.Schema; -import org.apache.olingo.server.api.edm.provider.TypeDefinition; import java.util.ArrayList; import java.util.Collections; @@ -149,7 +149,7 @@ public class EdmProviderImpl extends AbstractEdm { if (action.isBound()) { final List parameters = action.getParameters(); final Parameter parameter = parameters.get(0); - if (bindingParameterTypeName.equals(parameter.getType()) + if (bindingParameterTypeName.equals(parameter.getTypeFQN()) && isBindingParameterCollection.booleanValue() == parameter.isCollection()) { return EdmActionImpl.getInstance(this, actionName, action); @@ -187,7 +187,7 @@ public class EdmProviderImpl extends AbstractEdm { throw new EdmException("No parameter specified for bound function: " + functionName); } final Parameter bindingParameter = providerParameters.get(0); - if (bindingParameterTypeName.equals(bindingParameter.getType()) + if (bindingParameterTypeName.equals(bindingParameter.getTypeFQN()) && isBindingParameterCollection.booleanValue() == bindingParameter.isCollection()) { if (parameterNamesCopy.size() == providerParameters.size() - 1) { diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmReturnTypeImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmReturnTypeImpl.java index 95c2c833c..0cdf8bf32 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmReturnTypeImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmReturnTypeImpl.java @@ -20,15 +20,15 @@ package org.apache.olingo.server.core.edm.provider; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.geo.SRID; +import org.apache.olingo.commons.api.edm.provider.ReturnType; import org.apache.olingo.commons.core.edm.AbstractEdmReturnType; -import org.apache.olingo.server.api.edm.provider.ReturnType; public class EdmReturnTypeImpl extends AbstractEdmReturnType { private final ReturnType returnType; public EdmReturnTypeImpl(final Edm edm, final ReturnType returnType) { - super(edm, returnType.getType()); + super(edm, returnType.getTypeFQN()); this.returnType = returnType; } @@ -38,8 +38,8 @@ public class EdmReturnTypeImpl extends AbstractEdmReturnType { } @Override - public Boolean isNullable() { - return returnType.getNullable(); + public boolean isNullable() { + return returnType.isNullable(); } @Override diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmSchemaImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmSchemaImpl.java index 8f8ccfff3..86c18420b 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmSchemaImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmSchemaImpl.java @@ -33,15 +33,15 @@ import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.Action; +import org.apache.olingo.commons.api.edm.provider.ComplexType; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.EntityType; +import org.apache.olingo.commons.api.edm.provider.EnumType; +import org.apache.olingo.commons.api.edm.provider.Function; +import org.apache.olingo.commons.api.edm.provider.Schema; +import org.apache.olingo.commons.api.edm.provider.TypeDefinition; import org.apache.olingo.commons.core.edm.AbstractEdmSchema; -import org.apache.olingo.server.api.edm.provider.Action; -import org.apache.olingo.server.api.edm.provider.ComplexType; -import org.apache.olingo.server.api.edm.provider.EdmProvider; -import org.apache.olingo.server.api.edm.provider.EntityType; -import org.apache.olingo.server.api.edm.provider.EnumType; -import org.apache.olingo.server.api.edm.provider.Function; -import org.apache.olingo.server.api.edm.provider.Schema; -import org.apache.olingo.server.api.edm.provider.TypeDefinition; public class EdmSchemaImpl extends AbstractEdmSchema { diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmSingletonImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmSingletonImpl.java index 7bf41d8c7..1ea0058d4 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmSingletonImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmSingletonImpl.java @@ -23,7 +23,7 @@ import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmEntityContainer; import org.apache.olingo.commons.api.edm.EdmSingleton; import org.apache.olingo.commons.api.edm.EdmTerm; -import org.apache.olingo.server.api.edm.provider.Singleton; +import org.apache.olingo.commons.api.edm.provider.Singleton; import java.util.List; diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmStructuredTypeHelperImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmStructuredTypeHelperImpl.java index cc4c7f13a..d67283824 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmStructuredTypeHelperImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmStructuredTypeHelperImpl.java @@ -22,10 +22,10 @@ import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmNavigationProperty; import org.apache.olingo.commons.api.edm.EdmProperty; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.NavigationProperty; +import org.apache.olingo.commons.api.edm.provider.Property; +import org.apache.olingo.commons.api.edm.provider.StructuralType; import org.apache.olingo.commons.core.edm.EdmStructuredTypeHelper; -import org.apache.olingo.server.api.edm.provider.NavigationProperty; -import org.apache.olingo.server.api.edm.provider.Property; -import org.apache.olingo.server.api.edm.provider.StructuredType; import java.util.LinkedHashMap; import java.util.Map; @@ -36,14 +36,14 @@ public class EdmStructuredTypeHelperImpl implements EdmStructuredTypeHelper { private final FullQualifiedName structuredTypeName; - private final StructuredType structuredType; + private final StructuralType structuredType; private Map properties; private Map navigationProperties; public EdmStructuredTypeHelperImpl( - final Edm edm, final FullQualifiedName structuredTypeName, final StructuredType structuredType) { + final Edm edm, final FullQualifiedName structuredTypeName, final StructuralType structuredType) { this.edm = edm; this.structuredTypeName = structuredTypeName; diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmTypeDefinitionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmTypeDefinitionImpl.java index 0b830a88e..95849b415 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmTypeDefinitionImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmTypeDefinitionImpl.java @@ -28,9 +28,9 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.geo.SRID; +import org.apache.olingo.commons.api.edm.provider.TypeDefinition; import org.apache.olingo.commons.core.edm.AbstractEdmTypeDefinition; import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; -import org.apache.olingo.server.api.edm.provider.TypeDefinition; public class EdmTypeDefinitionImpl extends AbstractEdmTypeDefinition { @@ -50,7 +50,7 @@ public class EdmTypeDefinitionImpl extends AbstractEdmTypeDefinition { if (edmPrimitiveTypeInstance == null) { try { edmPrimitiveTypeInstance = EdmPrimitiveTypeFactory.getInstance( - EdmPrimitiveTypeKind.valueOf(typeDefinition.getUnderlyingType().getName())); + EdmPrimitiveTypeKind.valueOfFQN(typeDefinition.getUnderlyingType())); } catch (IllegalArgumentException e) { throw new EdmException("Invalid underlying type: " + typeDefinition.getUnderlyingType(), e); } @@ -80,7 +80,7 @@ public class EdmTypeDefinitionImpl extends AbstractEdmTypeDefinition { @Override public Boolean isUnicode() { - return typeDefinition.getIsUnicode(); + return typeDefinition.isUnicode(); } @Override diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java index 915115808..54f366a9a 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java @@ -385,7 +385,7 @@ public class MetadataDocumentXmlSerializer { private void appendReturnTypeFacets(final XMLStreamWriter writer, final EdmReturnType returnType) throws XMLStreamException { - if (returnType.isNullable() != null) { + if (returnType.isNullable() == false) { writer.writeAttribute(XML_NULLABLE, "" + returnType.isNullable()); } if (returnType.getMaxLength() != null) { @@ -401,7 +401,7 @@ public class MetadataDocumentXmlSerializer { private void appendParameterFacets(final XMLStreamWriter writer, final EdmParameter parameter) throws XMLStreamException { - if (parameter.isNullable() != null) { + if (parameter.isNullable() == false) { writer.writeAttribute(XML_NULLABLE, "" + parameter.isNullable()); } if (parameter.getMaxLength() != null) { @@ -478,7 +478,7 @@ public class MetadataDocumentXmlSerializer { writer.writeAttribute(XML_NAME, navigationPropertyName); writer.writeAttribute(XML_TYPE, getAliasedFullQualifiedName(navigationProperty.getType(), navigationProperty .isCollection())); - if (navigationProperty.isNullable() != null) { + if (navigationProperty.isNullable() == false) { writer.writeAttribute(XML_NULLABLE, "" + navigationProperty.isNullable()); } @@ -517,11 +517,11 @@ public class MetadataDocumentXmlSerializer { writer.writeAttribute(XML_TYPE, fqnString); // Facets - if (property.isNullable() != null) { + if (property.isNullable() == false) { writer.writeAttribute(XML_NULLABLE, "" + property.isNullable()); } - if (property.isUnicode() != null) { + if (property.isUnicode() == false) { writer.writeAttribute(XML_UNICODE, "" + property.isUnicode()); } diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java index 4a4463a42..e3e2c3c5d 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java @@ -608,7 +608,7 @@ public class UriValidator { throw new UriValidationException("Attempt to patch collection property.", UriValidationException.MessageKeys.UNSUPPORTED_HTTP_METHOD, method.toString()); } - if (method == HttpMethod.DELETE && property.isNullable() != null && !property.isNullable()) { + if (method == HttpMethod.DELETE && !property.isNullable()) { throw new UriValidationException("Attempt to delete non-nullable property.", UriValidationException.MessageKeys.UNSUPPORTED_HTTP_METHOD, method.toString()); } diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmActionImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmActionImplTest.java index f48f05cb4..f3c849b5d 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmActionImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmActionImplTest.java @@ -18,23 +18,6 @@ */ package org.apache.olingo.server.core.edm.provider; -import org.apache.olingo.commons.api.edm.EdmAction; -import org.apache.olingo.commons.api.edm.EdmEntitySet; -import org.apache.olingo.commons.api.edm.EdmException; -import org.apache.olingo.commons.api.edm.EdmParameter; -import org.apache.olingo.commons.api.edm.EdmSingleton; -import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.server.api.edm.provider.Action; -import org.apache.olingo.server.api.edm.provider.EntitySetPath; -import org.apache.olingo.server.api.edm.provider.Parameter; -import org.apache.olingo.server.api.edm.provider.ReturnType; -import org.junit.Before; -import org.junit.Test; - -import java.util.ArrayList; -import java.util.List; - import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; @@ -44,6 +27,22 @@ import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import java.util.ArrayList; +import java.util.List; + +import org.apache.olingo.commons.api.edm.EdmAction; +import org.apache.olingo.commons.api.edm.EdmEntitySet; +import org.apache.olingo.commons.api.edm.EdmException; +import org.apache.olingo.commons.api.edm.EdmParameter; +import org.apache.olingo.commons.api.edm.EdmSingleton; +import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; +import org.apache.olingo.commons.api.edm.provider.Action; +import org.apache.olingo.commons.api.edm.provider.Parameter; +import org.apache.olingo.commons.api.edm.provider.ReturnType; +import org.junit.Before; +import org.junit.Test; + public class EdmActionImplTest { private EdmAction actionImpl1; @@ -66,10 +65,9 @@ public class EdmActionImplTest { actionImpl2 = EdmActionImpl.getInstance(provider, action2Name, action2); FullQualifiedName action3Name = new FullQualifiedName("namespace", "action3"); - EntitySetPath entitySetPath = new EntitySetPath().setBindingParameter("Id").setPath("path"); Action action3 = new Action().setName("action3").setParameters(parameters).setReturnType(returnType).setEntitySetPath( - entitySetPath); + "path/Id"); actionImpl3 = EdmActionImpl.getInstance(provider, action3Name, action3); } @@ -127,7 +125,7 @@ public class EdmActionImplTest { @Test public void action3getReturnedEntitySetWithEntitySet() { EdmEntitySet set = mock(EdmEntitySet.class); - when(set.getRelatedBindingTarget("path")).thenReturn(set); + when(set.getRelatedBindingTarget("path/Id")).thenReturn(set); EdmEntitySet returnedEntitySet = actionImpl3.getReturnedEntitySet(set); diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmActionImportImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmActionImportImplTest.java index 1b4f82c72..8f1ce78ac 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmActionImportImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmActionImportImplTest.java @@ -25,7 +25,7 @@ import org.apache.olingo.commons.api.edm.EdmEntitySet; import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.Target; -import org.apache.olingo.server.api.edm.provider.ActionImport; +import org.apache.olingo.commons.api.edm.provider.ActionImport; import org.junit.Before; import org.junit.Test; @@ -51,7 +51,7 @@ public class EdmActionImportImplTest { FullQualifiedName entityContainerFqn = new FullQualifiedName("namespace", "containerName"); Target target = new Target().setEntityContainer(entityContainerFqn).setTargetName("entitySetName"); ActionImport providerActionImport = - new ActionImport().setName("actionImportName").setAction(actionFqn).setEntitySet(target); + new ActionImport().setName("actionImportName").setAction(actionFqn).setEntitySet(target.toString()); EdmProviderImpl edm = mock(EdmProviderImpl.class); container = mock(EdmEntityContainer.class); @@ -83,8 +83,8 @@ public class EdmActionImportImplTest { @Test(expected = EdmException.class) public void getReturnedEntitySetNonExistingContainer() { - Target target = new Target(); - ActionImport providerActionImport = new ActionImport().setName("actionImportName").setEntitySet(target); + Target target = new Target().setEntityContainer(new FullQualifiedName("alias.nonexisting")).setTargetName("Es"); + ActionImport providerActionImport = new ActionImport().setName("actionImportName").setEntitySet(target.toString()); EdmActionImport actionImport = new EdmActionImportImpl(mock(EdmProviderImpl.class), container, providerActionImport); actionImport.getReturnedEntitySet(); @@ -92,8 +92,8 @@ public class EdmActionImportImplTest { @Test(expected = EdmException.class) public void getReturnedEntitySetNonExistingEntitySet() { - Target target = new Target(); - ActionImport providerActionImport = new ActionImport().setName("actionImportName").setEntitySet(target); + Target target = new Target().setTargetName("nonExisting"); + ActionImport providerActionImport = new ActionImport().setName("actionImportName").setEntitySet(target.toString()); EdmProviderImpl edm = mock(EdmProviderImpl.class); when(edm.getEntityContainer(null)).thenReturn(container); EdmActionImport actionImport = new EdmActionImportImpl(edm, container, providerActionImport); diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmComplexTypeImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmComplexTypeImplTest.java index 8a6623043..ea915946c 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmComplexTypeImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmComplexTypeImplTest.java @@ -23,10 +23,10 @@ import org.apache.olingo.commons.api.edm.EdmElement; import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.server.api.edm.provider.ComplexType; -import org.apache.olingo.server.api.edm.provider.EdmProvider; -import org.apache.olingo.server.api.edm.provider.NavigationProperty; -import org.apache.olingo.server.api.edm.provider.Property; +import org.apache.olingo.commons.api.edm.provider.ComplexType; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.NavigationProperty; +import org.apache.olingo.commons.api.edm.provider.Property; import org.junit.Before; import org.junit.Test; @@ -55,7 +55,8 @@ public class EdmComplexTypeImplTest { FullQualifiedName baseName = new FullQualifiedName("namespace", "BaseTypeName"); ComplexType baseComplexType = new ComplexType(); List baseProperties = new ArrayList(); - baseProperties.add(new Property().setName("prop1").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); + baseProperties.add(new Property().setName("prop1").setType( + EdmPrimitiveTypeKind.String.getFullQualifiedName())); List baseNavigationProperties = new ArrayList(); baseNavigationProperties.add(new NavigationProperty().setName("nav1")); baseComplexType.setName("BaseTypeName").setAbstract(false).setOpenType(false).setProperties(baseProperties) diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntityContainerImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntityContainerImplTest.java index 088910699..8a7bf22a3 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntityContainerImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntityContainerImplTest.java @@ -26,13 +26,13 @@ import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.EdmFunctionImport; import org.apache.olingo.commons.api.edm.EdmSingleton; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.server.api.edm.provider.ActionImport; -import org.apache.olingo.server.api.edm.provider.EdmProvider; -import org.apache.olingo.server.api.edm.provider.EntityContainer; -import org.apache.olingo.server.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.server.api.edm.provider.EntitySet; -import org.apache.olingo.server.api.edm.provider.FunctionImport; -import org.apache.olingo.server.api.edm.provider.Singleton; +import org.apache.olingo.commons.api.edm.provider.ActionImport; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.EntityContainer; +import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.EntitySet; +import org.apache.olingo.commons.api.edm.provider.FunctionImport; +import org.apache.olingo.commons.api.edm.provider.Singleton; import org.junit.Before; import org.junit.Test; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntitySetImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntitySetImplTest.java index 90563d683..52effee02 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntitySetImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntitySetImplTest.java @@ -24,12 +24,12 @@ import org.apache.olingo.commons.api.edm.EdmEntitySet; import org.apache.olingo.commons.api.edm.EdmEntityType; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.Target; -import org.apache.olingo.server.api.edm.provider.EdmProvider; -import org.apache.olingo.server.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.server.api.edm.provider.EntitySet; -import org.apache.olingo.server.api.edm.provider.EntityType; -import org.apache.olingo.server.api.edm.provider.NavigationPropertyBinding; -import org.apache.olingo.server.api.edm.provider.PropertyRef; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.EntitySet; +import org.apache.olingo.commons.api.edm.provider.EntityType; +import org.apache.olingo.commons.api.edm.provider.NavigationPropertyBinding; +import org.apache.olingo.commons.api.edm.provider.PropertyRef; import org.junit.Test; import java.util.Arrays; @@ -64,7 +64,7 @@ public class EdmEntitySetImplTest { .setIncludeInServiceDocument(true) .setNavigationPropertyBindings(Arrays.asList( new NavigationPropertyBinding().setPath("path") - .setTarget(new Target().setEntityContainer(containerName).setTargetName(entitySetName)))); + .setTarget(new Target().setEntityContainer(containerName).setTargetName(entitySetName).toString()))); when(provider.getEntitySet(containerName, entitySetName)).thenReturn(entitySetProvider); final EdmEntitySet entitySet = new EdmEntitySetImpl(edm, entityContainer, entitySetProvider); diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntityTypeImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntityTypeImplTest.java index 46ef67de5..360f9d199 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntityTypeImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntityTypeImplTest.java @@ -18,6 +18,17 @@ */ package org.apache.olingo.server.core.edm.provider; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.util.ArrayList; +import java.util.List; + import org.apache.olingo.commons.api.edm.EdmComplexType; import org.apache.olingo.commons.api.edm.EdmElement; import org.apache.olingo.commons.api.edm.EdmEntityType; @@ -26,26 +37,15 @@ import org.apache.olingo.commons.api.edm.EdmKeyPropertyRef; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.EdmProperty; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.server.api.edm.provider.ComplexType; -import org.apache.olingo.server.api.edm.provider.EdmProvider; -import org.apache.olingo.server.api.edm.provider.EntityType; -import org.apache.olingo.server.api.edm.provider.NavigationProperty; -import org.apache.olingo.server.api.edm.provider.Property; -import org.apache.olingo.server.api.edm.provider.PropertyRef; +import org.apache.olingo.commons.api.edm.provider.ComplexType; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.EntityType; +import org.apache.olingo.commons.api.edm.provider.NavigationProperty; +import org.apache.olingo.commons.api.edm.provider.Property; +import org.apache.olingo.commons.api.edm.provider.PropertyRef; import org.junit.Before; import org.junit.Test; -import java.util.ArrayList; -import java.util.List; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - public class EdmEntityTypeImplTest { private EdmEntityType baseType; @@ -81,8 +81,10 @@ public class EdmEntityTypeImplTest { type.setName(typeName.getName()); type.setBaseType(baseName); List typeProperties = new ArrayList(); - typeProperties.add(new Property().setName("address").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); - typeProperties.add(new Property().setName("email").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); + typeProperties.add(new Property().setName("address").setType( + EdmPrimitiveTypeKind.String.getFullQualifiedName())); + typeProperties.add(new Property().setName("email").setType( + EdmPrimitiveTypeKind.String.getFullQualifiedName())); type.setProperties(typeProperties); List typeNavigationProperties = new ArrayList(); typeNavigationProperties.add(new NavigationProperty().setName("nav2")); @@ -115,7 +117,7 @@ public class EdmEntityTypeImplTest { typeWithComplexKey = EdmEntityTypeImpl.getInstance(edm, typeWithComplexKeyName, typeWithComplexKeyProvider); } - + @Test public void testAbstractBaseTypeWithoutKey() throws Exception { EdmProvider provider = mock(EdmProvider.class); @@ -134,18 +136,20 @@ public class EdmEntityTypeImplTest { when(provider.getEntityType(baseName)).thenReturn(baseType); baseType.setAbstract(true); EdmEntityType edmAbstarctBaseType = EdmEntityTypeImpl.getInstance(edm, baseName, baseType); - + assertEquals(2, edmAbstarctBaseType.getPropertyNames().size()); assertEquals("Id", edmAbstarctBaseType.getPropertyNames().get(0)); assertEquals("Name", edmAbstarctBaseType.getPropertyNames().get(1)); - + FullQualifiedName typeName = new FullQualifiedName("namespace", "typeName"); EntityType type = new EntityType(); type.setName(typeName.getName()); type.setBaseType(baseName); List typeProperties = new ArrayList(); - typeProperties.add(new Property().setName("address").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); - typeProperties.add(new Property().setName("email").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); + typeProperties.add(new Property().setName("address").setType( + EdmPrimitiveTypeKind.String.getFullQualifiedName())); + typeProperties.add(new Property().setName("email").setType( + EdmPrimitiveTypeKind.String.getFullQualifiedName())); type.setProperties(typeProperties); List key = new ArrayList(); key.add(new PropertyRef().setName("email")); @@ -156,24 +160,24 @@ public class EdmEntityTypeImplTest { when(provider.getEntityType(typeName)).thenReturn(type); EdmEntityType edmType = EdmEntityTypeImpl.getInstance(edm, typeName, type); - + assertNotNull(edmType.getBaseType()); assertEquals(2, edmAbstarctBaseType.getPropertyNames().size()); - + assertEquals(1, edmType.getKeyPropertyRefs().size()); assertEquals("email", edmType.getKeyPredicateNames().get(0)); - + assertEquals(4, edmType.getPropertyNames().size()); assertEquals("Id", edmType.getPropertyNames().get(0)); assertEquals("Name", edmType.getPropertyNames().get(1)); assertEquals("address", edmType.getPropertyNames().get(2)); assertEquals("email", edmType.getPropertyNames().get(3)); - + assertEquals(2, edmType.getNavigationPropertyNames().size()); assertEquals("nav1", edmType.getNavigationPropertyNames().get(0)); assertEquals("nav2", edmType.getNavigationPropertyNames().get(1)); } - + @Test public void testAbstractBaseTypeWithtKey() throws Exception { EdmProvider provider = mock(EdmProvider.class); @@ -195,38 +199,40 @@ public class EdmEntityTypeImplTest { when(provider.getEntityType(baseName)).thenReturn(baseType); baseType.setAbstract(true); EdmEntityType edmAbstarctBaseType = EdmEntityTypeImpl.getInstance(edm, baseName, baseType); - + FullQualifiedName typeName = new FullQualifiedName("namespace", "typeName"); EntityType type = new EntityType(); type.setName(typeName.getName()); type.setBaseType(baseName); List typeProperties = new ArrayList(); - typeProperties.add(new Property().setName("address").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); - typeProperties.add(new Property().setName("email").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); + typeProperties.add(new Property().setName("address").setType( + EdmPrimitiveTypeKind.String.getFullQualifiedName())); + typeProperties.add(new Property().setName("email").setType( + EdmPrimitiveTypeKind.String.getFullQualifiedName())); type.setProperties(typeProperties); List typeNavigationProperties = new ArrayList(); typeNavigationProperties.add(new NavigationProperty().setName("nav2")); type.setNavigationProperties(typeNavigationProperties); when(provider.getEntityType(typeName)).thenReturn(type); EdmEntityType edmType = EdmEntityTypeImpl.getInstance(edm, typeName, type); - + assertNotNull(edmType.getBaseType()); assertEquals(2, edmAbstarctBaseType.getPropertyNames().size()); - + assertEquals(1, edmType.getKeyPropertyRefs().size()); assertEquals("Id", edmType.getKeyPredicateNames().get(0)); - + assertEquals(4, edmType.getPropertyNames().size()); assertEquals("Id", edmType.getPropertyNames().get(0)); assertEquals("Name", edmType.getPropertyNames().get(1)); assertEquals("address", edmType.getPropertyNames().get(2)); assertEquals("email", edmType.getPropertyNames().get(3)); - + assertEquals(2, edmType.getNavigationPropertyNames().size()); assertEquals("nav1", edmType.getNavigationPropertyNames().get(0)); assertEquals("nav2", edmType.getNavigationPropertyNames().get(1)); } - + @Test public void hasStream() { assertFalse(typeWithBaseType.hasStream()); diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEnumTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEnumTest.java index 091a55bfc..3334a8622 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEnumTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEnumTest.java @@ -24,9 +24,9 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; +import org.apache.olingo.commons.api.edm.provider.EnumMember; +import org.apache.olingo.commons.api.edm.provider.EnumType; import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; -import org.apache.olingo.server.api.edm.provider.EnumMember; -import org.apache.olingo.server.api.edm.provider.EnumType; import org.junit.Test; import java.util.Arrays; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImplTest.java index 30a6394eb..ca014cee4 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImplTest.java @@ -22,8 +22,8 @@ import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.EdmReturnType; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.server.api.edm.provider.Function; -import org.apache.olingo.server.api.edm.provider.ReturnType; +import org.apache.olingo.commons.api.edm.provider.Function; +import org.apache.olingo.commons.api.edm.provider.ReturnType; import org.junit.Before; import org.junit.Test; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImportImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImportImplTest.java index a653ccb56..4f1c33355 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImportImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmFunctionImportImplTest.java @@ -23,13 +23,13 @@ import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.EdmFunctionImport; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.Function; +import org.apache.olingo.commons.api.edm.provider.FunctionImport; +import org.apache.olingo.commons.api.edm.provider.Parameter; +import org.apache.olingo.commons.api.edm.provider.ReturnType; import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; -import org.apache.olingo.server.api.edm.provider.EdmProvider; -import org.apache.olingo.server.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.server.api.edm.provider.Function; -import org.apache.olingo.server.api.edm.provider.FunctionImport; -import org.apache.olingo.server.api.edm.provider.Parameter; -import org.apache.olingo.server.api.edm.provider.ReturnType; import org.junit.Test; import java.util.Arrays; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmKeyPropertyRefImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmKeyPropertyRefImplTest.java index 629d272ef..0515e1d1d 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmKeyPropertyRefImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmKeyPropertyRefImplTest.java @@ -24,7 +24,7 @@ import org.apache.olingo.commons.api.edm.EdmEntityType; import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.EdmKeyPropertyRef; import org.apache.olingo.commons.api.edm.EdmProperty; -import org.apache.olingo.server.api.edm.provider.PropertyRef; +import org.apache.olingo.commons.api.edm.provider.PropertyRef; import org.junit.Test; import static org.junit.Assert.assertEquals; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMappingTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMappingTest.java index cf2f43f5e..aaaeef00a 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMappingTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMappingTest.java @@ -28,9 +28,9 @@ import org.apache.olingo.commons.api.edm.EdmParameter; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.EdmProperty; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.server.api.edm.provider.Mapping; -import org.apache.olingo.server.api.edm.provider.Parameter; -import org.apache.olingo.server.api.edm.provider.Property; +import org.apache.olingo.commons.api.edm.provider.Mapping; +import org.apache.olingo.commons.api.edm.provider.Parameter; +import org.apache.olingo.commons.api.edm.provider.Property; import org.junit.Test; public class EdmMappingTest { diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMemberImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMemberImplTest.java index 210ffbb80..a1a0490db 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMemberImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMemberImplTest.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.server.core.edm.provider; -import org.apache.olingo.server.api.edm.provider.EnumMember; +import org.apache.olingo.commons.api.edm.provider.EnumMember; import org.junit.Test; import static org.junit.Assert.assertEquals; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmNavigationPropertyImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmNavigationPropertyImplTest.java index b0f6e7875..bb3b264dd 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmNavigationPropertyImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmNavigationPropertyImplTest.java @@ -23,11 +23,11 @@ import org.apache.olingo.commons.api.edm.EdmNavigationProperty; import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.server.api.edm.provider.EdmProvider; -import org.apache.olingo.server.api.edm.provider.EntityType; -import org.apache.olingo.server.api.edm.provider.NavigationProperty; -import org.apache.olingo.server.api.edm.provider.PropertyRef; -import org.apache.olingo.server.api.edm.provider.ReferentialConstraint; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.EntityType; +import org.apache.olingo.commons.api.edm.provider.NavigationProperty; +import org.apache.olingo.commons.api.edm.provider.PropertyRef; +import org.apache.olingo.commons.api.edm.provider.ReferentialConstraint; import org.junit.Test; import java.util.ArrayList; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmParameterImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmParameterImplTest.java index b06c69385..c5d003c23 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmParameterImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmParameterImplTest.java @@ -25,11 +25,11 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.server.api.edm.provider.ComplexType; -import org.apache.olingo.server.api.edm.provider.EdmProvider; -import org.apache.olingo.server.api.edm.provider.EnumType; -import org.apache.olingo.server.api.edm.provider.Parameter; -import org.apache.olingo.server.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.ComplexType; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.EnumType; +import org.apache.olingo.commons.api.edm.provider.Parameter; +import org.apache.olingo.commons.api.edm.provider.TypeDefinition; import org.junit.Test; import static org.junit.Assert.assertEquals; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmPropertyImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmPropertyImplTest.java index d21208403..5d9758c1b 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmPropertyImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmPropertyImplTest.java @@ -25,11 +25,11 @@ import org.apache.olingo.commons.api.edm.EdmProperty; import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.server.api.edm.provider.ComplexType; -import org.apache.olingo.server.api.edm.provider.EdmProvider; -import org.apache.olingo.server.api.edm.provider.EnumType; -import org.apache.olingo.server.api.edm.provider.Property; -import org.apache.olingo.server.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.ComplexType; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.EnumType; +import org.apache.olingo.commons.api.edm.provider.Property; +import org.apache.olingo.commons.api.edm.provider.TypeDefinition; import org.junit.Test; import static org.junit.Assert.assertEquals; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplOverloadingTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplOverloadingTest.java index 641769c3e..74ba46788 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplOverloadingTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplOverloadingTest.java @@ -23,10 +23,10 @@ import org.apache.olingo.commons.api.edm.EdmAction; import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.server.api.edm.provider.Action; -import org.apache.olingo.server.api.edm.provider.EdmProvider; -import org.apache.olingo.server.api.edm.provider.Function; -import org.apache.olingo.server.api.edm.provider.Parameter; +import org.apache.olingo.commons.api.edm.provider.Action; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.Function; +import org.apache.olingo.commons.api.edm.provider.Parameter; import org.junit.Before; import org.junit.Test; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplTest.java index c8a4e381c..f262ad658 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplTest.java @@ -27,14 +27,14 @@ import org.apache.olingo.commons.api.edm.EdmEnumType; import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.server.api.edm.provider.AliasInfo; -import org.apache.olingo.server.api.edm.provider.ComplexType; -import org.apache.olingo.server.api.edm.provider.EdmProvider; -import org.apache.olingo.server.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.server.api.edm.provider.EntityType; -import org.apache.olingo.server.api.edm.provider.EnumType; -import org.apache.olingo.server.api.edm.provider.PropertyRef; -import org.apache.olingo.server.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.AliasInfo; +import org.apache.olingo.commons.api.edm.provider.ComplexType; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.EntityType; +import org.apache.olingo.commons.api.edm.provider.EnumType; +import org.apache.olingo.commons.api.edm.provider.PropertyRef; +import org.apache.olingo.commons.api.edm.provider.TypeDefinition; import org.junit.Before; import org.junit.Test; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmReturnTypeImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmReturnTypeImplTest.java index fb69f12d5..461174a6a 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmReturnTypeImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmReturnTypeImplTest.java @@ -27,8 +27,8 @@ import org.apache.olingo.commons.api.edm.EdmReturnType; import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.ReturnType; import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; -import org.apache.olingo.server.api.edm.provider.ReturnType; import org.junit.Test; import static org.junit.Assert.assertEquals; @@ -48,11 +48,11 @@ public class EdmReturnTypeImplTest { assertEquals(EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.String), typeImpl.getType()); assertFalse(typeImpl.isCollection()); + assertTrue(typeImpl.isNullable()); assertNull(typeImpl.getPrecision()); assertNull(typeImpl.getMaxLength()); assertNull(typeImpl.getScale()); - assertNull(typeImpl.isNullable()); } @Test diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmSchemaImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmSchemaImplTest.java index 03007b38f..354e982fc 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmSchemaImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmSchemaImplTest.java @@ -33,22 +33,22 @@ import org.apache.olingo.commons.api.edm.EdmSchema; import org.apache.olingo.commons.api.edm.EdmSingleton; import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.server.api.edm.provider.Action; -import org.apache.olingo.server.api.edm.provider.ActionImport; -import org.apache.olingo.server.api.edm.provider.AliasInfo; -import org.apache.olingo.server.api.edm.provider.ComplexType; -import org.apache.olingo.server.api.edm.provider.EdmProvider; -import org.apache.olingo.server.api.edm.provider.EntityContainer; -import org.apache.olingo.server.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.server.api.edm.provider.EntitySet; -import org.apache.olingo.server.api.edm.provider.EntityType; -import org.apache.olingo.server.api.edm.provider.EnumType; -import org.apache.olingo.server.api.edm.provider.Function; -import org.apache.olingo.server.api.edm.provider.FunctionImport; -import org.apache.olingo.server.api.edm.provider.Schema; -import org.apache.olingo.server.api.edm.provider.Singleton; -import org.apache.olingo.server.api.edm.provider.Term; -import org.apache.olingo.server.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.Action; +import org.apache.olingo.commons.api.edm.provider.ActionImport; +import org.apache.olingo.commons.api.edm.provider.AliasInfo; +import org.apache.olingo.commons.api.edm.provider.ComplexType; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.EntityContainer; +import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.EntitySet; +import org.apache.olingo.commons.api.edm.provider.EntityType; +import org.apache.olingo.commons.api.edm.provider.EnumType; +import org.apache.olingo.commons.api.edm.provider.Function; +import org.apache.olingo.commons.api.edm.provider.FunctionImport; +import org.apache.olingo.commons.api.edm.provider.Schema; +import org.apache.olingo.commons.api.edm.provider.Singleton; +import org.apache.olingo.commons.api.edm.provider.Term; +import org.apache.olingo.commons.api.edm.provider.TypeDefinition; import org.junit.Before; import org.junit.Test; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmSingletonImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmSingletonImplTest.java index 56fa982b0..d8e3975ab 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmSingletonImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmSingletonImplTest.java @@ -25,12 +25,12 @@ import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.EdmSingleton; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.Target; -import org.apache.olingo.server.api.edm.provider.EdmProvider; -import org.apache.olingo.server.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.server.api.edm.provider.EntityType; -import org.apache.olingo.server.api.edm.provider.NavigationPropertyBinding; -import org.apache.olingo.server.api.edm.provider.PropertyRef; -import org.apache.olingo.server.api.edm.provider.Singleton; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.EntityType; +import org.apache.olingo.commons.api.edm.provider.NavigationPropertyBinding; +import org.apache.olingo.commons.api.edm.provider.PropertyRef; +import org.apache.olingo.commons.api.edm.provider.Singleton; import org.junit.Test; import java.util.Arrays; @@ -64,7 +64,7 @@ public class EdmSingletonImplTest { .setType(typeName) .setNavigationPropertyBindings(Arrays.asList( new NavigationPropertyBinding().setPath("path") - .setTarget(new Target().setEntityContainer(containerName).setTargetName(singletonName)))); + .setTarget(new Target().setEntityContainer(containerName).setTargetName(singletonName).toString()))); when(provider.getSingleton(containerName, singletonName)).thenReturn(singletonProvider); final EdmSingleton singleton = new EdmSingletonImpl(edm, entityContainer, singletonProvider); @@ -92,7 +92,7 @@ public class EdmSingletonImplTest { final Singleton singletonProvider = new Singleton() .setNavigationPropertyBindings(Arrays.asList( new NavigationPropertyBinding().setPath("path") - .setTarget(new Target().setEntityContainer(containerName).setTargetName("wrong")))); + .setTarget(new Target().setEntityContainer(containerName).setTargetName("wrong").toString()))); when(provider.getSingleton(containerName, singletonName)).thenReturn(singletonProvider); final EdmSingleton singleton = new EdmSingletonImpl(edm, null, singletonProvider); @@ -110,7 +110,7 @@ public class EdmSingletonImplTest { .setNavigationPropertyBindings(Arrays.asList( new NavigationPropertyBinding().setPath("path") .setTarget(new Target().setEntityContainer(new FullQualifiedName("ns", "wrongContainer")) - .setTargetName(singletonName)))); + .setTargetName(singletonName).toString()))); when(provider.getSingleton(containerName, singletonName)).thenReturn(singletonProvider); final EdmSingleton singleton = new EdmSingletonImpl(edm, null, singletonProvider); diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmTypeDefinitionImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmTypeDefinitionImplTest.java index 5fc116c80..4342afce0 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmTypeDefinitionImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmTypeDefinitionImplTest.java @@ -23,8 +23,8 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; +import org.apache.olingo.commons.api.edm.provider.TypeDefinition; import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; -import org.apache.olingo.server.api.edm.provider.TypeDefinition; import org.junit.Test; import static org.junit.Assert.assertEquals; @@ -60,7 +60,7 @@ public class EdmTypeDefinitionImplTest { assertNull(typeDefImpl.getMaxLength()); assertNull(typeDefImpl.getPrecision()); assertNull(typeDefImpl.getScale()); - assertNull(typeDefImpl.isUnicode()); + assertTrue(typeDefImpl.isUnicode()); } @Test(expected = EdmException.class) diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ComplexTypeHelper.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ComplexTypeHelper.java index 83368d6d2..1b16d4ba7 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ComplexTypeHelper.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ComplexTypeHelper.java @@ -28,15 +28,15 @@ import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.EdmComplexType; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.server.api.edm.provider.ComplexType; -import org.apache.olingo.server.api.edm.provider.EdmProvider; -import org.apache.olingo.server.api.edm.provider.NavigationProperty; -import org.apache.olingo.server.api.edm.provider.Property; +import org.apache.olingo.commons.api.edm.provider.ComplexType; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.NavigationProperty; +import org.apache.olingo.commons.api.edm.provider.Property; import org.apache.olingo.server.core.edm.provider.EdmComplexTypeImpl; import org.apache.olingo.server.core.edm.provider.EdmProviderImpl; public class ComplexTypeHelper { - + public static EdmComplexType createType() throws ODataException { EdmProvider provider = mock(EdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); @@ -44,7 +44,8 @@ public class ComplexTypeHelper { FullQualifiedName baseName = new FullQualifiedName("namespace", "BaseTypeName"); ComplexType baseComplexType = new ComplexType(); List baseProperties = new ArrayList(); - baseProperties.add(new Property().setName("prop1").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); + baseProperties.add(new Property().setName("prop1").setType( + EdmPrimitiveTypeKind.String.getFullQualifiedName())); List baseNavigationProperties = new ArrayList(); baseNavigationProperties.add(new NavigationProperty().setName("nav1")); baseComplexType.setName("BaseTypeName").setAbstract(false).setOpenType(false).setProperties(baseProperties) diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilderTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilderTest.java index 4f50213ed..20173597c 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilderTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilderTest.java @@ -33,11 +33,11 @@ import org.apache.olingo.commons.api.edm.EdmEntitySet; import org.apache.olingo.commons.api.edm.EdmEntityType; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.ComplexType; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.NavigationProperty; +import org.apache.olingo.commons.api.edm.provider.Property; import org.apache.olingo.commons.core.edm.primitivetype.EdmString; -import org.apache.olingo.server.api.edm.provider.ComplexType; -import org.apache.olingo.server.api.edm.provider.EdmProvider; -import org.apache.olingo.server.api.edm.provider.NavigationProperty; -import org.apache.olingo.server.api.edm.provider.Property; import org.apache.olingo.server.core.edm.provider.EdmComplexTypeImpl; import org.apache.olingo.server.core.edm.provider.EdmProviderImpl; import org.junit.Test; @@ -181,7 +181,8 @@ public class ContextURLBuilderTest { FullQualifiedName baseName = new FullQualifiedName("namespace", "BaseTypeName"); ComplexType baseComplexType = new ComplexType(); List baseProperties = new ArrayList(); - baseProperties.add(new Property().setName("prop1").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())); + baseProperties.add(new Property().setName("prop1").setType( + EdmPrimitiveTypeKind.String.getFullQualifiedName())); List baseNavigationProperties = new ArrayList(); baseNavigationProperties.add(new NavigationProperty().setName("nav1")); baseComplexType.setName("BaseTypeName").setAbstract(false).setOpenType(false).setProperties(baseProperties) diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializerTest.java index c3f650d17..13a662a67 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializerTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializerTest.java @@ -38,27 +38,27 @@ import org.apache.olingo.commons.api.edm.EdmComplexType; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.EdmSchema; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.Action; +import org.apache.olingo.commons.api.edm.provider.ActionImport; +import org.apache.olingo.commons.api.edm.provider.AliasInfo; +import org.apache.olingo.commons.api.edm.provider.ComplexType; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.EntityContainer; +import org.apache.olingo.commons.api.edm.provider.EntitySet; +import org.apache.olingo.commons.api.edm.provider.EntityType; +import org.apache.olingo.commons.api.edm.provider.EnumMember; +import org.apache.olingo.commons.api.edm.provider.EnumType; +import org.apache.olingo.commons.api.edm.provider.Function; +import org.apache.olingo.commons.api.edm.provider.FunctionImport; +import org.apache.olingo.commons.api.edm.provider.Parameter; +import org.apache.olingo.commons.api.edm.provider.Property; +import org.apache.olingo.commons.api.edm.provider.PropertyRef; +import org.apache.olingo.commons.api.edm.provider.ReturnType; +import org.apache.olingo.commons.api.edm.provider.Schema; +import org.apache.olingo.commons.api.edm.provider.Singleton; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.server.api.OData; import org.apache.olingo.server.api.ServiceMetadata; -import org.apache.olingo.server.api.edm.provider.Action; -import org.apache.olingo.server.api.edm.provider.ActionImport; -import org.apache.olingo.server.api.edm.provider.AliasInfo; -import org.apache.olingo.server.api.edm.provider.ComplexType; -import org.apache.olingo.server.api.edm.provider.EdmProvider; -import org.apache.olingo.server.api.edm.provider.EntityContainer; -import org.apache.olingo.server.api.edm.provider.EntitySet; -import org.apache.olingo.server.api.edm.provider.EntityType; -import org.apache.olingo.server.api.edm.provider.EnumMember; -import org.apache.olingo.server.api.edm.provider.EnumType; -import org.apache.olingo.server.api.edm.provider.Function; -import org.apache.olingo.server.api.edm.provider.FunctionImport; -import org.apache.olingo.server.api.edm.provider.Parameter; -import org.apache.olingo.server.api.edm.provider.Property; -import org.apache.olingo.server.api.edm.provider.PropertyRef; -import org.apache.olingo.server.api.edm.provider.ReturnType; -import org.apache.olingo.server.api.edm.provider.Schema; -import org.apache.olingo.server.api.edm.provider.Singleton; import org.apache.olingo.server.api.edmx.EdmxReference; import org.apache.olingo.server.api.edmx.EdmxReferenceInclude; import org.apache.olingo.server.api.edmx.EdmxReferenceIncludeAnnotation; @@ -216,6 +216,7 @@ public class MetadataDocumentXmlSerializerTest { InputStream metadataStream = serializer.metadataDocument(serviceMetadata); String metadata = IOUtils.toString(metadataStream); assertNotNull(metadata); + System.out.println(metadata); assertTrue(metadata.contains("")); assertTrue(metadata.contains("")); @@ -256,7 +257,6 @@ public class MetadataDocumentXmlSerializerTest { InputStream metadataStream = serializer.metadataDocument(serviceMetadata); String metadata = IOUtils.toString(metadataStream); - assertTrue(metadata.contains("" + "" + "" diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/data/DataProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/data/DataProvider.java index 61b763cef..6db43d0aa 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/data/DataProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/data/DataProvider.java @@ -385,7 +385,7 @@ public class DataProvider { if (edmProperty.isPrimitive()) { if (newProperty != null || !patch) { final Object value = newProperty == null ? null : newProperty.getValue(); - if (value == null && edmProperty.isNullable() != null && !edmProperty.isNullable()) { + if (value == null && !edmProperty.isNullable()) { throw new DataProviderException("Cannot null non-nullable property!", HttpStatusCode.BAD_REQUEST); } property.setValue(property.getValueType(), value); diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalPrimitiveComplexProcessor.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalPrimitiveComplexProcessor.java index 6d322d864..f1dfa954d 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalPrimitiveComplexProcessor.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalPrimitiveComplexProcessor.java @@ -290,7 +290,7 @@ public class TechnicalPrimitiveComplexProcessor extends TechnicalProcessor final EdmProperty edmProperty = ((UriResourceProperty) resourceParts.get(resourceParts.size() - 1)) .getProperty(); - if (edmProperty.isNullable() == null || edmProperty.isNullable()) { + if (edmProperty.isNullable()) { property.setValue(property.getValueType(), edmProperty.isCollection() ? Collections.emptyList() : null); response.setStatusCode(HttpStatusCode.NO_CONTENT.getStatusCode()); } else { diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ActionProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ActionProvider.java index 615889880..9226e138d 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ActionProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ActionProvider.java @@ -23,9 +23,9 @@ import java.util.List; import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.server.api.edm.provider.Action; -import org.apache.olingo.server.api.edm.provider.Parameter; -import org.apache.olingo.server.api.edm.provider.ReturnType; +import org.apache.olingo.commons.api.edm.provider.Action; +import org.apache.olingo.commons.api.edm.provider.Parameter; +import org.apache.olingo.commons.api.edm.provider.ReturnType; public class ActionProvider { diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ComplexTypeProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ComplexTypeProvider.java index 3f70ea694..767d639e9 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ComplexTypeProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ComplexTypeProvider.java @@ -18,13 +18,13 @@ */ package org.apache.olingo.server.tecsvc.provider; +import java.util.Arrays; + import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.server.api.edm.provider.ComplexType; -import org.apache.olingo.server.api.edm.provider.NavigationProperty; -import org.apache.olingo.server.api.edm.provider.Property; - -import java.util.Arrays; +import org.apache.olingo.commons.api.edm.provider.ComplexType; +import org.apache.olingo.commons.api.edm.provider.NavigationProperty; +import org.apache.olingo.commons.api.edm.provider.Property; public class ComplexTypeProvider { diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java index 3b438ddf8..aa8b60a62 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java @@ -21,13 +21,13 @@ package org.apache.olingo.server.tecsvc.provider; import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.Target; -import org.apache.olingo.server.api.edm.provider.ActionImport; -import org.apache.olingo.server.api.edm.provider.EntityContainer; -import org.apache.olingo.server.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.server.api.edm.provider.EntitySet; -import org.apache.olingo.server.api.edm.provider.FunctionImport; -import org.apache.olingo.server.api.edm.provider.NavigationPropertyBinding; -import org.apache.olingo.server.api.edm.provider.Singleton; +import org.apache.olingo.commons.api.edm.provider.ActionImport; +import org.apache.olingo.commons.api.edm.provider.EntityContainer; +import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.EntitySet; +import org.apache.olingo.commons.api.edm.provider.FunctionImport; +import org.apache.olingo.commons.api.edm.provider.NavigationPropertyBinding; +import org.apache.olingo.commons.api.edm.provider.Singleton; import java.util.ArrayList; import java.util.Arrays; @@ -152,10 +152,10 @@ public class ContainerProvider { .setNavigationPropertyBindings(Arrays.asList( new NavigationPropertyBinding() .setPath("NavPropertyETTwoPrimOne") - .setTarget(new Target().setTargetName("ESTwoPrim")), + .setTarget(new Target().setTargetName("ESTwoPrim").toString()), new NavigationPropertyBinding() .setPath("NavPropertyETTwoPrimMany") - .setTarget(new Target().setTargetName("ESTwoPrim")) + .setTarget(new Target().setTargetName("ESTwoPrim").toString()) )); } else if (name.equals("ESCollAllPrim")) { @@ -170,10 +170,10 @@ public class ContainerProvider { .setNavigationPropertyBindings(Arrays.asList( new NavigationPropertyBinding() .setPath("NavPropertyETAllPrimOne") - .setTarget(new Target().setTargetName("ESAllPrim")), + .setTarget(new Target().setTargetName("ESAllPrim").toString()), new NavigationPropertyBinding() .setPath("NavPropertyETAllPrimMany") - .setTarget(new Target().setTargetName("ESAllPrim")) + .setTarget(new Target().setTargetName("ESAllPrim").toString()) )); } else if (name.equals("ESMixPrimCollComp")) { @@ -265,55 +265,55 @@ public class ContainerProvider { .setNavigationPropertyBindings(Arrays.asList( new NavigationPropertyBinding() .setPath("NavPropertyETKeyNavOne") - .setTarget(new Target().setTargetName("ESKeyNav")), + .setTarget(new Target().setTargetName("ESKeyNav").toString()), new NavigationPropertyBinding() .setPath("NavPropertyETKeyNavMany") - .setTarget(new Target().setTargetName("ESKeyNav")), + .setTarget(new Target().setTargetName("ESKeyNav").toString()), new NavigationPropertyBinding() .setPath("NavPropertyETTwoKeyNavOne") - .setTarget(new Target().setTargetName("ESTwoKeyNav")), + .setTarget(new Target().setTargetName("ESTwoKeyNav").toString()), new NavigationPropertyBinding() .setPath("NavPropertyETTwoKeyNavMany") - .setTarget(new Target().setTargetName("ESTwoKeyNav")), + .setTarget(new Target().setTargetName("ESTwoKeyNav").toString()), new NavigationPropertyBinding() .setPath("NavPropertyETMediaOne") - .setTarget(new Target().setTargetName("ESMedia")), + .setTarget(new Target().setTargetName("ESMedia").toString()), new NavigationPropertyBinding() .setPath("NavPropertyETMediaMany") - .setTarget(new Target().setTargetName("ESMedia")), + .setTarget(new Target().setTargetName("ESMedia").toString()), new NavigationPropertyBinding() .setPath("PropertyCompNav/NavPropertyETTwoKeyNavOn") - .setTarget(new Target().setTargetName("ESTwoKeyNav")), + .setTarget(new Target().setTargetName("ESTwoKeyNav").toString()), new NavigationPropertyBinding() .setPath("PropertyCompNav/NavPropertyETTwoKeyNavMany") - .setTarget(new Target().setTargetName("ESTwoKeyNav")), + .setTarget(new Target().setTargetName("ESTwoKeyNav").toString()), new NavigationPropertyBinding() .setPath("PropertyCompNav/NavPropertyETMediaOne") - .setTarget(new Target().setTargetName("ESMedia")), + .setTarget(new Target().setTargetName("ESMedia").toString()), new NavigationPropertyBinding() .setPath("PropertyCompNav/NavPropertyETMediaMany") - .setTarget(new Target().setTargetName("ESMedia")), + .setTarget(new Target().setTargetName("ESMedia").toString()), new NavigationPropertyBinding() .setPath("PropertyCompCompNav/PropertyCompNav/NavPropertyETTwoKeyNavOne") - .setTarget(new Target().setTargetName("ESTwoKeyNav")), + .setTarget(new Target().setTargetName("ESTwoKeyNav").toString()), new NavigationPropertyBinding() .setPath("PropertyCompCompNav/PropertyCompNav/NavPropertyETTwoKeyNavMany") - .setTarget(new Target().setTargetName("ESTwoKeyNav")), + .setTarget(new Target().setTargetName("ESTwoKeyNav").toString()), new NavigationPropertyBinding() .setPath("PropertyCompCompNav/PropertyCompNav/NavPropertyETMediaOne") - .setTarget(new Target().setTargetName("ESMedia")), + .setTarget(new Target().setTargetName("ESMedia").toString()), new NavigationPropertyBinding() .setPath("PropertyCompCompNav/PropertyCompNav/NavPropertyETMediaMany") - .setTarget(new Target().setTargetName("ESMedia")), + .setTarget(new Target().setTargetName("ESMedia").toString()), new NavigationPropertyBinding() .setPath("ETKeyNav/PropertyCompNav/NavPropertyETTwoKeyNavMany") - .setTarget(new Target().setTargetName("ESTwoKeyNav")), + .setTarget(new Target().setTargetName("ESTwoKeyNav").toString()), new NavigationPropertyBinding() .setPath("ETKeyNav/PropertyCompNav/NavPropertyETTwoKeyNavMany") - .setTarget(new Target().setTargetName("ESTwoKeyNav")), + .setTarget(new Target().setTargetName("ESTwoKeyNav").toString()), new NavigationPropertyBinding() .setPath("PropertyCompNav/com.corp.odata.test1.CTNavFiveProp/NavPropertyETTwoKeyNavMany") - .setTarget(new Target().setTargetName("ESTwoKeyNav")) + .setTarget(new Target().setTargetName("ESTwoKeyNav").toString()) )); } else if (name.equals("ESTwoKeyNav")) { @@ -323,49 +323,49 @@ public class ContainerProvider { .setNavigationPropertyBindings(Arrays.asList( new NavigationPropertyBinding() .setPath("NavPropertyETKeyNavOne") - .setTarget(new Target().setTargetName("ESKeyNav")), + .setTarget(new Target().setTargetName("ESKeyNav").toString()), new NavigationPropertyBinding() .setPath("NavPropertyETKeyNavMany") - .setTarget(new Target().setTargetName("ESKeyNav")), + .setTarget(new Target().setTargetName("ESKeyNav").toString()), new NavigationPropertyBinding() .setPath("NavPropertyETTwoKeyNavOne") - .setTarget(new Target().setTargetName("ESTwoKeyNav")), + .setTarget(new Target().setTargetName("ESTwoKeyNav").toString()), new NavigationPropertyBinding() .setPath("NavPropertyETTwoKeyNavMany") - .setTarget(new Target().setTargetName("ESTwoKeyNav")), + .setTarget(new Target().setTargetName("ESTwoKeyNav").toString()), new NavigationPropertyBinding() .setPath("PropertyCompNav/NavPropertyETTwoKeyNavOne") - .setTarget(new Target().setTargetName("ESTwoKeyNav")), + .setTarget(new Target().setTargetName("ESTwoKeyNav").toString()), new NavigationPropertyBinding() .setPath("PropertyCompNav/NavPropertyETTwoKeyNavMany") - .setTarget(new Target().setTargetName("ESTwoKeyNav")), + .setTarget(new Target().setTargetName("ESTwoKeyNav").toString()), new NavigationPropertyBinding() .setPath("PropertyCompNav/NavPropertyETKeyNavOne") - .setTarget(new Target().setTargetName("ESKeyNav")), + .setTarget(new Target().setTargetName("ESKeyNav").toString()), new NavigationPropertyBinding() .setPath("PropertyCompNav/NavPropertyETKeyNavMany") - .setTarget(new Target().setTargetName("ESKeyNav")), + .setTarget(new Target().setTargetName("ESKeyNav").toString()), new NavigationPropertyBinding() .setPath("CollPropertyCompNav/NavPropertyETTwoKeyNavOne") - .setTarget(new Target().setTargetName("ESTwoKeyNav")), + .setTarget(new Target().setTargetName("ESTwoKeyNav").toString()), new NavigationPropertyBinding() .setPath("CollPropertyCompNav/NavPropertyETTwoKeyNavMany") - .setTarget(new Target().setTargetName("ESTwoKeyNav")), + .setTarget(new Target().setTargetName("ESTwoKeyNav").toString()), new NavigationPropertyBinding() .setPath("CollPropertyCompNav/NavPropertyETMediaOne") - .setTarget(new Target().setTargetName("ESMedia")), + .setTarget(new Target().setTargetName("ESMedia").toString()), new NavigationPropertyBinding() .setPath("CollPropertyCompNav/NavPropertyETMediaMany") - .setTarget(new Target().setTargetName("ESMedia")), + .setTarget(new Target().setTargetName("ESMedia").toString()), new NavigationPropertyBinding() .setPath("CollPropertyCompNav/NavPropertyETTwoKeyNavMany") - .setTarget(new Target().setTargetName("ESTwoKeyNav")), + .setTarget(new Target().setTargetName("ESTwoKeyNav").toString()), new NavigationPropertyBinding() .setPath("NavPropertyETTwoBaseTwoKeyNavOne") - .setTarget(new Target().setTargetName("ESBaseTwoKeyNav")), + .setTarget(new Target().setTargetName("ESBaseTwoKeyNav").toString()), new NavigationPropertyBinding() .setPath("NavPropertySINav") - .setTarget(new Target().setTargetName("SINav")) + .setTarget(new Target().setTargetName("SINav").toString()) )); } else if (name.equals("ESBaseTwoKeyNav")) { @@ -469,7 +469,7 @@ public class ContainerProvider { return new FunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFCRTETTwoKeyNav) - .setEntitySet(new Target().setEntityContainer(entityContainer).setTargetName("ESTwoKeyNav")) + .setEntitySet(new Target().setEntityContainer(entityContainer).setTargetName("ESTwoKeyNav").toString()) .setIncludeInServiceDocument(true); } else if (name.equals("FICRTETTwoKeyNavParam")) { return new FunctionImport() @@ -517,13 +517,13 @@ public class ContainerProvider { return new FunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFCRTETMedia) - .setEntitySet(new Target().setEntityContainer(entityContainer).setTargetName("ESMedia")) + .setEntitySet(new Target().setEntityContainer(entityContainer).setTargetName("ESMedia").toString()) .setIncludeInServiceDocument(true); } else if (name.equals("FICRTCollESMedia")) { return new FunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFCRTCollETMedia) - .setEntitySet(new Target().setEntityContainer(entityContainer).setTargetName("ESMedia")) + .setEntitySet(new Target().setEntityContainer(entityContainer).setTargetName("ESMedia").toString()) .setIncludeInServiceDocument(true); } else if (name.equals("FICRTCTTwoPrimParam")) { @@ -554,7 +554,7 @@ public class ContainerProvider { return new FunctionImport() .setName(name) .setFunction(FunctionProvider.nameUFCRTCollETTwoKeyNavParam) - .setEntitySet(new Target().setEntityContainer(entityContainer).setTargetName("ESTwoKeyNav")) + .setEntitySet(new Target().setEntityContainer(entityContainer).setTargetName("ESTwoKeyNav").toString()) .setIncludeInServiceDocument(true); } else if (name.equals("FICRTCollCTTwoPrimParam")) { @@ -584,7 +584,7 @@ public class ContainerProvider { .setNavigationPropertyBindings(Arrays.asList( new NavigationPropertyBinding() .setPath("NavPropertyETTwoKeyNavMany") - .setTarget(new Target().setTargetName("ESTwoKeyNav")))); + .setTarget(new Target().setTargetName("ESTwoKeyNav").toString()))); } else if (name.equals("SIMedia")) { return new Singleton() diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EdmTechProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EdmTechProvider.java index 65975eca1..2a94c0363 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EdmTechProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EdmTechProvider.java @@ -21,22 +21,22 @@ package org.apache.olingo.server.tecsvc.provider; import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.server.api.edmx.EdmxReference; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.server.api.edm.provider.Action; -import org.apache.olingo.server.api.edm.provider.ActionImport; -import org.apache.olingo.server.api.edm.provider.AliasInfo; -import org.apache.olingo.server.api.edm.provider.ComplexType; -import org.apache.olingo.server.api.edm.provider.EdmProvider; -import org.apache.olingo.server.api.edm.provider.EntityContainer; -import org.apache.olingo.server.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.server.api.edm.provider.EntitySet; -import org.apache.olingo.server.api.edm.provider.EntityType; -import org.apache.olingo.server.api.edm.provider.EnumType; -import org.apache.olingo.server.api.edm.provider.Function; -import org.apache.olingo.server.api.edm.provider.FunctionImport; -import org.apache.olingo.server.api.edm.provider.Schema; -import org.apache.olingo.server.api.edm.provider.Singleton; -import org.apache.olingo.server.api.edm.provider.Term; -import org.apache.olingo.server.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.Action; +import org.apache.olingo.commons.api.edm.provider.ActionImport; +import org.apache.olingo.commons.api.edm.provider.AliasInfo; +import org.apache.olingo.commons.api.edm.provider.ComplexType; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.EntityContainer; +import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.EntitySet; +import org.apache.olingo.commons.api.edm.provider.EntityType; +import org.apache.olingo.commons.api.edm.provider.EnumType; +import org.apache.olingo.commons.api.edm.provider.Function; +import org.apache.olingo.commons.api.edm.provider.FunctionImport; +import org.apache.olingo.commons.api.edm.provider.Schema; +import org.apache.olingo.commons.api.edm.provider.Singleton; +import org.apache.olingo.commons.api.edm.provider.Term; +import org.apache.olingo.commons.api.edm.provider.TypeDefinition; import java.util.Arrays; import java.util.Collections; diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java index b64734002..8004b170f 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java @@ -20,11 +20,11 @@ package org.apache.olingo.server.tecsvc.provider; import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.server.api.edm.provider.EntityType; -import org.apache.olingo.server.api.edm.provider.NavigationProperty; -import org.apache.olingo.server.api.edm.provider.Property; -import org.apache.olingo.server.api.edm.provider.PropertyRef; -import org.apache.olingo.server.api.edm.provider.ReferentialConstraint; +import org.apache.olingo.commons.api.edm.provider.EntityType; +import org.apache.olingo.commons.api.edm.provider.NavigationProperty; +import org.apache.olingo.commons.api.edm.provider.Property; +import org.apache.olingo.commons.api.edm.provider.PropertyRef; +import org.apache.olingo.commons.api.edm.provider.ReferentialConstraint; import java.util.Arrays; diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EnumTypeProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EnumTypeProvider.java index 79bdcb404..6b68a3396 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EnumTypeProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EnumTypeProvider.java @@ -21,8 +21,8 @@ package org.apache.olingo.server.tecsvc.provider; import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.server.api.edm.provider.EnumMember; -import org.apache.olingo.server.api.edm.provider.EnumType; +import org.apache.olingo.commons.api.edm.provider.EnumMember; +import org.apache.olingo.commons.api.edm.provider.EnumType; import java.util.Arrays; diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java index 058807db0..7a56d8cac 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java @@ -20,9 +20,9 @@ package org.apache.olingo.server.tecsvc.provider; import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.server.api.edm.provider.Function; -import org.apache.olingo.server.api.edm.provider.Parameter; -import org.apache.olingo.server.api.edm.provider.ReturnType; +import org.apache.olingo.commons.api.edm.provider.Function; +import org.apache.olingo.commons.api.edm.provider.Parameter; +import org.apache.olingo.commons.api.edm.provider.ReturnType; import java.util.ArrayList; import java.util.Arrays; diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java index d3aabe40f..aa77abfe1 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java @@ -20,8 +20,8 @@ package org.apache.olingo.server.tecsvc.provider; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.server.api.edm.provider.NavigationProperty; -import org.apache.olingo.server.api.edm.provider.Property; +import org.apache.olingo.commons.api.edm.provider.NavigationProperty; +import org.apache.olingo.commons.api.edm.provider.Property; public class PropertyProvider { @@ -553,7 +553,7 @@ public class PropertyProvider { * TODO add propertyStream * Property propertyStream = new Property() * .setName("PropertyStream") - * .setType(EdmStream.getFullQualifiedName()); + * .setFQNTypeName(EdmStream.getFullQualifiedName()); */ // Complex Properties ---------------------------------------------------------------------------------------------- diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java index 4c3652961..04e506093 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java @@ -19,13 +19,13 @@ package org.apache.olingo.server.tecsvc.provider; import org.apache.olingo.commons.api.ODataException; -import org.apache.olingo.server.api.edm.provider.Action; -import org.apache.olingo.server.api.edm.provider.ComplexType; -import org.apache.olingo.server.api.edm.provider.EntityType; -import org.apache.olingo.server.api.edm.provider.EnumType; -import org.apache.olingo.server.api.edm.provider.Function; -import org.apache.olingo.server.api.edm.provider.Schema; -import org.apache.olingo.server.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.Action; +import org.apache.olingo.commons.api.edm.provider.ComplexType; +import org.apache.olingo.commons.api.edm.provider.EntityType; +import org.apache.olingo.commons.api.edm.provider.EnumType; +import org.apache.olingo.commons.api.edm.provider.Function; +import org.apache.olingo.commons.api.edm.provider.Schema; +import org.apache.olingo.commons.api.edm.provider.TypeDefinition; import java.util.ArrayList; import java.util.List; diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/TypeDefinitionProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/TypeDefinitionProvider.java index 242c44fdf..9c99e7961 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/TypeDefinitionProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/TypeDefinitionProvider.java @@ -20,7 +20,7 @@ package org.apache.olingo.server.tecsvc.provider; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.server.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.TypeDefinition; public class TypeDefinitionProvider { diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java index 77db919a1..b07f709c6 100644 --- a/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java +++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java @@ -39,6 +39,8 @@ import org.apache.commons.io.IOUtils; import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.EntitySet; import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.commons.api.http.HttpContentType; @@ -51,8 +53,6 @@ import org.apache.olingo.server.api.ODataRequest; import org.apache.olingo.server.api.ODataResponse; import org.apache.olingo.server.api.ODataServerError; import org.apache.olingo.server.api.ServiceMetadata; -import org.apache.olingo.server.api.edm.provider.EdmProvider; -import org.apache.olingo.server.api.edm.provider.EntitySet; import org.apache.olingo.server.api.edmx.EdmxReference; import org.apache.olingo.server.api.processor.ActionComplexCollectionProcessor; import org.apache.olingo.server.api.processor.ActionComplexProcessor; diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerEntityTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerEntityTest.java index 382806c6c..cd421f43e 100644 --- a/lib/server-test/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerEntityTest.java +++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerEntityTest.java @@ -45,13 +45,13 @@ import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmEntityType; import org.apache.olingo.commons.api.edm.EdmProperty; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.edm.provider.Mapping; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.commons.core.edm.primitivetype.EdmDate; import org.apache.olingo.commons.core.edm.primitivetype.EdmDateTimeOffset; import org.apache.olingo.server.api.OData; import org.apache.olingo.server.api.deserializer.DeserializerException; import org.apache.olingo.server.api.deserializer.ODataDeserializer; -import org.apache.olingo.server.api.edm.provider.Mapping; import org.apache.olingo.server.api.edmx.EdmxReference; import org.apache.olingo.server.tecsvc.provider.EdmTechProvider; import org.junit.Test; diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentTest.java index 01ab43624..2dfb67ec5 100644 --- a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentTest.java +++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentTest.java @@ -86,9 +86,6 @@ public class MetadataDocumentTest { containsString("" + "")); - // TODO: TypeDefinition - // assertThat(metadata, containsString("")); - assertThat(metadata, containsString("" + "" + "")); diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/EdmTechTestProvider.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/EdmTechTestProvider.java index 8b834b3f8..a48627dee 100644 --- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/EdmTechTestProvider.java +++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/EdmTechTestProvider.java @@ -21,11 +21,11 @@ package org.apache.olingo.server.core.uri.testutil; import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.server.api.edm.provider.ComplexType; -import org.apache.olingo.server.api.edm.provider.EntitySet; -import org.apache.olingo.server.api.edm.provider.EntityType; -import org.apache.olingo.server.api.edm.provider.Property; -import org.apache.olingo.server.api.edm.provider.PropertyRef; +import org.apache.olingo.commons.api.edm.provider.ComplexType; +import org.apache.olingo.commons.api.edm.provider.EntitySet; +import org.apache.olingo.commons.api.edm.provider.EntityType; +import org.apache.olingo.commons.api.edm.provider.Property; +import org.apache.olingo.commons.api.edm.provider.PropertyRef; import org.apache.olingo.server.tecsvc.provider.EdmTechProvider; import java.util.Arrays; diff --git a/samples/server/src/main/java/org/apache/olingo/server/sample/edmprovider/CarsEdmProvider.java b/samples/server/src/main/java/org/apache/olingo/server/sample/edmprovider/CarsEdmProvider.java index f5ba2a27b..5f59db472 100644 --- a/samples/server/src/main/java/org/apache/olingo/server/sample/edmprovider/CarsEdmProvider.java +++ b/samples/server/src/main/java/org/apache/olingo/server/sample/edmprovider/CarsEdmProvider.java @@ -26,17 +26,17 @@ import org.apache.olingo.commons.api.ODataException; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.Target; -import org.apache.olingo.server.api.edm.provider.ComplexType; -import org.apache.olingo.server.api.edm.provider.EdmProvider; -import org.apache.olingo.server.api.edm.provider.EntityContainer; -import org.apache.olingo.server.api.edm.provider.EntityContainerInfo; -import org.apache.olingo.server.api.edm.provider.EntitySet; -import org.apache.olingo.server.api.edm.provider.EntityType; -import org.apache.olingo.server.api.edm.provider.NavigationProperty; -import org.apache.olingo.server.api.edm.provider.NavigationPropertyBinding; -import org.apache.olingo.server.api.edm.provider.Property; -import org.apache.olingo.server.api.edm.provider.PropertyRef; -import org.apache.olingo.server.api.edm.provider.Schema; +import org.apache.olingo.commons.api.edm.provider.ComplexType; +import org.apache.olingo.commons.api.edm.provider.EdmProvider; +import org.apache.olingo.commons.api.edm.provider.EntityContainer; +import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo; +import org.apache.olingo.commons.api.edm.provider.EntitySet; +import org.apache.olingo.commons.api.edm.provider.EntityType; +import org.apache.olingo.commons.api.edm.provider.NavigationProperty; +import org.apache.olingo.commons.api.edm.provider.NavigationPropertyBinding; +import org.apache.olingo.commons.api.edm.provider.Property; +import org.apache.olingo.commons.api.edm.provider.PropertyRef; +import org.apache.olingo.commons.api.edm.provider.Schema; public class CarsEdmProvider extends EdmProvider { @@ -122,14 +122,15 @@ public class CarsEdmProvider extends EdmProvider { .setNavigationPropertyBindings( Arrays.asList( new NavigationPropertyBinding().setPath("Manufacturer").setTarget( - new Target().setTargetName(ES_MANUFACTURER_NAME).setEntityContainer(CONTAINER_FQN)))); + new Target().setTargetName(ES_MANUFACTURER_NAME).setEntityContainer(CONTAINER_FQN) + .toString()))); } else if (ES_MANUFACTURER_NAME.equals(entitySetName)) { return new EntitySet() .setName(ES_MANUFACTURER_NAME) .setType(ET_MANUFACTURER).setNavigationPropertyBindings( Arrays.asList( new NavigationPropertyBinding().setPath("Cars").setTarget( - new Target().setTargetName(ES_CARS_NAME).setEntityContainer(CONTAINER_FQN)))); + new Target().setTargetName(ES_CARS_NAME).setEntityContainer(CONTAINER_FQN).toString()))); } }