You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by il...@apache.org on 2014/05/22 13:43:23 UTC
[15/51] [abbrv] [partial] Removing /ODataJClient: merge complete
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/EntityContainerFactory.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/EntityContainerFactory.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/EntityContainerFactory.java
deleted file mode 100644
index f2de747..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/EntityContainerFactory.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 com.msopentech.odatajclient.proxy.api;
-
-import com.msopentech.odatajclient.engine.client.Configuration;
-import com.msopentech.odatajclient.engine.client.ODataClientFactory;
-import com.msopentech.odatajclient.engine.client.ODataV3Client;
-import com.msopentech.odatajclient.engine.communication.request.retrieve.ODataV3MetadataRequest;
-import com.msopentech.odatajclient.proxy.api.context.Context;
-import com.msopentech.odatajclient.engine.communication.response.ODataRetrieveResponse;
-import com.msopentech.odatajclient.engine.metadata.EdmV3Metadata;
-import com.msopentech.odatajclient.engine.uri.filter.FilterFactory;
-import com.msopentech.odatajclient.proxy.api.impl.EntityContainerInvocationHandler;
-import java.lang.reflect.Proxy;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import org.apache.commons.lang3.StringUtils;
-
-/**
- * Entry point for ODataJClient proxy mode, gives access to entity container instances.
- */
-public class EntityContainerFactory {
-
- private static final Object MONITOR = new Object();
-
- private static Context context = null;
-
- private static final Map<String, EntityContainerFactory> FACTORY_PER_SERVICEROOT =
- new ConcurrentHashMap<String, EntityContainerFactory>();
-
- private static final Map<Class<?>, Object> ENTITY_CONTAINERS =
- new ConcurrentHashMap<Class<?>, Object>();
-
- private final ODataV3Client client;
-
- private final String serviceRoot;
-
- private EdmV3Metadata metadata;
-
- public static Context getContext() {
- synchronized (MONITOR) {
- if (context == null) {
- context = new Context();
- }
- }
-
- return context;
- }
-
- private static EntityContainerFactory getInstance(final ODataV3Client client, final String serviceRoot) {
- if (!FACTORY_PER_SERVICEROOT.containsKey(serviceRoot)) {
- final EntityContainerFactory instance = new EntityContainerFactory(client, serviceRoot);
- FACTORY_PER_SERVICEROOT.put(serviceRoot, instance);
- }
- return FACTORY_PER_SERVICEROOT.get(serviceRoot);
- }
-
- public static EntityContainerFactory getV3Instance(final String serviceRoot) {
- return getInstance(ODataClientFactory.getV3(), serviceRoot);
- }
-
- private EntityContainerFactory(final ODataV3Client client, final String serviceRoot) {
- this.client = client;
- this.serviceRoot = serviceRoot;
- }
-
- public Configuration getConfiguration() {
- return client.getConfiguration();
- }
-
- public FilterFactory getFilterFactory() {
- return client.getFilterFactory();
- }
-
- public String getServiceRoot() {
- return serviceRoot;
- }
-
- public EdmV3Metadata getMetadata() {
- synchronized (this) {
- if (metadata == null) {
- final ODataV3MetadataRequest req = client.getRetrieveRequestFactory().getMetadataRequest(serviceRoot);
- final ODataRetrieveResponse<EdmV3Metadata> res = req.execute();
- metadata = res.getBody();
- if (metadata == null) {
- throw new IllegalStateException("No metadata found at URI '" + serviceRoot + "'");
- }
- }
- }
-
- return metadata;
- }
-
- /**
- * Return an initialized concrete implementation of the passed EntityContainer interface.
- *
- * @param <T> interface annotated as EntityContainer
- * @param reference class object of the EntityContainer annotated interface
- * @return an initialized concrete implementation of the passed reference
- * @throws IllegalStateException if <tt>serviceRoot</tt> was not set
- * @throws IllegalArgumentException if the passed reference is not an interface annotated as EntityContainer
- * @see com.msopentech.odatajclient.proxy.api.annotations.EntityContainer
- */
- @SuppressWarnings("unchecked")
- public <T> T getEntityContainer(final Class<T> reference) throws IllegalStateException, IllegalArgumentException {
- if (StringUtils.isBlank(serviceRoot)) {
- throw new IllegalStateException("serviceRoot was not set");
- }
-
- if (!ENTITY_CONTAINERS.containsKey(reference)) {
- final Object entityContainer = Proxy.newProxyInstance(
- Thread.currentThread().getContextClassLoader(),
- new Class<?>[] { reference },
- EntityContainerInvocationHandler.getInstance(client, reference, this));
- ENTITY_CONTAINERS.put(reference, entityContainer);
- }
- return (T) ENTITY_CONTAINERS.get(reference);
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/NoResultException.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/NoResultException.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/NoResultException.java
deleted file mode 100644
index 52ab50b..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/NoResultException.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 com.msopentech.odatajclient.proxy.api;
-
-/**
- * Thrown when <tt>Query.getSingleResult()</tt> or <tt>EntityQuery.getSingleResult()</tt> is executed on a query
- * and there is no result to return.
- *
- * @see Query#getSingleResult()
- * @see EntityQuery#getSingleResult()
- */
-public class NoResultException extends RuntimeException {
-
- private static final long serialVersionUID = -6643642637364303053L;
-
- public NoResultException() {
- super();
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/NonUniqueResultException.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/NonUniqueResultException.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/NonUniqueResultException.java
deleted file mode 100644
index 268e6e5..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/NonUniqueResultException.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 com.msopentech.odatajclient.proxy.api;
-
-/**
- * Thrown when <tt>Query.getSingleResult()</tt> or <tt>EntityQuery.getSingleResult()</tt> is executed on a query and
- * there is more than one result from the query.
- *
- * @see Query#getSingleResult()
- * @see EntityQuery#getSingleResult()
- */
-public class NonUniqueResultException extends RuntimeException {
-
- private static final long serialVersionUID = 4444551737338550185L;
-
- public NonUniqueResultException() {
- super();
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/Query.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/Query.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/Query.java
deleted file mode 100644
index 54a6fa3..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/Query.java
+++ /dev/null
@@ -1,130 +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 com.msopentech.odatajclient.proxy.api;
-
-import com.msopentech.odatajclient.engine.uri.filter.ODataFilter;
-import com.msopentech.odatajclient.proxy.api.AbstractEntityCollection;
-import java.io.Serializable;
-
-/**
- * Interface used to control query execution.
- *
- * @param <T> query result type
- */
-public interface Query<T extends Serializable, EC extends AbstractEntityCollection<T>> extends Serializable {
-
- /**
- * Sets the <tt>$filter</tt> expression for this query.
- * Any of available operators and functions can be embodied here.
- *
- * @param filter the <tt>$filter</tt> expression for this query
- * @return the same query instance
- */
- Query<T, EC> setFilter(String filter);
-
- /**
- * Sets the filter generating the <tt>$filter</tt> expression for this query.
- *
- * @param filter filter instance (to be obtained via <tt>ODataFilterFactory</tt>):
- * note that <tt>build()</tt> method will be immediately invoked.
- * @return the same query instance
- */
- Query<T, EC> setFilter(ODataFilter filter);
-
- /**
- * The <tt>$filter</tt> expression for this query.
- *
- * @return the <tt>$filter</tt> expression for this query
- */
- String getFilter();
-
- /**
- * Sets the <tt>$orderBy</tt> expression for this query via sort options.
- *
- * @param sort sort options
- * @return the same query instance
- */
- Query<T, EC> setOrderBy(Sort... sort);
-
- /**
- * Sets the <tt>$orderBy</tt> expression for this query.
- *
- * @param select the <tt>$orderBy</tt> expression for this query
- * @return the same query instance
- */
- Query<T, EC> setOrderBy(String orderBy);
-
- /**
- * The <tt>$orderBy</tt> expression for this query.
- *
- * @return the <tt>$orderBy</tt> expression for this query
- */
- String getOrderBy();
-
- /**
- * Sets the maximum number of results to retrieve (<tt>$top</tt>).
- *
- * @param maxResults maximum number of results to retrieve
- * @return the same query instance
- * @throws IllegalArgumentException if the argument is negative
- */
- Query<T, EC> setMaxResults(int maxResults) throws IllegalArgumentException;
-
- /**
- * The maximum number of results the query object was set to retrieve (<tt>$top</tt>).
- * Returns <tt>Integer.MAX_VALUE</tt> if setMaxResults was not applied to the query object.
- *
- * @return maximum number of results
- */
- int getMaxResults();
-
- /**
- * Sets the position of the first result to retrieve (<tt>$skip</tt>).
- *
- * @param firstResult position of the first result, numbered from 0
- * @return the same query instance
- * @throws IllegalArgumentException if the argument is negative
- */
- Query<T, EC> setFirstResult(int firstResult) throws IllegalArgumentException;
-
- /**
- * The position of the first result the query object was set to retrieve (<tt>$skip</tt>).
- *
- * Returns 0 if <tt>setFirstResult</tt> was not applied to the query object.
- *
- * @return position of the first result
- */
- int getFirstResult();
-
- /**
- * Executes a <tt>$filter</tt> query that returns a single result.
- *
- * @return the result
- * @throws NoResultException if there is no result
- * @throws NonUniqueResultException if more than one result
- */
- T getSingleResult() throws NoResultException, NonUniqueResultException;
-
- /**
- * Executes a <tt>$filter</tt> query and return the query results as collection.
- *
- * @return an iterable view of the results
- */
- EC getResult();
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/Sort.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/Sort.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/Sort.java
deleted file mode 100644
index c2b0b27..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/Sort.java
+++ /dev/null
@@ -1,66 +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 com.msopentech.odatajclient.proxy.api;
-
-import java.util.Map;
-
-/**
- * Sort option for queries.
- */
-public class Sort implements Map.Entry<String, Sort.Direction> {
-
- /**
- * Enumeration for sort directions.
- */
- public enum Direction {
-
- ASC,
- DESC;
-
- @Override
- public String toString() {
- return name().toLowerCase();
- }
- }
-
- private final String key;
-
- private Direction value;
-
- public Sort(final String key, final Direction value) {
- this.key = key;
- this.value = value;
- }
-
- @Override
- public String getKey() {
- return this.key;
- }
-
- @Override
- public Direction getValue() {
- return this.value;
- }
-
- @Override
- public Direction setValue(final Direction value) {
- this.value = value;
- return this.value;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/ComplexType.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/ComplexType.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/ComplexType.java
deleted file mode 100644
index d06c731..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/ComplexType.java
+++ /dev/null
@@ -1,41 +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 com.msopentech.odatajclient.proxy.api.annotations;
-
-import java.io.Serializable;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Mark POJO as EDM complex type.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-@Inherited
-public @interface ComplexType {
-
- String value();
-
- Class<?> baseType() default Serializable.class;
-
- boolean isAbstract() default false;
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/CompoundKey.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/CompoundKey.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/CompoundKey.java
deleted file mode 100644
index 787b2b5..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/CompoundKey.java
+++ /dev/null
@@ -1,32 +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 com.msopentech.odatajclient.proxy.api.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Identifies a compound key.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface CompoundKey {
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/CompoundKeyElement.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/CompoundKeyElement.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/CompoundKeyElement.java
deleted file mode 100644
index ecf8abe..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/CompoundKeyElement.java
+++ /dev/null
@@ -1,38 +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 com.msopentech.odatajclient.proxy.api.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Mark multi key class field (property) as multi key element.
- *
- * @see Property
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-public @interface CompoundKeyElement {
-
- String name();
-
- int position();
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/EntityContainer.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/EntityContainer.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/EntityContainer.java
deleted file mode 100644
index 64f6af7..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/EntityContainer.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 com.msopentech.odatajclient.proxy.api.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Mark POJO as EDM entity container.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface EntityContainer {
-
- String name();
-
- boolean isDefaultEntityContainer() default false;
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/EntitySet.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/EntitySet.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/EntitySet.java
deleted file mode 100644
index 3e9252b..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/EntitySet.java
+++ /dev/null
@@ -1,38 +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 com.msopentech.odatajclient.proxy.api.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Give entity set a name.
- * If interface extending EntitySet is not annotated with this, the effective name will be class'
- * <tt>getSimpleName()</tt>.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface EntitySet {
-
- String name();
-
- boolean includeInServiceDocument() default true;
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/EntityType.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/EntityType.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/EntityType.java
deleted file mode 100644
index e49cdff..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/EntityType.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 com.msopentech.odatajclient.proxy.api.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Mark POJO as EDM entity type.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-@Inherited
-public @interface EntityType {
-
- String name();
-
- String baseType() default "";
-
- boolean isAbstract() default false;
-
- boolean openType() default false;
-
- boolean hasStream() default false;
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/EnumType.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/EnumType.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/EnumType.java
deleted file mode 100644
index 9957141..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/EnumType.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 com.msopentech.odatajclient.proxy.api.annotations;
-
-import com.msopentech.odatajclient.engine.metadata.edm.EdmSimpleType;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Mark Java enum as EDM enum type.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface EnumType {
-
- String name();
-
- EdmSimpleType underlyingType() default EdmSimpleType.Int32;
-
- boolean isFlags() default false;
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Key.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Key.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Key.java
deleted file mode 100644
index bb0b5ac..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Key.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 com.msopentech.odatajclient.proxy.api.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Mark POJO field (property) as key.
- *
- * @see Property
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-public @interface Key {
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/KeyClass.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/KeyClass.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/KeyClass.java
deleted file mode 100644
index ed97af3..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/KeyClass.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 com.msopentech.odatajclient.proxy.api.annotations;
-
-import java.io.Serializable;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Specifies a composite primary key class that is mapped to multiple fields or properties of an EntityType.
- * <p>The names of the fields or properties in the primary key class and the primary key fields or properties of the
- * EntityType must correspond and their types must be the same.</p>
- *
- * @see Key
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface KeyClass {
-
- Class<? extends Serializable> value();
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/KeyRef.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/KeyRef.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/KeyRef.java
deleted file mode 100644
index 2051727..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/KeyRef.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 com.msopentech.odatajclient.proxy.api.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Identifies a compound key.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface KeyRef {
-
- Class<?> value();
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Namespace.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Namespace.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Namespace.java
deleted file mode 100644
index 012c8bd..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Namespace.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 com.msopentech.odatajclient.proxy.api.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Associate Java package with OData namespace.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface Namespace {
-
- String value();
-
- String alias() default "";
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/NavigationProperty.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/NavigationProperty.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/NavigationProperty.java
deleted file mode 100644
index b3aa3dd..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/NavigationProperty.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 com.msopentech.odatajclient.proxy.api.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Bind POJO field to EDM navigation property.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-public @interface NavigationProperty {
-
- String name();
-
- String type();
-
- String targetSchema();
-
- String targetContainer();
-
- String targetEntitySet();
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Operation.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Operation.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Operation.java
deleted file mode 100644
index 1649728..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Operation.java
+++ /dev/null
@@ -1,70 +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 com.msopentech.odatajclient.proxy.api.annotations;
-
-import com.msopentech.odatajclient.engine.client.http.HttpMethod;
-import java.io.Serializable;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Mark method as EDM function import.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-public @interface Operation {
-
- String name();
-
- /**
- * EntitySet and EntitySetPath are mutually exclusive.
- *
- * @return static EntitySet
- */
- Class<? extends Serializable> entitySet() default Serializable.class;
-
- /**
- * Defines the EntitySet that contains the entities that are returned by the Operation when
- * that EntitySet is dependent on one of the Operation parameters.
- *
- * @return EntitySet path, dependent on one of the Operation parameters
- * @see Parameter
- */
- String entitySetPath() default "";
-
- String returnType() default "";
-
- /**
- * When httpMethod() is NONE, true: this annotates an action; false: this annotates a function
- *
- * @return
- */
- boolean isSideEffecting() default true;
-
- boolean isComposable() default false;
-
- /**
- * if not NONE, this annotates a legacy service operation.
- *
- * @return
- */
- HttpMethod httpMethod() default HttpMethod.GET;
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Parameter.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Parameter.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Parameter.java
deleted file mode 100644
index 59fd6ed..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Parameter.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 com.msopentech.odatajclient.proxy.api.annotations;
-
-import com.msopentech.odatajclient.engine.metadata.edm.v3.ParameterMode;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Function import parameter information.
- *
- * @see FunctionImport
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.PARAMETER)
-public @interface Parameter {
-
- String name();
-
- String type();
-
- boolean nullable() default true;
-
- ParameterMode mode() default ParameterMode.In;
-
- int maxLenght() default Integer.MAX_VALUE;
-
- int precision() default 0;
-
- int scale() default 0;
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Property.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Property.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Property.java
deleted file mode 100644
index 201753d..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Property.java
+++ /dev/null
@@ -1,76 +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 com.msopentech.odatajclient.proxy.api.annotations;
-
-import com.msopentech.odatajclient.engine.metadata.EdmContentKind;
-import com.msopentech.odatajclient.engine.metadata.edm.ConcurrencyMode;
-import com.msopentech.odatajclient.engine.metadata.edm.StoreGeneratedPattern;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Bind POJO field to EDM property.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-public @interface Property {
-
- String name();
-
- String type();
-
- boolean nullable() default true;
-
- String defaultValue() default "";
-
- int maxLenght() default Integer.MAX_VALUE;
-
- boolean fixedLenght() default false;
-
- int precision() default 0;
-
- int scale() default 0;
-
- boolean unicode() default true;
-
- String collation() default "";
-
- String srid() default "";
-
- ConcurrencyMode concurrencyMode() default ConcurrencyMode.None;
-
- String mimeType() default "";
-
- /* -- Feed Customization annotations -- */
- String fcSourcePath() default "";
-
- String fcTargetPath() default "";
-
- EdmContentKind fcContentKind() default EdmContentKind.text;
-
- String fcNSPrefix() default "";
-
- String fcNSURI() default "";
-
- boolean fcKeepInContent() default false;
-
- StoreGeneratedPattern storeGeneratedPattern() default StoreGeneratedPattern.None;
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/ReferentialConstraint.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/ReferentialConstraint.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/ReferentialConstraint.java
deleted file mode 100644
index 8e92874..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/ReferentialConstraint.java
+++ /dev/null
@@ -1,41 +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 com.msopentech.odatajclient.proxy.api.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Annotate navigation property with information about referential constraint.
- * @see NavigationProperty
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.FIELD)
-public @interface ReferentialConstraint {
-
- Class<?> principalRole();
-
- String[] principalPropertyRefs();
-
- Class<?> dependentRole();
-
- String[] dependentPropertyRefs();
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/RowType.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/RowType.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/RowType.java
deleted file mode 100644
index f370773..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/RowType.java
+++ /dev/null
@@ -1,32 +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 com.msopentech.odatajclient.proxy.api.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Mark inner class as EDM row type.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface RowType {
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Singleton.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Singleton.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Singleton.java
deleted file mode 100644
index 69703e9..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/annotations/Singleton.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 com.msopentech.odatajclient.proxy.api.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Give singleton a name.
- * If interface extending Singleton is not annotated with this, the effective name will be class'
- * <tt>getSimpleName()</tt>.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface Singleton {
-
- String name();
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/AttachedEntity.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/AttachedEntity.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/AttachedEntity.java
deleted file mode 100644
index eba5f3d..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/AttachedEntity.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 com.msopentech.odatajclient.proxy.api.context;
-
-import com.msopentech.odatajclient.proxy.api.context.AttachedEntityStatus;
-import com.msopentech.odatajclient.proxy.api.impl.EntityTypeInvocationHandler;
-
-public class AttachedEntity {
-
- private final EntityTypeInvocationHandler entity;
-
- private final AttachedEntityStatus status;
-
- public AttachedEntity(final EntityTypeInvocationHandler entity, final AttachedEntityStatus status) {
- this.entity = entity;
- this.status = status;
- }
-
- public EntityTypeInvocationHandler getEntity() {
- return entity;
- }
-
- public AttachedEntityStatus getStatus() {
- return status;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/AttachedEntityStatus.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/AttachedEntityStatus.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/AttachedEntityStatus.java
deleted file mode 100644
index 013dfe1..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/AttachedEntityStatus.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 com.msopentech.odatajclient.proxy.api.context;
-
-public enum AttachedEntityStatus {
-
- /**
- * Explicitely attached.
- */
- ATTACHED,
- /**
- * New object.
- */
- NEW,
- /**
- * Modified object.
- */
- CHANGED,
- /**
- * Deleted object.
- */
- DELETED,
- /**
- * Attached because explicitely liked to another object.
- */
- LINKED
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/Context.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/Context.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/Context.java
deleted file mode 100644
index ae7a561..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/Context.java
+++ /dev/null
@@ -1,37 +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 com.msopentech.odatajclient.proxy.api.context;
-
-public class Context {
-
- private final EntityContext entities;
-
- public Context() {
- this.entities = new EntityContext();
-
- }
-
- public EntityContext entityContext() {
- return entities;
- }
-
- public void detachAll() {
- entities.detachAll();
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/EntityContext.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/EntityContext.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/EntityContext.java
deleted file mode 100644
index 1f38d11..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/EntityContext.java
+++ /dev/null
@@ -1,199 +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 com.msopentech.odatajclient.proxy.api.context;
-
-import com.msopentech.odatajclient.proxy.api.impl.EntityTypeInvocationHandler;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Entity context.
- */
-public class EntityContext implements Iterable<AttachedEntity> {
-
- /**
- * Attached entities with not null key.
- * <p>
- * This map have to be used to search for entities by key.
- */
- private final Map<EntityUUID, EntityTypeInvocationHandler> searchableEntities =
- new HashMap<EntityUUID, EntityTypeInvocationHandler>();
-
- /**
- * All attached entities (new entities included).
- * <p>
- * Attachment order will be maintained.
- */
- private final Map<EntityTypeInvocationHandler, AttachedEntityStatus> allAttachedEntities =
- new LinkedHashMap<EntityTypeInvocationHandler, AttachedEntityStatus>();
-
- /**
- * Attaches an entity with status <tt>NEW</tt>.
- * <p>
- * Use this method to attach a new created entity.
- *
- * @see AttachedEntityStatus
- * @param entity entity to be attached.
- */
- public void attachNew(final EntityTypeInvocationHandler entity) {
- if (allAttachedEntities.containsKey(entity)) {
- throw new IllegalStateException("An entity with the same key has already been attached");
- }
- allAttachedEntities.put(entity, AttachedEntityStatus.NEW);
- }
-
- /**
- * Attaches an existing entity with status <tt>ATTACHED</tt>.
- * <p>
- * Use this method to attach an existing entity.
- *
- * @see AttachedEntityStatus
- * @param entity entity to be attached.
- */
- public void attach(final EntityTypeInvocationHandler entity) {
- attach(entity, AttachedEntityStatus.ATTACHED);
- }
-
- /**
- * Attaches an entity with specified status.
- * <p>
- * Use this method to attach an existing entity.
- *
- * @see AttachedEntityStatus
- * @param entity entity to be attached.
- * @param status status.
- */
- public void attach(final EntityTypeInvocationHandler entity, final AttachedEntityStatus status) {
- if (isAttached(entity)) {
- throw new IllegalStateException("An entity with the same profile has already been attached");
- }
-
- allAttachedEntities.put(entity, status);
-
- if (entity.getUUID().getKey() != null) {
- searchableEntities.put(entity.getUUID(), entity);
- }
- }
-
- /**
- * Detaches entity.
- *
- * @param entity entity to be detached.
- */
- public void detach(final EntityTypeInvocationHandler entity) {
- if (searchableEntities.containsKey(entity.getUUID())) {
- searchableEntities.remove(entity.getUUID());
- }
- allAttachedEntities.remove(entity);
- }
-
- /**
- * Detaches all attached entities.
- * <p>
- * Use this method to clears the entity context.
- */
- public void detachAll() {
- allAttachedEntities.clear();
- searchableEntities.clear();
- }
-
- /**
- * Searches an entity with the specified key.
- *
- * @param uuid entity key.
- * @return retrieved entity.
- */
- public EntityTypeInvocationHandler getEntity(final EntityUUID uuid) {
- return searchableEntities.get(uuid);
- }
-
- /**
- * Gets entity status.
- *
- * @param entity entity to be retrieved.
- * @return attached entity status.
- */
- public AttachedEntityStatus getStatus(final EntityTypeInvocationHandler entity) {
- if (!isAttached(entity)) {
- throw new IllegalStateException("Entity is not in the context");
- }
-
- return allAttachedEntities.get(entity);
- }
-
- /**
- * Changes attached entity status.
- *
- * @param entity attached entity to be modified.
- * @param status new status.
- */
- public void setStatus(final EntityTypeInvocationHandler entity, final AttachedEntityStatus status) {
- if (!isAttached(entity)) {
- throw new IllegalStateException("Entity is not in the context");
- }
-
- final AttachedEntityStatus current = allAttachedEntities.get(entity);
-
- // Previously deleted object cannot be modified anymore.
- if (current == AttachedEntityStatus.DELETED) {
- throw new IllegalStateException("Entity has been previously deleted");
- }
-
- if (status == AttachedEntityStatus.NEW || status == AttachedEntityStatus.ATTACHED) {
- throw new IllegalStateException("Entity status has already been initialized");
- }
-
- if ((status == AttachedEntityStatus.LINKED && current == AttachedEntityStatus.ATTACHED)
- || (status == AttachedEntityStatus.CHANGED && current == AttachedEntityStatus.ATTACHED)
- || (status == AttachedEntityStatus.CHANGED && current == AttachedEntityStatus.LINKED)
- || (status == AttachedEntityStatus.DELETED)) {
- allAttachedEntities.put(entity, status);
- }
- }
-
- /**
- * Checks if an entity is already attached.
- *
- * @param entity entity.
- * @return <tt>true</tt> if is attached; <tt>false</tt> otherwise.
- */
- public boolean isAttached(final EntityTypeInvocationHandler entity) {
- return allAttachedEntities.containsKey(entity)
- || (entity.getUUID().getKey() != null && searchableEntities.containsKey(entity.getUUID()));
- }
-
- /**
- * Iterator.
- *
- * @return attached entities iterator.
- */
- @Override
- public Iterator<AttachedEntity> iterator() {
- final List<AttachedEntity> res = new ArrayList<AttachedEntity>();
- for (Map.Entry<EntityTypeInvocationHandler, AttachedEntityStatus> attachedEntity : allAttachedEntities.
- entrySet()) {
- res.add(new AttachedEntity(attachedEntity.getKey(), attachedEntity.getValue()));
- }
- return res.iterator();
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/EntityLinkDesc.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/EntityLinkDesc.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/EntityLinkDesc.java
deleted file mode 100644
index 1dc4151..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/EntityLinkDesc.java
+++ /dev/null
@@ -1,104 +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 com.msopentech.odatajclient.proxy.api.context;
-
-import com.msopentech.odatajclient.engine.data.ODataLinkType;
-import com.msopentech.odatajclient.proxy.api.impl.EntityTypeInvocationHandler;
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.Collections;
-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;
-
-public class EntityLinkDesc implements Serializable {
-
- private static final long serialVersionUID = 704670372070370762L;
-
- private final String sourceName;
-
- private final EntityTypeInvocationHandler source;
-
- private final Collection<EntityTypeInvocationHandler> targets;
-
- private final ODataLinkType type;
-
- public EntityLinkDesc(
- final String sourceName,
- final EntityTypeInvocationHandler source,
- final Collection<EntityTypeInvocationHandler> target,
- final ODataLinkType type) {
- this.sourceName = sourceName;
- this.source = source;
- this.targets = target;
- this.type = type;
- }
-
- public EntityLinkDesc(
- final String sourceName,
- final EntityTypeInvocationHandler source,
- final EntityTypeInvocationHandler target,
- final ODataLinkType type) {
- this.sourceName = sourceName;
- this.source = source;
- this.targets = Collections.<EntityTypeInvocationHandler>singleton(target);
- this.type = type;
- }
-
- public String getSourceName() {
- return sourceName;
- }
-
- public EntityTypeInvocationHandler getSource() {
- return source;
- }
-
- public Collection<EntityTypeInvocationHandler> getTargets() {
- return targets;
- }
-
- public ODataLinkType getType() {
- return type;
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public boolean equals(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/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/EntityUUID.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/EntityUUID.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/EntityUUID.java
deleted file mode 100644
index 5fc741a..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/context/EntityUUID.java
+++ /dev/null
@@ -1,109 +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 com.msopentech.odatajclient.proxy.api.context;
-
-import java.io.Serializable;
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
-
-public class EntityUUID implements Serializable {
-
- private static final long serialVersionUID = 4855025769803086495L;
-
- private final int tempKey;
-
- private final String schemaName;
-
- private final String containerName;
-
- private final String entitySetName;
-
- private final String name;
-
- private final Object key;
-
- public EntityUUID(
- final String schemaName,
- final String containerName,
- final String entitySetName,
- final String name) {
- this(schemaName, containerName, entitySetName, name, null);
- }
-
- public EntityUUID(
- final String schemaName,
- final String containerName,
- final String entitySetName,
- final String name,
- final Object key) {
- this.schemaName = schemaName;
- this.containerName = containerName;
- this.entitySetName = entitySetName;
- this.name = name;
- this.key = key;
- this.tempKey = (int) (Math.random() * 1000000);
- }
-
- public String getSchemaName() {
- return schemaName;
- }
-
- public String getContainerName() {
- return containerName;
- }
-
- public String getEntitySetName() {
- return entitySetName;
- }
-
- public String getName() {
- return name;
- }
-
- public Object getKey() {
- return key;
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public boolean equals(Object obj) {
- return key == null
- ? EqualsBuilder.reflectionEquals(this, obj)
- : EqualsBuilder.reflectionEquals(this, obj, "tempKey");
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public int hashCode() {
- return HashCodeBuilder.reflectionHashCode(this, "tempKey");
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public String toString() {
- return schemaName + ":" + containerName + ":" + entitySetName + ":" + name
- + "(" + (key == null ? null : key.toString()) + ")";
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/impl/AbstractInvocationHandler.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/impl/AbstractInvocationHandler.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/impl/AbstractInvocationHandler.java
deleted file mode 100644
index f2ac2dd..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/impl/AbstractInvocationHandler.java
+++ /dev/null
@@ -1,242 +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 com.msopentech.odatajclient.proxy.api.impl;
-
-import com.msopentech.odatajclient.engine.client.ODataClient;
-import com.msopentech.odatajclient.engine.client.ODataV3Client;
-import com.msopentech.odatajclient.engine.data.ODataEntity;
-import com.msopentech.odatajclient.engine.data.ODataEntitySet;
-import com.msopentech.odatajclient.engine.data.ODataInvokeResult;
-import com.msopentech.odatajclient.engine.data.ODataProperty;
-import com.msopentech.odatajclient.engine.data.ODataValue;
-import com.msopentech.odatajclient.engine.metadata.EdmType;
-import com.msopentech.odatajclient.engine.metadata.EdmV3Type;
-import com.msopentech.odatajclient.proxy.api.EntityContainerFactory;
-import com.msopentech.odatajclient.proxy.api.annotations.Operation;
-import com.msopentech.odatajclient.proxy.api.annotations.Parameter;
-import com.msopentech.odatajclient.proxy.utils.ClassUtils;
-import com.msopentech.odatajclient.proxy.utils.EngineUtils;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Proxy;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.apache.commons.lang3.ArrayUtils;
-import org.apache.commons.lang3.StringUtils;
-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;
-
-abstract class AbstractInvocationHandler implements InvocationHandler {
-
- private static final long serialVersionUID = 358520026931462958L;
-
- protected final ODataV3Client client;
-
- protected EntityContainerInvocationHandler containerHandler;
-
- protected AbstractInvocationHandler(
- final ODataV3Client client, final EntityContainerInvocationHandler containerHandler) {
-
- this.client = client;
- this.containerHandler = containerHandler;
- }
-
- protected ODataV3Client getClient() {
- return client;
- }
-
- protected boolean isSelfMethod(final Method method, final Object[] args) {
- final Method[] selfMethods = getClass().getMethods();
-
- boolean result = false;
-
- for (int i = 0; i < selfMethods.length && !result; i++) {
- result = method.getName().equals(selfMethods[i].getName())
- && Arrays.equals(method.getParameterTypes(), selfMethods[i].getParameterTypes());
- }
-
- return result;
- }
-
- protected Object invokeSelfMethod(final Method method, final Object[] args)
- throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
- return getClass().getMethod(method.getName(), method.getParameterTypes()).invoke(this, args);
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- protected Object getEntityCollection(
- final Class<?> typeRef,
- final Class<?> typeCollectionRef,
- final String entityContainerName,
- final ODataEntitySet entitySet,
- final URI uri,
- final boolean checkInTheContext) {
-
- final List<Object> items = new ArrayList<Object>();
-
- for (ODataEntity entityFromSet : entitySet.getEntities()) {
- items.add(getEntityProxy(
- entityFromSet, entityContainerName, entitySet.getName(), typeRef, checkInTheContext));
- }
-
- return Proxy.newProxyInstance(
- Thread.currentThread().getContextClassLoader(),
- new Class<?>[] { typeCollectionRef },
- new EntityCollectionInvocationHandler(containerHandler, items, typeRef, entityContainerName, uri));
- }
-
- protected <T> T getEntityProxy(
- final ODataEntity entity,
- final String entityContainerName,
- final String entitySetName,
- final Class<?> type,
- final boolean checkInTheContext) {
-
- return getEntityProxy(entity, entityContainerName, entitySetName, type, null, checkInTheContext);
- }
-
- @SuppressWarnings("unchecked")
- protected <T> T getEntityProxy(
- final ODataEntity entity,
- final String entityContainerName,
- final String entitySetName,
- final Class<?> type,
- final String eTag,
- final boolean checkInTheContext) {
-
- EntityTypeInvocationHandler handler = EntityTypeInvocationHandler.getInstance(
- entity, entityContainerName, entitySetName, type, containerHandler);
-
- if (StringUtils.isNotBlank(eTag)) {
- // override ETag into the wrapped object.
- handler.setETag(eTag);
- }
-
- if (checkInTheContext && EntityContainerFactory.getContext().entityContext().isAttached(handler)) {
- handler = EntityContainerFactory.getContext().entityContext().getEntity(handler.getUUID());
- }
-
- return (T) Proxy.newProxyInstance(
- Thread.currentThread().getContextClassLoader(),
- new Class<?>[] { type },
- handler);
- }
-
- protected Object functionImport(
- final Operation annotation, final Method method, final Object[] args, final URI target,
- final com.msopentech.odatajclient.engine.metadata.edm.v3.FunctionImport funcImp)
- throws InstantiationException, IllegalAccessException, NoSuchMethodException,
- IllegalArgumentException, InvocationTargetException {
-
- // 1. invoke params (if present)
- final Map<String, ODataValue> parameters = new HashMap<String, ODataValue>();
- if (!ArrayUtils.isEmpty(args)) {
- final Annotation[][] parAnnots = method.getParameterAnnotations();
- final Class<?>[] parTypes = method.getParameterTypes();
-
- for (int i = 0; i < args.length; i++) {
- if (!(parAnnots[i][0] instanceof Parameter)) {
- throw new IllegalArgumentException("Paramter " + i + " is not annotated as @Param");
- }
- final Parameter parAnnot = (Parameter) parAnnots[i][0];
-
- if (!parAnnot.nullable() && args[i] == null) {
- throw new IllegalArgumentException(
- "Parameter " + parAnnot.name() + " is not nullable but a null value was provided");
- }
-
- final ODataValue paramValue = args[i] == null
- ? null
- : EngineUtils.getODataValue(client, containerHandler.getFactory().getMetadata(),
- new EdmV3Type(containerHandler.getFactory().getMetadata(), parAnnot.type()), args[i]);
-
- parameters.put(parAnnot.name(), paramValue);
- }
- }
-
- // 2. IMPORTANT: flush any pending change *before* invoke if this operation is side effecting
- if (annotation.isSideEffecting()) {
- new Container(client, containerHandler.getFactory()).flush();
- }
-
- // 3. invoke
- final ODataInvokeResult result = client.getInvokeRequestFactory().getInvokeRequest(
- target, containerHandler.getFactory().getMetadata(), funcImp, parameters).execute().getBody();
-
- // 3. process invoke result
- if (StringUtils.isBlank(annotation.returnType())) {
- return ClassUtils.returnVoid();
- }
-
- final EdmType edmType = new EdmV3Type(containerHandler.getFactory().getMetadata(), annotation.returnType());
- if (edmType.isEnumType()) {
- throw new UnsupportedOperationException("Usupported enum type " + edmType.getTypeExpression());
- }
- if (edmType.isSimpleType() || edmType.isComplexType()) {
- return EngineUtils.getValueFromProperty(
- containerHandler.getFactory().getMetadata(), (ODataProperty) result, method.getGenericReturnType());
- }
- if (edmType.isEntityType()) {
- if (edmType.isCollection()) {
- final ParameterizedType collType = (ParameterizedType) method.getReturnType().getGenericInterfaces()[0];
- final Class<?> collItemType = (Class<?>) collType.getActualTypeArguments()[0];
- return getEntityCollection(
- collItemType,
- method.getReturnType(),
- null,
- (ODataEntitySet) result,
- target,
- false);
- } else {
- return getEntityProxy(
- (ODataEntity) result,
- null,
- null,
- method.getReturnType(),
- false);
- }
- }
-
- throw new IllegalArgumentException("Could not process the functionImport information");
- }
-
- @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/19f3792f/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/impl/CompoundKeyElementWrapper.java
----------------------------------------------------------------------
diff --git a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/impl/CompoundKeyElementWrapper.java b/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/impl/CompoundKeyElementWrapper.java
deleted file mode 100644
index 31cf958..0000000
--- a/ODataJClient/proxy/src/main/java/com/msopentech/odatajclient/proxy/api/impl/CompoundKeyElementWrapper.java
+++ /dev/null
@@ -1,57 +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 com.msopentech.odatajclient.proxy.api.impl;
-
-import java.lang.reflect.Method;
-
-class CompoundKeyElementWrapper implements Comparable<CompoundKeyElementWrapper> {
-
- private final String name;
-
- private final Method method;
-
- private final int position;
-
- protected CompoundKeyElementWrapper(final String name, final Method method, final int position) {
- this.name = name;
- this.method = method;
- this.position = position;
- }
-
- public String getName() {
- return name;
- }
-
- public Method getMethod() {
- return method;
- }
-
- public int getPosition() {
- return position;
- }
-
- @Override
- public int compareTo(final CompoundKeyElementWrapper other) {
- if (other == null) {
- return 1;
- } else {
- return getPosition() > other.getPosition() ? 1 : getPosition() == other.getPosition() ? 0 : -1;
- }
- }
-}