Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overriding event table name #417

Open
tuuka opened this issue Dec 18, 2023 · 2 comments
Open

Overriding event table name #417

tuuka opened this issue Dec 18, 2023 · 2 comments

Comments

@tuuka
Copy link

tuuka commented Dec 18, 2023

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.

@der-ambi
Copy link

der-ambi commented Feb 1, 2024

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>

@tuuka
Copy link
Author

tuuka commented Feb 2, 2024

Thank you. But I thought it would be very good if there were no additional xml.. Some props may be...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants