You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Entity
@Table(name = "state_machine")
@JsonIdentityInfo(generator=ObjectIdGenerators.IntSequenceGenerator.class)
public class JpaRepositoryStateMachine extends RepositoryStateMachine {
Potential Issues
Table name clashes can occurs with already existing tables in project's DB.
Possible workarounds consist in renaming exiting table(s), or using another Datasource for Spring StateMachine.
Proposed improvement
Adding a prefix to Spring Statemachine table names, for instance "ssm_" would be great, both to prevent name clashes and to ease the finding and understanding of tables in DB.
Prefix would have a default value ( "ssm_" or "" ?) which could be changed using application property
Note about table-name-prefix:
A heads up should be given to users regarding the length of table names ( see #469 ) ( "ssm_" prefix will cause max length to be 26, which is below 30 mentioned in issue 469 )
About the implementation of this improvement
Application property spring.jpa.hibernate.naming.physical-strategy: could help with that.
@jvalkeal Sorry to bother you, but it seems you are the main contributor on this projet.
Just one question:
When / how often are 'need-triage' issues processed?
Context
Spring Statemachine creates tables to store statemachine's definitions and states.
As a consequence, when using Spring Statemachine in a project, the following tables are created:
Observations
As per the list above, one can note that table names of org.springframework.statemachine.JpaRepository* classes are hardcoded.
example taken from JpaRepositoryStateMachine.java :
Potential Issues
Table name clashes can occurs with already existing tables in project's DB.
Possible workarounds consist in renaming exiting table(s), or using another Datasource for Spring StateMachine.
Proposed improvement
Adding a prefix to Spring Statemachine table names, for instance "ssm_" would be great, both to prevent name clashes and to ease the finding and understanding of tables in DB.
Prefix would have a default value ( "ssm_" or "" ?) which could be changed using application property
Note about table-name-prefix:
A heads up should be given to users regarding the length of table names ( see #469 ) ( "ssm_" prefix will cause max length to be 26, which is below 30 mentioned in issue 469 )
About the implementation of this improvement
Application property
spring.jpa.hibernate.naming.physical-strategy:
could help with that.References:
https://www.baeldung.com/hibernate-naming-strategy
https://www.baeldung.com/hibernate-field-naming-spring-boot
About Other "statemachine" implementations
Thanks
The text was updated successfully, but these errors were encountered: