/** * Sample of default action. */ @EdmAction @EdmReturnType(type = "BankAccounts") public class DefaultActionSample { @EdmParameter private String someParameter; public void doAction() { // do some action } }
/** * EntityWithNameSpaceSample. */ @EdmEntity(namespace = "ODataDemo.SampleContainer", key = { "Id" }) @EdmEntitySet("EntityWithNameSpaceSamples") public class EntityWithNameSpaceSample { }
/** * Action Import sample class. */ @EdmActionImport(entitySet = "Customers", action = "ODataDemoUnboundAction", name = "ODataDemoActionImport", namespace = "ODataDemo") public class ActionImportSample { }
@EdmEntity(namespace = "ODataDemo", key = { "InheritedId" }) @EdmEntitySet("AbstractEntityTypeSamples") public abstract class AbstractEntityTypeSample { @EdmProperty(name = "InheritedId", nullable = true) private String inheritedId; @EdmProperty(name = "InheritedProperty", nullable = true) private String inheritedProperty;
/** * Entity singleton helper class. */ @EdmEntity @EdmSingleton private class EntitySingletonSample { @EdmProperty private String field; } }
/** * The Complex Type Sample model. */ @EdmComplex(namespace = "ODataDemo") public class ComplexTypeSample extends AbstractComplexTypeSample { @EdmProperty(name = "SimpleProperty", nullable = true) private String simpleProperty; public String getSimpleProperty() { return simpleProperty; } public ComplexTypeSample setSimpleProperty(String property) { this.simpleProperty = property; return this; } }
/** * Function import sample model. */ @EdmFunctionImport(function = "UnboundODataDemoFunction", includeInServiceDocument = true, name = "ODataDemoFunctionImport", namespace = "ODataDemo") public class FunctionImportSample { @EdmParameter private String stringFunctionField; @EdmParameter private int intFunctionField; public String getStringFunctionField() { return stringFunctionField; } public void setStringFunctionField(String stringFunctionField) { this.stringFunctionField = stringFunctionField; } public int getIntFunctionField() { return intFunctionField; } public void setIntFunctionField(int intFunctionField) { this.intFunctionField = intFunctionField; } }
/** * Empty Test Entity. */ @EdmEntitySet("EmptyEntities") private class EmptyEntity { }
/** * Function with not nullable parameters import sample model. */ @EdmFunctionImport(function = "ODataDemoFunctionNotNullable", includeInServiceDocument = true, name = "ODataDemoFunctionNotNullableImport", namespace = "ODataDemo") public class FunctionNotNullableImportSample { }
/** * Entity set helper class. */ @EdmEntity @EdmEntitySet private class EntitySetSample { @EdmProperty private String field; }
/** * The Abstract Complex Type Sample. */ @EdmComplex(namespace = "ODataDemo") public abstract class AbstractComplexTypeSample { @EdmProperty(name = "InheritedProperty", nullable = true) private String inheritedProperty; public String getInheritedProperty() { return inheritedProperty; } public AbstractComplexTypeSample setInheritedProperty(String newInheritedProperty) { this.inheritedProperty = newInheritedProperty; return this; } }
/** * EntityWithNameSpaceSample. */ @EdmEntity(namespace = "ODataDemo.SampleContainer", key = { "Id" }) @EdmEntitySet("EntityWithNameSpaceSamples") public class EntityWithNameSpaceSample { }
/** * Sample of default action. */ @EdmAction @EdmReturnType(type = "BankAccounts") public class DefaultActionSample { @EdmParameter private String someParameter; public void doAction() { // do some action } }
/** * Action Import sample class. */ @EdmActionImport(entitySet = "Customers", action = "ODataDemoUnboundAction", name = "ODataDemoActionImport", namespace = "ODataDemo") public class ActionImportSample { }
/** * Function with not nullable parameters import sample model. */ @EdmFunctionImport(function = "ODataDemoFunctionNotNullable", includeInServiceDocument = true, name = "ODataDemoFunctionNotNullableImport", namespace = "ODataDemo") public class FunctionNotNullableImportSample { }
/** * The Complex Type Sample List model. */ @EdmComplex(namespace = "ODataDemo") public class ComplexTypeSampleList { @EdmProperty(name = "ListProperty", nullable = true) private List<String> listProperty; public List<String> getListProperty() { return listProperty; } public ComplexTypeSampleList setListProperty(List<String> property) { this.listProperty = property; return this; } }
/** * The sample of Unbound Action. */ @EdmAction(namespace = "ODataDemo", name = "ODataDemoUnboundAction", entitySetPath = "ODataDemoEntitySetPath", isBound = false) @EdmReturnType(type = "Customers") public class UnboundActionSample implements Operation<Customer> { @EdmParameter(name = "StringParameter", nullable = false) private String stringParameter; @EdmParameter(name = "NumberParameter", nullable = false) private Long number; public String getStringParameter() { return stringParameter; } public Long getNumber() { return number; } @Override public Customer doOperation(ODataRequestContext requestContext, DataSourceFactory dataSourceFactory) { // Doesn't return anything because there is no possibility to implement it without datasource. return null; } }
/** * The Complex Type Sample List model. */ @EdmComplex(namespace = "ODataDemo") public class ComplexTypeSampleList { @EdmProperty(name = "ListProperty", nullable = true) private List<String> listProperty; public List<String> getListProperty() { return listProperty; } public ComplexTypeSampleList setListProperty(List<String> property) { this.listProperty = property; return this; } }
/** * The Complex Type Sample model. */ @EdmComplex(namespace = "ODataDemo") public class ComplexTypeSample extends AbstractComplexTypeSample { @EdmProperty(name = "SimpleProperty", nullable = true) private String simpleProperty; public String getSimpleProperty() { return simpleProperty; } public ComplexTypeSample setSimpleProperty(String property) { this.simpleProperty = property; return this; } }
/** * The Abstract Complex Type Sample. */ @EdmComplex(namespace = "ODataDemo") public abstract class AbstractComplexTypeSample { @EdmProperty(name = "InheritedProperty", nullable = true) private String inheritedProperty; public String getInheritedProperty() { return inheritedProperty; } public AbstractComplexTypeSample setInheritedProperty(String newInheritedProperty) { this.inheritedProperty = newInheritedProperty; return this; } }