嗨,当我尝试在休眠中使用我的 oracle db 序列时,我收到了这个错误。我正在使用这个声明:
@Entity
@Table(name = "T_USER_DETAILS")
public class User {
@GenericGenerator(name = "generator",strategy = "sequence-identity",parameters = { @Parameter(name = "sequence",value = "USER_ID_SEQ")} )
@Id
@GeneratedValue(generator = "generator")
@Column(name = "USER_ID")
private int userid;
..
并使用它来持久化我的实体实例:
session = sessionFactory.openSession();
//creating the new transaction from the above created session that is starting a new unit of work
transaction = session.beginTransaction();
session.save(user);
transaction.commit();
System.out.println("User saved successfully in the database");
}
catch(Exception ex)
{
但我收到错误:
Apr 11, 2013 11:10:20 AM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
ERROR: ORA-00917: missing comma
caught : ORA-00917: missing comma
有人可以帮忙吗?