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

Analytics should respect physical_naming_strategy #66

Open
manosbatsis opened this issue Oct 28, 2023 · 0 comments
Open

Analytics should respect physical_naming_strategy #66

manosbatsis opened this issue Oct 28, 2023 · 0 comments

Comments

@manosbatsis
Copy link

manosbatsis commented Oct 28, 2023

My Spring config fragment:

spring:
    jpa:
        #...
        database-platform: org.hibernate.dialect.H2Dialect
        properties:
            hibernate:
                #...
                physical_naming_strategy: org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy

My JPA entity (kotlin):

@Entity
@Include(rootLevel = true, name = "transfer", description = "A monetary transfer transaction")
class TransferTransaction(
   // ...
)

My join definition in my reservestats hjson table:

joins: [
    {
        name: reserveTransfer
        to: transfer
        # Full Join is not supported for: H2
        # type: full
        definition: '{{$reserveId}} = {{reserveTransfer.$id}}'
    }
]

Generates:

SELECT count(_reservestats_reserveTransfer_138211222.id) AS count
FROM currency_reserve AS _reservestats
LEFT OUTER JOIN TransferTransaction AS _reservestats_reserveTransfer_138211222
ON _reservestats.id = _reservestats_reserveTransfer_138211222.reserve

It should generate:

SELECT count(_reservestats_reserveTransfer_138211222.id) AS count
FROM currency_reserve AS _reservestats
LEFT OUTER JOIN transfer_transaction AS _reservestats_reserveTransfer_138211222
ON _reservestats.id = _reservestats_reserveTransfer_138211222.reserve_id

i.e.:

  • TransferTransaction > transfer_transaction
  • reserve > reserve_id
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

1 participant