如何在 Hibernate (MariaDB ColumnStore) 中为特定表设置引擎?

问题描述 投票:0回答:0

如何在 Hibernate 中为特定表设置引擎?

在本例中为 MariaDB ColumnStore 引擎。

在使用 Hibernate 自动生成表时,尝试使用 ColumnStore 引擎而不是默认的 InnoDB 创建表。

已经尝试过那些注释(ChatGPT 解决方案),但它们都已被弃用或不起作用。

@Table(name = "my_table", options = "ENGINE=ColumnStore")

@org.hibernate.annotations.Table(
    name = "my_table",
    schema = "my_schema",
    options = "ENGINE=ColumnStore"
)

@TableGenerator(
    name = "TABLE_GEN",
    table = "hibernate_sequences",
    pkColumnName = "sequence_name",
    pkColumnValue = "my_table_sequence",
    valueColumnName = "sequence_next_hi_value",
    allocationSize = 1,
    schema = "my_schema",
    parameters = {
        @Parameter(name = "table_type", value = "COLUMNSTORE")
    }
)

还有一些资源建议使用方言,但这可能无法解决引擎问题。

也许我可以创建表并手动声明引擎,但在使用 Hibernate 时这看起来有点笨拙,所以仍在寻找另一种解决方案。

sql hibernate mariadb olap columnstore
© www.soinside.com 2019 - 2024. All rights reserved.