Hello Everyone, I'm encountering a strange problem while trying t

Certified Associate Developer
Hello Everyone,

I'm encountering a strange problem while trying to write a OneToMany relationship to a database. After turning TRACE level debugging I discovered that Appian/Hibernate is writing the the relation ship in the following order:
1. Write parent
2. Write child
3. Update child with reference to parent.

The problem I'm running into lies with the third step - while trying to update the child's reference to the parent Appian/Hibernate is *also* trying to set the primary key of the child to an invalid value - even though it already has a valid value from step 2.
IE: update child set parentReference = <parentPK>, primaryKey = 0 where primaryKey = <PK from insert in step 2>

Does anyone have any insight as to why this may be happening and how to stop it? I've already applied 'updatable=false' to the @Column definition of the child but the system is still trying to update it....

OriginalPostID-74500

OriginalPostID-74500

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Associate Developer
    Hi Mike. The problem is with the update - step 3 in my list above. The FK column in the child table is nullable and the system successfully writes it in step 2.

    The SQL update command I listed was taken directly from the application-server.log file which is where I'm having a problem - it's purposely trying to reset the PK of the child element.
Reply
  • 0
    Certified Associate Developer
    Hi Mike. The problem is with the update - step 3 in my list above. The FK column in the child table is nullable and the system successfully writes it in step 2.

    The SQL update command I listed was taken directly from the application-server.log file which is where I'm having a problem - it's purposely trying to reset the PK of the child element.
Children
No Data