olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [1/5] git commit: [OLINGO-264] Adding data and domain objects for instance annotations
Date Wed, 07 May 2014 10:39:34 GMT
Repository: olingo-odata4
Updated Branches:
  refs/heads/master f02d9a07e -> 8caf3fece


[OLINGO-264] Adding data and domain objects for instance annotations


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/70cdaef5
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/70cdaef5
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/70cdaef5

Branch: refs/heads/master
Commit: 70cdaef51537a868a207c796e06caf7e501bbd2b
Parents: dda7577
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Tue May 6 10:32:34 2014 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Tue May 6 10:32:34 2014 +0200

----------------------------------------------------------------------
 .../client/core/op/AbstractODataBinder.java     |  10 +-
 .../olingo/commons/api/data/Annotatable.java    |  29 ++++++
 .../olingo/commons/api/data/Annotation.java     |  37 +++++++
 .../apache/olingo/commons/api/data/Entity.java  |   2 +-
 .../olingo/commons/api/data/EntitySet.java      |   2 +-
 .../apache/olingo/commons/api/data/Link.java    |   2 +-
 .../commons/api/data/LinkedComplexValue.java    |   5 +-
 .../olingo/commons/api/data/Property.java       |   2 +-
 .../api/domain/CommonODataObjectFactory.java    |   4 +
 .../olingo/commons/api/domain/ODataItem.java    |   9 --
 .../olingo/commons/api/domain/ODataLink.java    |  20 ++--
 .../api/domain/v4/ODataAnnotatatable.java       |  26 +++++
 .../commons/api/domain/v4/ODataAnnotation.java  | 103 +++++++++++++++++++
 .../commons/api/domain/v4/ODataEntity.java      |   2 +-
 .../commons/api/domain/v4/ODataEntitySet.java   |   2 +-
 .../olingo/commons/api/domain/v4/ODataLink.java |  74 +++++++++++++
 .../api/domain/v4/ODataLinkedComplexValue.java  |   3 +-
 .../api/domain/v4/ODataObjectFactory.java       |  12 +++
 .../commons/api/domain/v4/ODataProperty.java    |   2 +-
 .../core/data/AbstractAnnotatedObject.java      |  37 +++++++
 .../commons/core/data/AbstractODataObject.java  |   2 +-
 .../commons/core/data/AbstractProperty.java     |  21 +---
 .../olingo/commons/core/data/LinkImpl.java      |   2 +-
 .../core/data/LinkedComplexValueImpl.java       |   7 ++
 .../core/domain/AbstractODataObjectFactory.java |  14 ---
 .../core/domain/v3/ODataObjectFactoryImpl.java  |  24 +++++
 .../core/domain/v4/ODataComplexValueImpl.java   |   9 ++
 .../core/domain/v4/ODataDeletedEntityImpl.java  |   8 +-
 .../core/domain/v4/ODataDeltaLinkImpl.java      |  12 ++-
 .../commons/core/domain/v4/ODataEntityImpl.java |   8 ++
 .../core/domain/v4/ODataEntitySetImpl.java      |  12 ++-
 .../core/domain/v4/ODataObjectFactoryImpl.java  |  26 +++++
 .../core/domain/v4/ODataPropertyImpl.java       |   9 ++
 33 files changed, 454 insertions(+), 83 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/client-core/src/main/java/org/apache/olingo/client/core/op/AbstractODataBinder.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/AbstractODataBinder.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/AbstractODataBinder.java
