vanillabp / spring-boot-support

Provides features used by Spring Boot based VanillaBP implementations
Apache License 2.0
2 stars 0 forks source link

Also support other types than java.lang.String for workflow aggregates primary keys #5

Closed stephanpelikan closed 1 year ago

stephanpelikan commented 1 year ago

Currently, any workflow aggregate has to define a primary key of type java.lang.String:

@Entity
public class DemoAggregate {
    @Id
    String id;
}

It should also be possible to define primary keys of any other type:

@Entity
public class DemoAggregate {
    @Id
    Long id;
}

Preconditions for those type are:

  1. Implements a method toString() to get a textual representation of the primary key.
  2. Implements a method valueOf(String) to get an object of the primary key's type based on the textual representation returned by toString().