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.
+ * + * @see Key + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface KeyClass { + + Class extends Serializable> value(); +} diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/KeyRef.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/KeyRef.java new file mode 100644 index 000000000..41f3b06d2 --- /dev/null +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/KeyRef.java @@ -0,0 +1,34 @@ +/* + * 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.ext.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(); +} diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/Namespace.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/Namespace.java new file mode 100644 index 000000000..81f1a9520 --- /dev/null +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/Namespace.java @@ -0,0 +1,36 @@ +/* + * 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.ext.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 ""; +} diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/NavigationProperty.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/NavigationProperty.java new file mode 100644 index 000000000..88379bc63 --- /dev/null +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/NavigationProperty.java @@ -0,0 +1,42 @@ +/* + * 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.ext.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(); +} diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/Operation.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/Operation.java new file mode 100644 index 000000000..ad5a148c2 --- /dev/null +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/Operation.java @@ -0,0 +1,62 @@ +/* + * 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.ext.proxy.api.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import org.apache.olingo.ext.proxy.api.OperationType; + +/** + * Mark method as EDM function import. + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface Operation { + + String name(); + + /** + * Operation type, function or action. + * + * @return operation type. + */ + OperationType type(); + + /** + * The action/function MAY/MUST specify a return type using the edm:ReturnType element. The return type must be a + * scalar, entity or complex type, or a collection of scalar, entity or complex types. + * + * @return operation return type. + */ + String returnType() default ""; + + /** + * A function element MAY specify a Boolean value for the IsComposable attribute. If no value is specified for the + * IsComposable attribute, the value defaults to false. + *