BundleContentImp objects always have an ID of -1. There are are two cases where this is observable:
(1) the BundleContentImp constructor, and (2) the BundleService addContentToBundle(BundleContentImp bundleContentImp) method.
The below test case demonstrates this behavior:
Forgot to add the helper methods for reference:
Thanks for taking your time and sending a detailed report. I have fixed it in our repo and it should be a part of next release. You are probably already doing it but you can set bundleContentImp.id from bundleContent.id within your code. Actually our Rest API is doing this, so when you get content of a bundle from Rest API it is correctly setting ids.
Thanks! Yep, figured that out
Only part where it’s annoying is creating/updating a BundleContentImp (addContentToBundle or updateBundleContent) – since it didn’t have an ID set, I have to make a second call to get it again (getBundleContent).
Thanks for your help!