Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
2 replies
Subscribers
6 subscribers
Views
1422 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Process
Hello Everyone, I'm encountering a strange problem while trying t
Jin Pheh
Certified Associate Developer
over 11 years ago
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
Jin Pheh
Certified Associate Developer
over 11 years ago
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.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
Jin Pheh
Certified Associate Developer
over 11 years ago
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.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data