Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member646845
Participant
860
We have released new versions of the SAP Cloud SDK. In detail, the following components are now available in new versions:

In this blog post, we will walk you through the highlights of these releases. For a complete overview, visit our release notes for the Java libraries, for the JavaScript libraries, and for the continuous delivery toolkit. The release notes also include the change log of all our releases so far.
At the end of the article, you will find a set of instructions on how to update to the new versions.


Java Libraries: Release Highlights 3.14.0


You can update your dependencies of the SAP Cloud SDK for Java to version 3.14.0 and consume the new version from Maven Central.

Introducing OData v4 (Preview)


With this version we're introducing the preview support for OData v4 services. The new OData client implementation is capable of the basic Create, Read, Update, Delete (CRUD) operations on OData v4 services.

The OData v4 support includes a dedicated generator that is capable of creating an OData v4 client through a command-line interface or Maven plugin. The usage is very similar to how the OData v2 generator is used.

To use the Maven plugin as part of your build process, the OData v4 generator can be configured as follows:
<plugin>
<groupId>com.sap.cloud.sdk.datamodel</groupId>
<artifactId>odata-v4-generator-maven-plugin</artifactId>
<!-- Please use the latest version here-->
<version>3.14.0</version>
<executions>
<execution>
<id>generate-consumption</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputDirectory>${project.basedir}/edmx</inputDirectory>
<outputDirectory>${project.build.directory}/vdm</outputDirectory>
<deleteOutputDirectory>true</deleteOutputDirectory>
<packageName>com.mycompany.vdm</packageName>
<defaultBasePath>odata/v4/</defaultBasePath>
</configuration>
</execution>
</executions>
</plugin>

Using the OData v4 Client (Preview)


The OData v4 client library usage follows the same pattern as already known from the OData v2 clients.

Once you've generated your OData v4 client, you are ready to make use of the new OData v4 features, such as:

  • Using more complex filtering capabilities with type-specific functions.
    private static final HttpDestination destination = DefaultHttpDestination.builder("https://my.service.url").build();
    private static final MyService service = new DefaultMyService().withServicePath("/my/base/path");

    @Test
    public void testGetAll() {
    service.getAllItem()
    .select(Item.ID,
    Item.DESCRIPTION,
    Item.TO_SUB_ITEMS
    .select(SubItem.DESCRIPTION))
    .filter(Item.DESCRIPTION.length().greaterThan(20))
    .top(5)
    .skip(5)
    .execute(destination);
    }


  • Selectively expand nested entity collections: the below example shows how to get all users and only expand their trips which start in 2020.
    new DefaultPersonService().getPersons().select(
    Person.FIRST_NAME,
    Person.LAST_NAME,
    Person.TRIPS.select(Trip.NAME).filter(Trip.STARTS_AT.dateYear().equalTo(2020)))
    .execute(destination)



Note that the OData v4 implementation is initially in beta and thus does not guarantee a stable API. We'll announce the first final release in a separate blog post. Stay tuned!

We want your Feedback on OData v4


Are you already using OData v4 in your project or planning to do so? Give the SAP Cloud SDK client library a try and let us know what you think, request missing features or get help on best practices. Leave a comment on this blog post or contact us at cloudsdk@sap.com.

Several further improvements are listed in the full release notes.

Java Libraries version 2 are in Maintenance


Note that with this release we did not bring a new version of the Java libraries in version 2.
In August 2019 we released the major upgraded version 3 of the SAP Cloud SDK for Java. We thank you for the great feedback you provided to us in the time since then so that we could make the SDK even more helpful to you. In the meantime, we kept providing bugfixes and updates for version 2 as well.

For projects using version 2 of the SDK for Java, upgrading to version 3 is strongly encouraged. Reach out to us if you have any questions. We're happy to help.

You can still consume the latest version 2 release from Maven Central.

JavaScript Libraries: Release Highlights 1.17.2


The JavaScript libraries of the SAP Cloud SDK are now available in version 1.17.2.

The new version of the SAP Cloud SDK library for JavaScript now considers proxy environment variables (HTTP_PROXY, HTTPS_PROXY, http_proxy, https_proxy) for destinations configured in VCAP service bindings (e.g. when using SAP Extension Factory).

With this release, we also resolved some small issues with the OData generator and made the API usage more convenient by fixing some inconsistencies.

As usual, the full release notes contain a list of all improvements in this release.

How to Update


Java libraries


To update the version of the SAP Cloud SDK Java libraries used in an existing project, proceed as follows:

  • Open the pom.xml file in the root folder of your project.

  • Locate the dependency management section and therein the sdk-bom dependency.

  • Update the version of that dependency to 3.14.0.


With this, you are already done thanks to the "bill of material" (BOM) approach. Your dependency should look like this:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.sap.cloud.sdk</groupId>
<artifactId>sdk-bom</artifactId>
<version>3.14.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
<!-- possibly further managed dependencies ... -->
</dependencyManagement>

If you update from a version prior to 3.0.0, have a look at our migration guide.

If you are using the SAP Cloud SDK in a project of the SAP Cloud Application Programming Model, replace sdk-bom with sdk-modules-bom to only update the version of SDK modules, not further dependencies.
You can now recompile your project (be aware of the compatibility notes, though) and leverage the new features of the SAP Cloud SDK in version 3.14.0.

Of course, you can also generate a new project that uses version 3.14.0 from the start by running the Maven archetypes for Neo or Cloud Foundry with -DarchetypeVersion=3.14.0 (or RELEASE).

JavaScript libraries


To update the version of the SAP Cloud SDK JavaScript libraries used in an existing project, use the command npm update in the root folder of your module. Note that this will also update other modules, unless you explicitly specify which packages to update. If you want to check beforehand what will change, use npm outdated.

Learn more about SAP Cloud SDK


To learn how others in the community use SAP Cloud SDK you can check out more related blog posts.

Are you interested in a particular topic? It might be helpful to search the Q&A place? Feel free to ask your question there and do not forget to select the tag SAP Cloud SDK.

If you are new to SAP Cloud SDK, get started and gain first hand-on exercise by following our tutorials.