Skip to content

Commit

Permalink
docs(spring-sdk): small fixes to Quickstart (#1267)
Browse files Browse the repository at this point in the history
Rephrase inheritance description.

Fix CustomerEntity src path.

Fix typos.
  • Loading branch information
beritou authored Nov 17, 2022
1 parent e69d214 commit b642f6d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ The `Customer` API is defined by the `CustomerEntity`.
Create a class names `CustomerEntity` in package `customer.api`.

[source,java,indent=0]
.src/main/java/customer/api/Address.java
.src/main/java/customer/api/CustomerEntity.java
----
include::example$spring-customer-registry-quickstart/src/main/java/customer/api/CustomerEntity.java[tag=customer]
----
<1> Each Entity needs a unique logical type name. This must be unique per Kalix service.
<2> The entity needs to be address by a unique identifier. The `@EntityKey` declares the name of the path variable that Kalix should use as unique identifier.
<3> The `@RequestMapping` defines the base path to access the entity. Note that the `\{customer_id\}` matches the value of `@EntityKey`.
<4> `CustomerEntity` must implement Kalix' `ValueEntity`
<4> `CustomerEntity` must inherit from `kalix.javasdk.valueentity.ValueEntity`.
<5> Each API method must be exposed as a REST endpoint using Spring's REST annotations.
<6> The implementation instruct Kalix to persist the state `customer`
<6> The implementation instructs Kalix to persist the state `customer`.
<7> After persisting, Kalix is instructed to return the String 'Ok'.


Expand Down

0 comments on commit b642f6d

Please sign in to comment.