Physical Naming Strategy is ignored in SQLDelete annotation

Viewed 391

My phisical naming strategy mapped in persistance.xml works great except whaen trying to call em.remove on entity with SQLDelete annotation (trying to soft delete). Anyone had any similar problems?

my relevant persistance.xml

<properties>
        <property name="hibernate.physical_naming_strategy" value="common.hibernate.strategy.PhysicalNamingStrategyImpl" />
        <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
        <property name="hibernate.show_sql" value="true"/>
    </properties>

Annotation:

@SQLDelete(sql = "UPDATE MasGraphic MASG SET MASG .deleted = true WHERE MASG.id = ? and MASG.updated = ?")

And error is:

    Table "UPDATE MASGRAPHIC MASG SET MASG.deleted = true WHERE MASG.id = ? and MASG.updated = ? [42102-193]
[ERROR   ] HHH000346: Error during managed flush [org.hibernate.exception.SQLGrammarException: could not prepare statement]

Edit: adding caused by part of exception:

Caused by: org.h2.jdbc.JdbcSQLException: Table "MASGRAPHIC" not found; SQL statement:
UPDATE MASGRAPHIC MASG SET MASG.deleted = true WHERE MASG.id = ? and MASG.updated = ? [42102-193]

My custom PhysicalNamingStrategyImpl configures that table is called MAS_GRAPHIC and not MASGRAPHIC.

P.S. I don't know any other relevant information that you might need, so feel free to ask.

1 Answers
Related