【问题标题】:Hibernate only accepting lower case for Postgres?Hibernate 只接受 Postgres 的小写字母?
【发布时间】:2016-06-07 11:41:48
【问题描述】:

我在使用 hibernate 和 Postgres 时遇到问题

版本 org.hibernate:hibernate-entitymanager:5.1.0.Final & Postgres 客户端和服务器 9.4.5

我正在使用注释,当我使用 Camel 大小写时,我得到一个 table not found 错误,但是当我使用小写时它没有问题(我更改数据库中的表名以匹配)所以

@Entity
@Table(name = "accounttype")
public class AccountType implements Serializable {...

工作正常,但是

@Entity
@Table(name = "AccountType")
public class AccountType implements Serializable {...

因找不到表错误而失败?

这是一个已知问题还是我应该设置一个属性?!

非常感谢

【问题讨论】:

标签: hibernate


【解决方案1】:

道歉在hibernate论坛上找到了答案。 Postgres 希望在混合大小写表中加上单引号 - ` (forum.hibernate.org/viewtopic.php?f=1&t=935715)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-17
    • 2019-01-17
    相关资源
    最近更新 更多