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
1423 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
Mike Cichy
Appian Employee
over 11 years ago
Jin, is the problem with the initial write or the update? I know that the FK column in the child has to be nullable because of this (write then update) but I was not aware of any problems with the final update once the PKs are set.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
Mike Cichy
Appian Employee
over 11 years ago
Jin, is the problem with the initial write or the update? I know that the FK column in the child has to be nullable because of this (write then update) but I was not aware of any problems with the final update once the PKs are set.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data