Postgres SQL Insertion of data and fetching the data

Hi All,

We have a postgre SQL DB connected to Appian system. And one of the column is a primary Key and the type of the Primary Key is UUID. However the Type of the UUID column is not compatible with Appian.

In such scenario how to insert the data and how to retreive the data from the database. If anyone has done it in any other way , Please help us in finding out the solution.

Thanks,

Harsha

  Discussion posts and replies are publicly visible

Parents Reply Children
  • Hi ,

    Here are the logs 

    2021-09-04 16:53:42,950 [ajp-nio-0.0.0.0-8009-exec-7436] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: relation "Challenge" does not exist
      Position: 311
    2021-09-04 16:56:12,964 [ajp-nio-0.0.0.0-8009-exec-7438] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: relation "Asset" does not exist
      Position: 611
    

    However we do have the tables which are showing as doest not exist. please help.
  • 0
    Certified Lead Developer
    in reply to harshav420

    I think we need to divide and conquer.

    Please create a simple table with a UUID field, map it to text in the XSD and check whether this works.

    Next, there seems to be an issue with your JPA annotations. How did your create the DB schema? How did you create the CDTs? Which JPA annotations do you use?

  • Hi ,

    Here are the things which we did.

    1. Create a table with UUID column and created a CDT and DSE.

    2.Created a Expression RUle and i was able to fetch the data from the table.

    3. Created a PM to update the row, where i did try to insert.

    Action" set "ActionName"='test', "ActionDescription"='test1', "ActionUId"='006ba1e4-666f-4b88-9e6e-ddaa8890c0e9', "TeamSize"=7 where "ActionId"=4 was aborted: ERROR: column "ActionUId" is of type uuid but expression is of type character varying
     Hint: You will need to rewrite or cast the expression.
     Position: 74  Call getNextException to see other errors in the batch.: org.postgresql.util.PSQLException: ERROR: column "ActionUId" is of type uuid but expression is of type character varying
     Hint: You will need to rewrite or cast the expression.
     Position: 74 Data: TypedValue[it=28902,v={4,test,test1,006ba1e4-666f-4b88-9e6e-ddaa8890c0e9,7}]

    This is the error which i am getting. My doubt is that with what i need to cast this?

    Also one more thing is we have tables where the UUID is the primary of the tables in Postgre where we need to try that as i am not sure how this works.

  • 0
    Certified Lead Developer
    in reply to harshav

    I do not have any experience in using UUID fields with Appian.

    https://vladmihalcea.com/hibernate-and-uuid-identifiers/

    I think you will need to modify the XSD file and add some JPA annotations.