add sequence as primary key when write to datastore entity

This is the xsd I am using for the CDT. But got an error when execute. Don't know why the auditId is still null. Any ideas?

 

<xsd:element name="auditId" type="xsd:integer">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">
@Id @Column(name="auditId", columnDefinition="NUMBER(19,2)", nullable=false, unique=true)
@GeneratedValue(generator = "AUDIT_SQ", strategy = GenerationType.SEQUENCE)
@SequenceGenerator(name = "AUDIT_SQ", sequenceName = "APPIAN_WF_JB_CPL.GMTA_AUDITHISTORY_SQ", allocationSize=1)
</xsd:appinfo>
</xsd:annotation>
</xsd:element>

 

Error:

Details: org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update: java.sql.BatchUpdateException: ORA-00904: "auditId": invalid identifier Data: TypedValue[it=1103,v={{<null>,2017-08-03 09:32:23.64,e571579,User,Removed,e513422,263}}]

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    Hi Also try to follow these steps to avoid this error while working with Oracle DB

    * The column name must begin with a letter.
    * The column name cannot be longer than 30 characters.
    * The column name must be made up of alphanumeric characters or the following special characters: $, _, and #. If the column name uses
    any other characters, it must be enclosed in double quotation marks.
    * The column name can not be a reserved word.
Reply
  • 0
    Certified Lead Developer
    Hi Also try to follow these steps to avoid this error while working with Oracle DB

    * The column name must begin with a letter.
    * The column name cannot be longer than 30 characters.
    * The column name must be made up of alphanumeric characters or the following special characters: $, _, and #. If the column name uses
    any other characters, it must be enclosed in double quotation marks.
    * The column name can not be a reserved word.
Children
No Data