Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JPA与postgresql_Postgresql_Hibernate_Spring Data Jpa - Fatal编程技术网

JPA与postgresql

JPA与postgresql,postgresql,hibernate,spring-data-jpa,Postgresql,Hibernate,Spring Data Jpa,当我使用hibernate在Jpa中使用PostgreSQL数据库创建表实体时 tire - @Entity @Immutable public class User_entity_t implements Serializable, Cloneable { private static final long serialVersionUID = -7049957706738879274L; @Id @GeneratedValue(strategy = G

当我使用hibernate在Jpa中使用PostgreSQL数据库创建表实体时

tire - 

 @Entity
 @Immutable
  public class User_entity_t implements Serializable, Cloneable {

    private static final long serialVersionUID = -7049957706738879274L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id", updatable = false, nullable = false)
    private Long _judId;

@Column(nullable = false)
private String name;
我也有例外

{syntax error at or near "auto_increment"} Primary Key Id

自动增量听起来像MySQL


您必须设置正确的Hibernate方言。

这可能是重复的声音,好像您的混淆层不知道Postgres如何处理“自动递增”列(作为
serial
或作为
identity
)1)您应该避免使用auto并选择identity。2) 自动增量听起来像MySQL。你有正确的方言集吗?@SimonMartinelli谢谢你的回复。但当iuse Id GeneratedValue(strategy=GenerationType.IDENTITY)列(columnDefinition=“serial”)私有长Id时;同样的错误,你确定你为Postgres设置了正确的语法吗?