Skip to content

Commit

Permalink
Merge branch 'main' into composition-of-one-limitations
Browse files Browse the repository at this point in the history
  • Loading branch information
etimr authored Mar 11, 2024
2 parents 83bcbd0 + 4f04bfb commit 27de529
Show file tree
Hide file tree
Showing 73 changed files with 1,915 additions and 1,667 deletions.
10 changes: 5 additions & 5 deletions about/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Following is an index of the features currently covered by CAP, with status and
| [Temporal Data](../guides/temporal-data) | <X/> | <X/> | <X/> |
| [Managed Data](../guides/domain-modeling#managed-data) | <X/> | <X/> | <X/> |
| [Dynamic Extensibility](../guides/extensibility/) | <X/> | <X/> | <X/> |
| Monitoring / Logging [[Node.js](../node.js/cds-log)\|[Java](../java/observability#logging)] | <Na/> | <X/> | <X/> |
| Monitoring / Logging [[Node.js](../node.js/cds-log)\|[Java](../java/operating-applications/observability#logging)] | <Na/> | <X/> | <X/> |
| Audit Logging [[Node.js](../guides/data-privacy/audit-logging)\|[Java](../java/auditlog)] | <Na/> | <X/> | <X/> |


Expand Down Expand Up @@ -179,9 +179,9 @@ Following is an index of the features currently covered by CAP, with status and
| | CDS | Node.js | Java |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----:|:-------:|:----:|
| [Declared Events in CDS](../cds/cdl#events) | <X/> | <X/> | <X/> |
| Mock Broker (to speed up local dev) [[Node.js](../node.js/messaging#file-based)\|[Java](../java/messaging-foundation#local-testing)] | <Na/> | <X/> | <X/> |
| SAP Event Mesh (Singletenancy) [[Node.js](../node.js/messaging#event-mesh-shared)\|[Java](../java/messaging-foundation#configuring-sap-event-mesh-support)] | <Na/> | <X/> | <X/> |
| Composite Messaging (routing by configuration) [[Node.js](../node.js/messaging#composite-messaging)\|[Java](../java/messaging-foundation#composite-messaging-service)] | <Na/> | <X/> | <X/> |
| Mock Broker (to speed up local dev) [[Node.js](../node.js/messaging#file-based)\|[Java](../java/messaging#local-testing)] | <Na/> | <X/> | <X/> |
| SAP Event Mesh (Singletenancy) [[Node.js](../node.js/messaging#event-mesh-shared)\|[Java](../java/messaging#configuring-sap-event-mesh-support)] | <Na/> | <X/> | <X/> |
| Composite Messaging (routing by configuration) [[Node.js](../node.js/messaging#composite-messaging)\|[Java](../java/messaging#composite-messaging-service)] | <Na/> | <X/> | <X/> |
| Import AsyncAPI | <O/> | | |
| Export AsyncAPI | <X/> | | |

Expand All @@ -195,7 +195,7 @@ Following is an index of the features currently covered by CAP, with status and
| [SAP HANA Cloud](../guides/databases-hana) | <X/> | <X/> | <X/> |
| [PostgreSQL](../guides/databases-postgres) | <X/> | <X/> | <X/> |
| [SQLite](../guides/databases-sqlite) <sup>1</sup> | <X/> | <X/> | <X/> |
| [H2](../java/persistence-services#h2) <sup>1</sup> | <X/> | <Na/> | <X/> |
| [H2](../java/cqn-services/persistence-services#h2) <sup>1</sup> | <X/> | <Na/> | <X/> |
| [MongoDB](../guides/databases) out of the box | <Na/> | <Na/> | <D/> |
| Pluggable drivers architecture | <D/> | <D/> | <X/> |
| Out-of-the-box support for other databases? | <C/> | <C/> | <C/> |
Expand Down
4 changes: 2 additions & 2 deletions advanced/odata.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Content-Type: application/json
}
```

PATCH requests with delta payload are executed using batch delete and [upsert](../java/query-api#bulk-upsert) statements, and are more efficient than OData [batch requests](https://docs.oasis-open.org/odata/odata/v4.01/csprd02/part1-protocol/odata-v4.01-csprd02-part1-protocol.html#sec_BatchRequests).
PATCH requests with delta payload are executed using batch delete and [upsert](../java/working-with-cql/query-api#bulk-upsert) statements, and are more efficient than OData [batch requests](https://docs.oasis-open.org/odata/odata/v4.01/csprd02/part1-protocol/odata-v4.01-csprd02-part1-protocol.html#sec_BatchRequests).

Use PATCH on entity collections for uploading mass data using a dedicated service, which is secured using [role-based authorization](../java/security#role-based-auth). Delta updates must be explicitly enabled by annotating the entity with

Expand All @@ -115,7 +115,7 @@ Limitations:
* [Added and deleted links](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_IteminaDeltaPayloadResponse) are not supported.
* The header `Prefer=representation` is not yet supported.
* The `continue-on-error` preference is not yet supported.
* The generic CAP handler support for [upsert](../java/query-api#upsert) is limited, for example, audit logging is not supported.
* The generic CAP handler support for [upsert](../java/working-with-cql/query-api#upsert) is limited, for example, audit logging is not supported.


## Mapping of CDS Types { #type-mapping}
Expand Down
6 changes: 3 additions & 3 deletions cds/compiler-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ With compiler v2, these additional types are not reflected in CSN anymore.
#### Migration

If you've got custom code that evaluates the CSN and uses these types, you need to adapt that code.
Also in Java, [accessor-](../java/advanced#accessor-interfaces) or [model interfaces](../java/advanced#model-interfaces) generated for these types, will change.
Also in Java, [accessor-](../java/cqn-services/persistence-services#accessor-interfaces) or [model interfaces](../java/cqn-services/persistence-services#model-interfaces) generated for these types, will change.


### Removed: Property `$syntax`
Expand Down Expand Up @@ -756,7 +756,7 @@ In this example, the return type of the `cancel` function is automatically expos
With compiler v1 this change was also reflected in the CSN. With compiler v2 this is not the case any longer.

::: warning _❗ Warning_
If types are used in a service that are defined outside of the service the [generated accessor interface](../java/data#generated-accessor-interfaces) will change when upgrading from compiler v1 to v2!
If types are used in a service that are defined outside of the service the [generated accessor interface](../java/cds-data#generated-accessor-interfaces) will change when upgrading from compiler v1 to v2!
:::

If compiler v1 is used CAP Java will generate interfaces using the automatically exposed type from EDMX:
Expand Down Expand Up @@ -838,7 +838,7 @@ OData, however, does not support anonymous types. Hence, the compiler will autom
In this example the compiler generated the type `Person_emails` in the OData service `hr`.

::: warning _❗ Warning_
If an inline defined type is used in a service the [generated accessor interface](../java/data#generated-accessor-interfaces) will change (an inner interface is generated) when upgrading from compiler v1 to v2!
If an inline defined type is used in a service the [generated accessor interface](../java/cds-data#generated-accessor-interfaces) will change (an inner interface is generated) when upgrading from compiler v1 to v2!
:::

If compiler v1 is used CAP Java generates a *top-level* interface for item type:
Expand Down
2 changes: 1 addition & 1 deletion get-started/hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ module.exports = class say {

<div class="impl java">

... for example, using a [CAP Java](../java/provisioning-api) custom handler like this:
... for example, using a [CAP Java](../java/event-handlers) custom handler like this:

::: code-group

Expand Down
10 changes: 5 additions & 5 deletions get-started/in-a-nutshell.md
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ In Node.js, the easiest way to provide implementations for services is through e

[See these files also in **cap/samples**/bookshop/srv folder.](https://github.com/sap-samples/cloud-cap-samples/tree/main/bookshop/srv){.learn-more}
[Learn more about providing service implementations **in Node.js**.](../node.js/core-services#implementing-services){.learn-more .impl .node}
[Learn also **how to do that in Java** using Event Handler Classes.](../java/provisioning-api#handlerclasses){.learn-more .impl .java}
[Learn also **how to do that in Java** using Event Handler Classes.](../java/event-handlers#handlerclasses){.learn-more .impl .java}

</div>

Expand Down Expand Up @@ -670,7 +670,7 @@ public class CatalogHandler implements EventHandler {
:::


[Learn more about **event handlers** in the CAP Java documentation.](../java/provisioning-api#handlerclasses){.learn-more}
[Learn more about **event handlers** in the CAP Java documentation.](../java/event-handlers#handlerclasses){.learn-more}

</div>

Expand Down Expand Up @@ -788,11 +788,11 @@ public class SubmitOrderHandler implements EventHandler {
[Find this source also in **cap/samples**.](https://github.com/sap-samples/cloud-cap-samples/tree/main/bookshop/srv/cat-service.js){ .learn-more .impl .node target="_blank"}
[Find this source also in **cap/samples**.](https://github.com/SAP-samples/cloud-cap-samples-java/blob/main/srv/src/main/java/my/bookshop/handlers/CatalogServiceHandler.java#L166){ .impl .java .learn-more target="_blank"}
[Learn more about **connecting to services** using `cds.connect`.](../node.js/cds-connect){ .learn-more .impl .node}
[Learn more about **connecting to services** using `@Autowired`, `com.sap.cds.ql`, etc.](../java/consumption-api){.learn-more .impl .java}
[Learn more about **connecting to services** using `@Autowired`, `com.sap.cds.ql`, etc.](../java/services){.learn-more .impl .java}
[Learn more about **reading and writing data** using `cds.ql`.](../node.js/cds-ql){ .learn-more .impl .node}
[Learn more about **reading and writing data** using `cds.ql`.](../java/query-api){ .learn-more .impl .java}
[Learn more about **reading and writing data** using `cds.ql`.](../java/working-with-cql/query-api){ .learn-more .impl .java}
[Learn more about **using reflection APIs** using `<srv>.entities`.](../node.js/core-services#entities){ .learn-more .impl .node}
[Learn more about **typed access to data** using the CAP Java SDK.](../java/data#typed-access){ .learn-more .impl .java}
[Learn more about **typed access to data** using the CAP Java SDK.](../java/cds-data#typed-access){ .learn-more .impl .java}

**Test this implementation**, [for example using the Vue.js app](#vue), and see how discounts are displayed in some book titles. {.impl .node}

Expand Down
4 changes: 2 additions & 2 deletions get-started/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ module.exports = cds.server

### How can I make sure that a user passes all authorization checks?

A new option `privilegedUser()` can be leveraged when [defining](../java/request-contexts#defining-requestcontext) your own `RequestContext`. Adding this introduces a user, which passes all authorization restrictions. This is useful for scenarios, where a restricted service should be called through the [local service consumption API](../java/consumption-api) either in a request thread regardless of the original user's authorizations or in a background thread.
A new option `privilegedUser()` can be leveraged when [defining](../java/event-handlers/request-contexts#defining-requestcontext) your own `RequestContext`. Adding this introduces a user, which passes all authorization restrictions. This is useful for scenarios, where a restricted service should be called through the [local service consumption API](../java/services) either in a request thread regardless of the original user's authorizations or in a background thread.

### Why do I get a "User should not exist" error during build time?

Expand Down Expand Up @@ -221,7 +221,7 @@ To fix this, either switch the Node.js version using a Node version manager, or
### How can I expose custom REST APIs with CAP?

From time to time you might want to expose additional REST APIs in your CAP application, that aren't covered through CAPs existing protocol adapters (for example, OData V4). A common example for this might be a CSV file upload or another type of custom REST endpoint.
In that case, you can leverage the powerful capabilities of Spring Web MVC, by implementing your own RestController. From within your RestController implementation, you can fully leverage all CAP Java APIs. Most commonly you'll be interacting with your services and the database through the [local service consumption API](../java/consumption-api). To learn more about Spring Web MVC, see the [Spring docs](https://docs.spring.io/spring-framework/docs/current/reference/html/web.html#mvc), [Spring Boot docs](https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-spring-mvc), and this [tutorial](https://spring.io/guides/gs/serving-web-content/).
In that case, you can leverage the powerful capabilities of Spring Web MVC, by implementing your own RestController. From within your RestController implementation, you can fully leverage all CAP Java APIs. Most commonly you'll be interacting with your services and the database through the [local service consumption API](../java/services). To learn more about Spring Web MVC, see the [Spring docs](https://docs.spring.io/spring-framework/docs/current/reference/html/web.html#mvc), [Spring Boot docs](https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-spring-mvc), and this [tutorial](https://spring.io/guides/gs/serving-web-content/).

### How can I build a CAP Java application without SQL database?

Expand Down
18 changes: 9 additions & 9 deletions guides/databases-h2.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ impl-variants: true

For local development and testing, CAP Java supports the [H2](https://www.h2database.com/) database, which can be configured to run in-memory.

[Learn more about features and limitations of using CAP with H2](../java/persistence-services#h2){.learn-more}
[Learn more about features and limitations of using CAP with H2](../java/cqn-services/persistence-services#h2){.learn-more}

<div class="impl node">

Expand All @@ -30,7 +30,7 @@ Not supported for CAP Node.js.

### Using the Maven Archetype {.impl .java}

When a new CAP Java project is created with the [Maven Archetype](../java/development/#the-maven-archetype) or with `cds init`,
When a new CAP Java project is created with the [Maven Archetype](../java/developing-applications/building#the-maven-archetype) or with `cds init`,
H2 is automatically configured as in-memory database used for development and testing in the `default` profile.

### Manual Configuration {.impl .java}
Expand All @@ -45,20 +45,20 @@ To use H2, just add a Maven dependency to the H2 JDBC driver:
</dependency>
```

Next, configure the build to [create an initial _schema.sql_ file](../java/persistence-services#initial-database-schema-1) for H2 using `cds deploy --to h2 --dry`.
Next, configure the build to [create an initial _schema.sql_ file](../java/cqn-services/persistence-services#initial-database-schema-1) for H2 using `cds deploy --to h2 --dry`.

In Spring, H2 is automatically initialized as in-memory database when the driver is present on the classpath.

[Learn more about the configuration of H2 ](../java/persistence-services#h2){.learn-more}
[Learn more about the configuration of H2 ](../java/cqn-services/persistence-services#h2){.learn-more}

## Features {.impl .java}

CAP supports most of the major features on H2:

* [Path Expressions](../java/query-api#path-expressions) & Filters
* [Expands](../java/query-api#projections)
* [Path Expressions](../java/working-with-cql/query-api#path-expressions) & Filters
* [Expands](../java/working-with-cql/query-api#projections)
* [Localized Queries](../guides/localized-data#read-operations)
* [Comparison Operators](../java/query-api#comparison-operators)
* [Predicate Functions](../java/query-api#predicate-functions)
* [Comparison Operators](../java/working-with-cql/query-api#comparison-operators)
* [Predicate Functions](../java/working-with-cql/query-api#predicate-functions)

[Learn about features and limitations of H2](../java/persistence-services#h2){.learn-more}
[Learn about features and limitations of H2](../java/cqn-services/persistence-services#h2){.learn-more}
6 changes: 3 additions & 3 deletions guides/databases-hana.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Package `@sap/cds-hana` uses the [`hdb`](https://www.npmjs.com/package/hdb) driv

<div markdown="1" class="impl java">

To use SAP HANA Cloud, [configure a module](../java/architecture#module-configuration), which includes the feature `cds-feature-hana`.
To use SAP HANA Cloud, [configure a module](../java/developing-applications/building#standard-modules), which includes the feature `cds-feature-hana`.
For example, add a Maven runtime dependency to the `cds-feature-hana` feature:

```xml
Expand All @@ -59,13 +59,13 @@ For example, add a Maven runtime dependency to the `cds-feature-hana` feature:

::: tip

The [modules](../java/architecture#standard-modules) `cds-starter-cloudfoundry` and `cds-starter-k8s` include `cds-feature-hana`.
The [modules](../java/developing-applications/building#standard-modules) `cds-starter-cloudfoundry` and `cds-starter-k8s` include `cds-feature-hana`.

:::

The datasource for HANA is then auto-configured based on available service bindings of type *service-manager* and *hana*.

Learn more about the [configuration of an SAP HANA Cloud Database](../java/persistence-services#sap-hana){ .learn-more}
Learn more about the [configuration of an SAP HANA Cloud Database](../java/cqn-services/persistence-services#sap-hana){ .learn-more}

</div>

Expand Down
6 changes: 3 additions & 3 deletions guides/databases-postgres.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This guide focuses on the new PostgreSQL Service provided through *[@cap-js/post

CAP Java SDK is tested on [PostgreSQL](https://www.postgresql.org/) 15. Most CAP features are supported on PostgreSQL.

[Learn more about features and limitations of using CAP with PostgreSQL](../java/persistence-services#postgresql){.learn-more}
[Learn more about features and limitations of using CAP with PostgreSQL](../java/cqn-services/persistence-services#postgresql){.learn-more}

</div>

Expand Down Expand Up @@ -140,7 +140,7 @@ For local development provide the credentials using a suitable [`cds env`](../no

If a PostgreSQL service binding exists, the corresponding `DataSource` is auto-configured.

You can also explicitly [configure the connection data](../java/persistence-services#postgres-connection) of your PostgreSQL database in the _application.yaml_ file.
You can also explicitly [configure the connection data](../java/cqn-services/persistence-services#postgres-connection) of your PostgreSQL database in the _application.yaml_ file.
If you run the PostgreSQL database in a [docker container](#using-docker) your connection data might look like this:

```yaml
Expand All @@ -153,7 +153,7 @@ spring:
driver-class-name: org.postgresql.Driver
```
To start the application with the new profile `postgres-docker`, the `spring-boot-maven-plugin` can be used: `mvn spring-boot:run -Dspring-boot.run.profiles=postgres-docker`.
Learn more about the [configuration of a PostgreSQL database](../java/persistence-services#postgresql-1){ .learn-more}
Learn more about the [configuration of a PostgreSQL database](../java/cqn-services/persistence-services#postgresql-1){ .learn-more}

### Service Bindings for CDS Tooling {.impl .java}

Expand Down
Loading

0 comments on commit 27de529

Please sign in to comment.