index 125cca4..c54b9e7 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/AbstractODataBinder.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/AbstractODataBinder.java
@@ -114,7 +114,7 @@ public abstract class AbstractODataBinder implements CommonODataBinder {
     if (next != null) {
       entitySet.setNext(next);
     }
-    
+
     for (CommonODataEntity entity : odataEntitySet.getEntities()) {
       entitySet.getEntities().add(getEntity(entity, ResourceFactory.entityClassForEntitySet(reference)));
     }
@@ -409,13 +409,11 @@ public abstract class AbstractODataBinder implements CommonODataBinder {
     }
 
     for (Link link : resource.getPayload().getAssociationLinks()) {
-      entity.addLink(new ODataLink.Builder().setVersion(client.getServiceVersion()).
-              setURI(URIUtils.getURI(base, link.getHref())).
-              setType(ODataLinkType.ASSOCIATION).setTitle(link.getTitle()).build());
+      entity.addLink(client.getObjectFactory().
+              newAssociationLink(link.getTitle(), URIUtils.getURI(base, link.getHref())));
     }
 
-    odataNavigationLinks(
-            edmType, resource.getPayload(), entity, resource.getMetadataETag(), base);
+    odataNavigationLinks(edmType, resource.getPayload(), entity, resource.getMetadataETag(), base);
 
     for (Link link : resource.getPayload().getMediaEditLinks()) {
       entity.addLink(new ODataLink.Builder().setVersion(client.getServiceVersion()).

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Annotatable.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Annotatable.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Annotatable.java
new file mode 100644
index 0000000..4be0262
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Annotatable.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   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.data;
+
+import java.util.List;
+
+/**
+ * An element with instance annotations.
+ */
+public interface Annotatable {
+
+  List<Annotation> getAnnotations();
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Annotation.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Annotation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Annotation.java
new file mode 100644
index 0000000..96db646
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Annotation.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   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.data;
+
+/**
+ * Represents an instance annotation.
+ */
+public interface Annotation {
+
+  String getTerm();
+
+  void setTerm(String term);
+
+  String getType();
+
+  void setType(String type);
+
+  Value getValue();
+
+  void setValue(Value value);
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Entity.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Entity.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Entity.java
index ed0ad15..67561f9 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Entity.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Entity.java
@@ -22,7 +22,7 @@ import org.apache.olingo.commons.api.domain.ODataOperation;
 import java.net.URI;
 import java.util.List;
 
-public interface Entity extends Linked {
+public interface Entity extends Linked, Annotatable {
 
   /**
    * Gets ETag.

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/EntitySet.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/EntitySet.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/EntitySet.java
index ce798a9..a4ccf42 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/EntitySet.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/EntitySet.java
@@ -21,7 +21,7 @@ package org.apache.olingo.commons.api.data;
 import java.net.URI;
 import java.util.List;
 
-public interface EntitySet {
+public interface EntitySet extends Annotatable {
 
   /**
    * Gets base URI.

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Link.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Link.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Link.java
index 63c953a..808216d 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Link.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Link.java
@@ -18,7 +18,7 @@
  */
 package org.apache.olingo.commons.api.data;
 
-public interface Link {
+public interface Link extends Annotatable {
 
   /**
    * Gets rel info.

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/LinkedComplexValue.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/LinkedComplexValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/LinkedComplexValue.java
index 13cb72c..057a535 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/LinkedComplexValue.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/LinkedComplexValue.java
@@ -16,9 +16,8 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
 package org.apache.olingo.commons.api.data;
 
-public interface LinkedComplexValue extends ComplexValue, Linked {
-  
+public interface LinkedComplexValue extends ComplexValue, Linked, Annotatable {
+
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Property.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Property.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Property.java
index feb8f71..3f1ca03 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Property.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Property.java
@@ -18,7 +18,7 @@
  */
 package org.apache.olingo.commons.api.data;
 
-public interface Property {
+public interface Property extends Annotatable {
 
   String getName();
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/CommonODataObjectFactory.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/CommonODataObjectFactory.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/CommonODataObjectFactory.java
index eead623..bb61da1 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/CommonODataObjectFactory.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/CommonODataObjectFactory.java
@@ -94,6 +94,10 @@ public interface CommonODataObjectFactory {
    */
   ODataLink newEntityNavigationLink(String name, URI link);
 
+  ODataLink newAssociationLink(String name, URI link);
+
+  ODataLink newMediaEditLink(String name, URI link);
+
   ODataPrimitiveValue.Builder newPrimitiveValueBuilder();
 
   ODataComplexValue<? extends CommonODataProperty> newComplexValue(String typeName);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataItem.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataItem.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataItem.java
index 3ad5ed5..f97e4d4 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataItem.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataItem.java
@@ -81,25 +81,16 @@ public abstract class ODataItem implements Serializable {
     this.link = link;
   }
 
-  /**
-   * {@inheritDoc }
-   */
   @Override
   public boolean equals(final Object obj) {
     return EqualsBuilder.reflectionEquals(this, obj);
   }
 
-  /**
-   * {@inheritDoc }
-   */
   @Override
   public int hashCode() {
     return HashCodeBuilder.reflectionHashCode(this);
   }
 
-  /**
-   * {@inheritDoc }
-   */
   @Override
   public String toString() {
     return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataLink.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataLink.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataLink.java
index 1b74caa..2f8068e 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataLink.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataLink.java
@@ -30,15 +30,13 @@ public class ODataLink extends ODataItem {
 
   public static class Builder {
 
-    private ODataServiceVersion version;
+    protected ODataServiceVersion version;
 
-    private URI uri;
+    protected URI uri;
 
-    private ODataLinkType type;
+    protected ODataLinkType type;
 
-    private String title;
-
-    private String mediaETag;
+    protected String title;
 
     public Builder setVersion(final ODataServiceVersion version) {
       this.version = version;
@@ -65,14 +63,8 @@ public class ODataLink extends ODataItem {
       return this;
     }
 
-    public void setMediaETag(final String mediaETag) {
-      this.mediaETag = mediaETag;
-    }
-
     public ODataLink build() {
-      final ODataLink instance = new ODataLink(version, uri, type, title);
-      instance.mediaETag = this.mediaETag;
-      return instance;
+      return new ODataLink(version, uri, type, title);
     }
   }
 
@@ -111,7 +103,7 @@ public class ODataLink extends ODataItem {
   /**
    * ETag for media edit links.
    */
-  private String mediaETag;
+  protected String mediaETag;
 
   /**
    * Constructor.

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataAnnotatatable.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataAnnotatatable.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataAnnotatatable.java
new file mode 100644
index 0000000..7481efc
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataAnnotatatable.java
@@ -0,0 +1,26 @@
+/*
+ * 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.domain.v4;
+
+import java.util.List;
+
+public interface ODataAnnotatatable {
+
+  List<ODataAnnotation> getAnnotations();
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataAnnotation.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataAnnotation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataAnnotation.java
new file mode 100644
index 0000000..d90ff4f
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataAnnotation.java
@@ -0,0 +1,103 @@
+/*
+ * 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.domain.v4;
+
+import org.apache.olingo.commons.api.domain.ODataCollectionValue;
+import org.apache.olingo.commons.api.domain.ODataComplexValue;
+import org.apache.olingo.commons.api.domain.ODataPrimitiveValue;
+
+public interface ODataAnnotation {
+
+  /**
+   * Returns annotation name.
+   *
+   * @return annotation name.
+   */
+  String getTerm();
+
+  /**
+   * Returns annotation value.
+   *
+   * @return annotation value.
+   */
+  ODataValue getValue();
+
+  /**
+   * Checks if has null value.
+   *
+   * @return 'TRUE' if has null value; 'FALSE' otherwise.
+   */
+  boolean hasNullValue();
+
+  /**
+   * Checks if has primitive value.
+   *
+   * @return 'TRUE' if has primitive value; 'FALSE' otherwise.
+   */
+  boolean hasPrimitiveValue();
+
+  /**
+   * Gets primitive value.
+   *
+   * @return primitive value if exists; null otherwise.
+   */
+  ODataPrimitiveValue getPrimitiveValue();
+
+  /**
+   * Checks if has collection value.
+   *
+   * @return 'TRUE' if has collection value; 'FALSE' otherwise.
+   */
+  boolean hasCollectionValue();
+
+  /**
+   * Gets collection value.
+   *
+   * @return collection value if exists; null otherwise.
+   */
+  ODataCollectionValue<ODataValue> getCollectionValue();
+
+  /**
+   * Checks if has complex value.
+   *
+   * @return 'TRUE' if has complex value; 'FALSE' otherwise.
+   */
+  boolean hasComplexValue();
+
+  /**
+   * Gets complex value.
+   *
+   * @return complex value if exists; null otherwise.
+   */
+  ODataComplexValue<ODataProperty> getComplexValue();
+
+  /**
+   * Checks if has enum value.
+   *
+   * @return 'TRUE' if has enum value; 'FALSE' otherwise.
+   */
+  boolean hasEnumValue();
+
+  /**
+   * Gets enum value.
+   *
+   * @return enum value if exists; null otherwise.
+   */
+  ODataEnumValue getEnumValue();
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntity.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntity.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntity.java
index df9e801..fb24dda 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntity.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntity.java
@@ -21,7 +21,7 @@ package org.apache.olingo.commons.api.domain.v4;
 import java.util.List;
 import org.apache.olingo.commons.api.domain.CommonODataEntity;
 
-public interface ODataEntity extends CommonODataEntity {
+public interface ODataEntity extends CommonODataEntity, ODataAnnotatatable {
 
   @Override
   ODataProperty getProperty(String name);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntitySet.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntitySet.java
index cd06f44..ca25b0b 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntitySet.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntitySet.java
@@ -22,7 +22,7 @@ import java.net.URI;
 import java.util.List;
 import org.apache.olingo.commons.api.domain.CommonODataEntitySet;
 
-public interface ODataEntitySet extends CommonODataEntitySet {
+public interface ODataEntitySet extends CommonODataEntitySet, ODataAnnotatatable {
 
   @Override
   List<ODataEntity> getEntities();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataLink.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataLink.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataLink.java
new file mode 100644
index 0000000..5ff76a8
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataLink.java
@@ -0,0 +1,74 @@
+/*
+ * 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.domain.v4;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.olingo.commons.api.domain.ODataLinkType;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+
+public class ODataLink extends org.apache.olingo.commons.api.domain.ODataLink implements ODataAnnotatatable {
+
+  private static final long serialVersionUID = 8953805653775734101L;
+
+  public static class Builder extends org.apache.olingo.commons.api.domain.ODataLink.Builder {
+
+    @Override
+    public Builder setVersion(final ODataServiceVersion version) {
+      super.setVersion(version);
+      return this;
+    }
+
+    @Override
+    public Builder setURI(final URI uri) {
+      super.setURI(uri);
+      return this;
+    }
+
+    @Override
+    public Builder setType(final ODataLinkType type) {
+      super.setType(type);
+      return this;
+    }
+
+    @Override
+    public Builder setTitle(final String title) {
+      super.setTitle(title);
+      return this;
+    }
+
+    @Override
+    public ODataLink build() {
+      return new ODataLink(version, uri, type, title);
+    }
+  }
+
+  private final List<ODataAnnotation> annotations = new ArrayList<ODataAnnotation>();
+
+  public ODataLink(final ODataServiceVersion version, final URI uri, final ODataLinkType type, final String title) {
+    super(version, uri, type, title);
+  }
+
+  @Override
+  public List<ODataAnnotation> getAnnotations() {
+    return annotations;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataLinkedComplexValue.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataLinkedComplexValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataLinkedComplexValue.java
index a54be59..6717510 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataLinkedComplexValue.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataLinkedComplexValue.java
@@ -21,6 +21,7 @@ package org.apache.olingo.commons.api.domain.v4;
 import org.apache.olingo.commons.api.domain.ODataComplexValue;
 import org.apache.olingo.commons.api.domain.ODataLinked;
 
-public interface ODataLinkedComplexValue extends ODataValue, ODataLinked, ODataComplexValue<ODataProperty> {
+public interface ODataLinkedComplexValue
+        extends ODataValue, ODataLinked, ODataComplexValue<ODataProperty>, ODataAnnotatatable {
 
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataObjectFactory.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataObjectFactory.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataObjectFactory.java
index 13abadc..b027027 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataObjectFactory.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataObjectFactory.java
@@ -40,6 +40,18 @@ public interface ODataObjectFactory extends CommonODataObjectFactory {
   @Override
   ODataEntity newEntity(FullQualifiedName typeName, URI link);
 
+  @Override
+  ODataLink newEntitySetNavigationLink(String name, URI link);
+
+  @Override
+  ODataLink newEntityNavigationLink(String name, URI link);
+
+  @Override
+  ODataLink newAssociationLink(String name, URI link);
+
+  @Override
+  ODataLink newMediaEditLink(String name, URI link);
+
   ODataEnumValue newEnumValue(String typeName, String value);
 
   @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataProperty.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataProperty.java
index 4031486..eaff66c 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataProperty.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataProperty.java
@@ -22,7 +22,7 @@ import org.apache.olingo.commons.api.domain.CommonODataProperty;
 import org.apache.olingo.commons.api.domain.ODataCollectionValue;
 import org.apache.olingo.commons.api.domain.ODataComplexValue;
 
-public interface ODataProperty extends CommonODataProperty {
+public interface ODataProperty extends CommonODataProperty, ODataAnnotatatable {
 
   /**
    * Gets collection value.

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractAnnotatedObject.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractAnnotatedObject.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractAnnotatedObject.java
new file mode 100644
index 0000000..6383c80
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractAnnotatedObject.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   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.core.data;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.olingo.commons.api.data.Annotatable;
+import org.apache.olingo.commons.api.data.Annotation;
+
+public abstract class AbstractAnnotatedObject extends AbstractPayloadObject implements Annotatable {
+
+  private static final long serialVersionUID = 4163841499530412213L;
+
+  private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+  @Override
+  public List<Annotation> getAnnotations() {
+    return annotations;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractODataObject.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractODataObject.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractODataObject.java
index a86dad7..1050867 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractODataObject.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractODataObject.java
@@ -23,7 +23,7 @@ import java.net.URI;
 import java.text.ParseException;
 import java.util.Date;
 
-abstract class AbstractODataObject extends AbstractPayloadObject {
+abstract class AbstractODataObject extends AbstractAnnotatedObject {
 
   private static final long serialVersionUID = -4391162864875546927L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractProperty.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractProperty.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractProperty.java
index 940bf89..3f8da74 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractProperty.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractProperty.java
@@ -18,14 +18,10 @@
  */
 package org.apache.olingo.commons.core.data;
 
-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.commons.api.data.Property;
 import org.apache.olingo.commons.api.data.Value;
 
-public abstract class AbstractProperty implements Property {
+public abstract class AbstractProperty extends AbstractAnnotatedObject implements Property {
 
   private String name;
 
@@ -62,19 +58,4 @@ public abstract class AbstractProperty implements Property {
   public void setValue(final Value value) {
     this.value = value;
   }
-
-  @Override
-  public boolean equals(final Object obj) {
-    return EqualsBuilder.reflectionEquals(this, obj);
-  }
-
-  @Override
-  public int hashCode() {
-    return HashCodeBuilder.reflectionHashCode(this);
-  }
-
-  @Override
-  public String toString() {
-    return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
-  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/LinkImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/LinkImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/LinkImpl.java
index bb865d1..85acc8f 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/LinkImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/LinkImpl.java
@@ -22,7 +22,7 @@ import org.apache.olingo.commons.api.data.Entity;
 import org.apache.olingo.commons.api.data.EntitySet;
 import org.apache.olingo.commons.api.data.Link;
 
-public class LinkImpl extends AbstractPayloadObject implements Link {
+public class LinkImpl extends AbstractAnnotatedObject implements Link {
 
   private static final long serialVersionUID = -3449344217160035501L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/LinkedComplexValueImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/LinkedComplexValueImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/LinkedComplexValueImpl.java
index 4394dfa..a1bc0c8 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/LinkedComplexValueImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/LinkedComplexValueImpl.java
@@ -20,6 +20,7 @@ package org.apache.olingo.commons.core.data;
 
 import java.util.ArrayList;
 import java.util.List;
+import org.apache.olingo.commons.api.data.Annotation;
 import org.apache.olingo.commons.api.data.Link;
 import org.apache.olingo.commons.api.data.LinkedComplexValue;
 
@@ -29,6 +30,8 @@ public class LinkedComplexValueImpl extends ComplexValueImpl implements LinkedCo
 
   private final List<Link> navigationLinks = new ArrayList<Link>();
 
+  private final List<Annotation> annotations = new ArrayList<Annotation>();
+
   @Override
   public boolean isLinkedComplex() {
     return true;
@@ -44,4 +47,8 @@ public class LinkedComplexValueImpl extends ComplexValueImpl implements LinkedCo
     return navigationLinks;
   }
 
+  @Override
+  public List<Annotation> getAnnotations() {
+    return annotations;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/AbstractODataObjectFactory.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/AbstractODataObjectFactory.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/AbstractODataObjectFactory.java
index 0e438c5..d3f4afc 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/AbstractODataObjectFactory.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/AbstractODataObjectFactory.java
@@ -18,13 +18,11 @@
  */
 package org.apache.olingo.commons.core.domain;
 
-import java.net.URI;
 import org.apache.olingo.commons.api.domain.ODataLinkType;
 import org.apache.olingo.commons.api.domain.CommonODataEntity;
 import org.apache.olingo.commons.api.domain.CommonODataEntitySet;
 import org.apache.olingo.commons.api.domain.ODataInlineEntity;
 import org.apache.olingo.commons.api.domain.ODataInlineEntitySet;
-import org.apache.olingo.commons.api.domain.ODataLink;
 import org.apache.olingo.commons.api.domain.CommonODataObjectFactory;
 import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
 
@@ -47,16 +45,4 @@ public abstract class AbstractODataObjectFactory implements CommonODataObjectFac
   public ODataInlineEntity newDeepInsertEntity(final String name, final CommonODataEntity entity) {
     return new ODataInlineEntity(version, null, ODataLinkType.ENTITY_NAVIGATION, name, entity);
   }
-
-  @Override
-  public ODataLink newEntityNavigationLink(final String name, final URI link) {
-    return new ODataLink.Builder().setVersion(version).setURI(link).
-            setType(ODataLinkType.ENTITY_NAVIGATION).setTitle(name).build();
-  }
-
-  @Override
-  public ODataLink newEntitySetNavigationLink(final String name, final URI link) {
-    return new ODataLink.Builder().setVersion(version).setURI(link).
-            setType(ODataLinkType.ENTITY_SET_NAVIGATION).setTitle(name).build();
-  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v3/ODataObjectFactoryImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v3/ODataObjectFactoryImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v3/ODataObjectFactoryImpl.java
index f488ed9..b647bcf 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v3/ODataObjectFactoryImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v3/ODataObjectFactoryImpl.java
@@ -68,6 +68,30 @@ public class ODataObjectFactoryImpl extends AbstractODataObjectFactory implement
   }
 
   @Override
+  public ODataLink newEntityNavigationLink(final String name, final URI link) {
+    return new ODataLink.Builder().setVersion(version).setURI(link).
+            setType(ODataLinkType.ENTITY_NAVIGATION).setTitle(name).build();
+  }
+
+  @Override
+  public ODataLink newEntitySetNavigationLink(final String name, final URI link) {
+    return new ODataLink.Builder().setVersion(version).setURI(link).
+            setType(ODataLinkType.ENTITY_SET_NAVIGATION).setTitle(name).build();
+  }
+
+  @Override
+  public ODataLink newAssociationLink(final String name, final URI link) {
+    return new ODataLink.Builder().setVersion(version).setURI(link).
+            setType(ODataLinkType.ASSOCIATION).setTitle(name).build();
+  }
+
+  @Override
+  public ODataLink newMediaEditLink(final String name, final URI link) {
+    return new ODataLink.Builder().setVersion(version).setURI(link).
+            setType(ODataLinkType.MEDIA_EDIT).setTitle(name).build();
+  }
+
+  @Override
   public ODataPrimitiveValue.Builder newPrimitiveValueBuilder() {
     return new ODataPrimitiveValueImpl.BuilderImpl(version);
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataComplexValueImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataComplexValueImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataComplexValueImpl.java
index 07ae0da..70fa1ba 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataComplexValueImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataComplexValueImpl.java
@@ -24,6 +24,7 @@ import java.util.List;
 import java.util.Map;
 import org.apache.olingo.commons.api.domain.ODataComplexValue;
 import org.apache.olingo.commons.api.domain.ODataLink;
+import org.apache.olingo.commons.api.domain.v4.ODataAnnotation;
 import org.apache.olingo.commons.api.domain.v4.ODataLinkedComplexValue;
 import org.apache.olingo.commons.api.domain.v4.ODataEnumValue;
 import org.apache.olingo.commons.api.domain.v4.ODataProperty;
@@ -43,6 +44,8 @@ public class ODataComplexValueImpl extends AbstractODataComplexValue<ODataProper
    */
   private final List<ODataLink> associationLinks = new ArrayList<ODataLink>();
 
+  private final List<ODataAnnotation> annotations = new ArrayList<ODataAnnotation>();
+
   public ODataComplexValueImpl(final String typeName) {
     super(typeName);
   }
@@ -151,4 +154,10 @@ public class ODataComplexValueImpl extends AbstractODataComplexValue<ODataProper
 
     return result;
   }
+
+  @Override
+  public List<ODataAnnotation> getAnnotations() {
+    return annotations;
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataDeletedEntityImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataDeletedEntityImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataDeletedEntityImpl.java
index 23bfdf5..200f6df 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataDeletedEntityImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataDeletedEntityImpl.java
@@ -19,10 +19,10 @@
 package org.apache.olingo.commons.core.domain.v4;
 
 import java.net.URI;
+import org.apache.olingo.commons.api.domain.ODataItem;
 import org.apache.olingo.commons.api.domain.v4.ODataDeletedEntity;
-import org.apache.olingo.commons.core.data.AbstractPayloadObject;
 
-public class ODataDeletedEntityImpl extends AbstractPayloadObject implements ODataDeletedEntity {
+public class ODataDeletedEntityImpl extends ODataItem implements ODataDeletedEntity {
 
   private static final long serialVersionUID = -3841730551749114664L;
 
@@ -30,6 +30,10 @@ public class ODataDeletedEntityImpl extends AbstractPayloadObject implements ODa
 
   private Reason reason;
 
+  public ODataDeletedEntityImpl() {
+    super(null);
+  }
+
   @Override
   public URI getId() {
     return id;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataDeltaLinkImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataDeltaLinkImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataDeltaLinkImpl.java
index 0c549ac..ed9ad15 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataDeltaLinkImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataDeltaLinkImpl.java
@@ -19,10 +19,10 @@
 package org.apache.olingo.commons.core.domain.v4;
 
 import java.net.URI;
+import org.apache.olingo.commons.api.domain.ODataItem;
 import org.apache.olingo.commons.api.domain.v4.ODataDeltaLink;
-import org.apache.olingo.commons.core.data.AbstractPayloadObject;
 
-public class ODataDeltaLinkImpl extends AbstractPayloadObject implements ODataDeltaLink {
+public class ODataDeltaLinkImpl extends ODataItem implements ODataDeltaLink {
 
   private static final long serialVersionUID = -6686550836508873044L;
 
@@ -32,6 +32,10 @@ public class ODataDeltaLinkImpl extends AbstractPayloadObject implements ODataDe
 
   private URI target;
 
+  public ODataDeltaLinkImpl() {
+    super(null);
+  }
+
   @Override
   public URI getSource() {
     return source;
@@ -48,7 +52,7 @@ public class ODataDeltaLinkImpl extends AbstractPayloadObject implements ODataDe
   }
 
   @Override
-  public void setRelationship(String relationship) {
+  public void setRelationship(final String relationship) {
     this.relationship = relationship;
   }
 
@@ -58,7 +62,7 @@ public class ODataDeltaLinkImpl extends AbstractPayloadObject implements ODataDe
   }
 
   @Override
-  public void setTarget(URI target) {
+  public void setTarget(final URI target) {
     this.target = target;
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataEntityImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataEntityImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataEntityImpl.java
index 0f81a4e..0dd296f 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataEntityImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataEntityImpl.java
@@ -20,6 +20,7 @@ package org.apache.olingo.commons.core.domain.v4;
 
 import java.util.ArrayList;
 import java.util.List;
+import org.apache.olingo.commons.api.domain.v4.ODataAnnotation;
 import org.apache.olingo.commons.api.domain.v4.ODataEntity;
 import org.apache.olingo.commons.api.domain.v4.ODataProperty;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
@@ -36,6 +37,8 @@ public class ODataEntityImpl extends AbstractODataEntity implements ODataEntity
 
   private final List<ODataProperty> properties = new ArrayList<ODataProperty>();
 
+  private final List<ODataAnnotation> annotations = new ArrayList<ODataAnnotation>();
+
   public ODataEntityImpl(final FullQualifiedName typeName) {
     super(typeName);
   }
@@ -60,4 +63,9 @@ public class ODataEntityImpl extends AbstractODataEntity implements ODataEntity
     return properties;
   }
 
+  @Override
+  public List<ODataAnnotation> getAnnotations() {
+    return annotations;
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataEntitySetImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataEntitySetImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataEntitySetImpl.java
index 81a795b..be3a722 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataEntitySetImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataEntitySetImpl.java
@@ -21,6 +21,7 @@ package org.apache.olingo.commons.core.domain.v4;
 import java.net.URI;
 import java.util.ArrayList;
 import java.util.List;
+import org.apache.olingo.commons.api.domain.v4.ODataAnnotation;
 import org.apache.olingo.commons.api.domain.v4.ODataEntity;
 import org.apache.olingo.commons.api.domain.v4.ODataEntitySet;
 import org.apache.olingo.commons.core.domain.AbstractODataEntitySet;
@@ -29,11 +30,14 @@ public class ODataEntitySetImpl extends AbstractODataEntitySet implements ODataE
 
   private static final long serialVersionUID = -8127933181196033586L;
 
+  private URI deltaLink;
+
   private final List<ODataEntity> entities = new ArrayList<ODataEntity>();
 
-  private URI deltaLink;
+  private final List<ODataAnnotation> annotations = new ArrayList<ODataAnnotation>();
 
   public ODataEntitySetImpl() {
+    super();
   }
 
   public ODataEntitySetImpl(final URI next) {
@@ -59,4 +63,10 @@ public class ODataEntitySetImpl extends AbstractODataEntitySet implements ODataE
   public void setDeltaLink(final URI deltaLink) {
     this.deltaLink = deltaLink;
   }
+
+  @Override
+  public List<ODataAnnotation> getAnnotations() {
+    return annotations;
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataObjectFactoryImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataObjectFactoryImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataObjectFactoryImpl.java
index d52624b..bc3809f 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataObjectFactoryImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataObjectFactoryImpl.java
@@ -22,12 +22,14 @@ import java.net.URI;
 import org.apache.olingo.commons.api.domain.CommonODataProperty;
 import org.apache.olingo.commons.api.domain.ODataCollectionValue;
 import org.apache.olingo.commons.api.domain.ODataComplexValue;
+import org.apache.olingo.commons.api.domain.ODataLinkType;
 import org.apache.olingo.commons.api.domain.ODataPrimitiveValue;
 import org.apache.olingo.commons.api.domain.v4.ODataDelta;
 import org.apache.olingo.commons.api.domain.v4.ODataEntitySet;
 import org.apache.olingo.commons.api.domain.v4.ODataObjectFactory;
 import org.apache.olingo.commons.api.domain.v4.ODataEntity;
 import org.apache.olingo.commons.api.domain.v4.ODataEnumValue;
+import org.apache.olingo.commons.api.domain.v4.ODataLink;
 import org.apache.olingo.commons.api.domain.v4.ODataLinkedComplexValue;
 import org.apache.olingo.commons.api.domain.v4.ODataProperty;
 import org.apache.olingo.commons.api.domain.v4.ODataValue;
@@ -64,6 +66,30 @@ public class ODataObjectFactoryImpl extends AbstractODataObjectFactory implement
   }
 
   @Override
+  public ODataLink newEntityNavigationLink(final String name, final URI link) {
+    return new ODataLink.Builder().setVersion(version).setURI(link).
+            setType(ODataLinkType.ENTITY_NAVIGATION).setTitle(name).build();
+  }
+
+  @Override
+  public ODataLink newEntitySetNavigationLink(final String name, final URI link) {
+    return new ODataLink.Builder().setVersion(version).setURI(link).
+            setType(ODataLinkType.ENTITY_SET_NAVIGATION).setTitle(name).build();
+  }
+
+  @Override
+  public ODataLink newAssociationLink(final String name, final URI link) {
+    return new ODataLink.Builder().setVersion(version).setURI(link).
+            setType(ODataLinkType.ASSOCIATION).setTitle(name).build();
+  }
+
+  @Override
+  public ODataLink newMediaEditLink(final String name, final URI link) {
+    return new ODataLink.Builder().setVersion(version).setURI(link).
+            setType(ODataLinkType.MEDIA_EDIT).setTitle(name).build();
+  }
+
+  @Override
   public ODataPrimitiveValue.Builder newPrimitiveValueBuilder() {
     return new ODataPrimitiveValueImpl.BuilderImpl(version);
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/70cdaef5/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataPropertyImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataPropertyImpl.java
index 541c360..8fa9727 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataPropertyImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/v4/ODataPropertyImpl.java
@@ -18,8 +18,11 @@
  */
 package org.apache.olingo.commons.core.domain.v4;
 
+import java.util.ArrayList;
+import java.util.List;
 import org.apache.olingo.commons.api.domain.ODataCollectionValue;
 import org.apache.olingo.commons.api.domain.ODataComplexValue;
+import org.apache.olingo.commons.api.domain.v4.ODataAnnotation;
 import org.apache.olingo.commons.api.domain.v4.ODataEnumValue;
 import org.apache.olingo.commons.api.domain.v4.ODataLinkedComplexValue;
 import org.apache.olingo.commons.api.domain.v4.ODataProperty;
@@ -30,6 +33,8 @@ public class ODataPropertyImpl extends AbstractODataProperty implements ODataPro
 
   private static final long serialVersionUID = 4851331227420757747L;
 
+  private final List<ODataAnnotation> annotations = new ArrayList<ODataAnnotation>();
+
   public ODataPropertyImpl(final String name, final org.apache.olingo.commons.api.domain.ODataValue value) {
     super(name, value);
   }
@@ -68,4 +73,8 @@ public class ODataPropertyImpl extends AbstractODataProperty implements ODataPro
             : null;
   }
 
+  @Override
+  public List<ODataAnnotation> getAnnotations() {
+    return annotations;
+  }
 }


Mime
View raw message