spring-modulith
spring-modulith copied to clipboard
Overriding event table name
Hello. Is there any way to override the name of the event_publication table to record events? Prior to version 1.1.0, it was possible to create own repository that extends EventPublicationRepository and, accordingly, use your own entity, which is mapped to a table with the desired name. In 1.1.0, the JpaEventPublicationRepository repository became package private same as EventPublicationRepository, which made it impossible to override/reimplement it in any simple way.
You can add a file to overwrite the entity mapping metadata.
example src/main/resources/META-INF/orm.xml
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://xmlns.jcp.org/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence/orm
http://xmlns.jcp.org/xml/ns/persistence/orm_2_2.xsd"
version="2.2">
<package>org.springframework.modulith.events.jpa</package>
<entity class="JpaEventPublication">
<table name="blablub" />
</entity>
</entity-mappings>
Thank you. But I thought it would be very good if there were no additional xml.. Some props may be...
Yes I would be nice to be able to customize table name or schema (my use case) via a property