Saturday, 15 September 2012

java - JPA/Hibernate + Postgres SequenceGenerator -


I long sequence from a Postgres with JPA / Hibernate'm trying for the whole day, but it gives me all the time:

information: hibernate: the next value phone alert tb_cdr_id_seq are: SQL error: 0, SQLState: 42,601 error: error: Syntax say "error or" near critical: javax. Persistence.PersistenceException: org. hibernate.exception.SQLGrammarException: Extracting could not ResultSet

  @Entity @Table (name = "tb_cdr") @XmlRootElement @SequenceGenerator (name = "tb_cdr_id_seq", sequenceName = "tb_cdr_id_seq", allocationSize = 1) Public Class CDR Serializable {Private Static Finals Long Serial Version UID = 1 L; @Id @GeneratedValue (strategy = GenerationType.SEQUENCE, generator = "tb_cdr_id_seq") @Basic (optional = false) @Column (name = "id") private Long id; ....}   

Postgraz version is 9.2 and does not have a function: Call next value .... like Hibernate Print ...

What should I do ?

Thank you

After "itemprop =" text ">

Hibernate was no auto detecting bid or it could be overridden having had. hibernate.dialect installation clearly resolves this issue to org.hibernate.dialect.PostgreSQLDialect .

No comments:

Post a Comment