I'm trying for the all day long get the Sequence from a Postgres with JPA/Hibernate, but it gives me all the time:
INFO: Hibernate: call next value for tb_cdr_id_seq WARN: SQL Error: 0, SQLState: 42601 ERROR: ERROR: syntax error at or near "call" SEVERE: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
@Entity
@Table(name = "tb_cdr")
@XmlRootElement
@SequenceGenerator(name = "tb_cdr_id_seq", sequenceName = "tb_cdr_id_seq", allocationSize=1)
public class Cdr implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "tb_cdr_id_seq")
@Basic(optional = false)
@Column(name = "id")
private Long id;
....
}
the Postgres version is 9.2 and don't have the function: call next value.... like Hibernate is print...
What should I do ?
Thanks
log_statement = on
) or Hibernate logs. At a guess, you might be using the wrong SQL dialect setting, or the sequencetb_cdr_id_seq
doesn't exist. – Craig Ringer Jun 20 '13 at 23:47