I will wrap a small wire or paper clip around bolts to spray the exposed heads or through the pin holes and then I can just use that same wire to suspend them from a wire rack in the oven to cure. I will also poke the bolt etc through a piece of paper or masking tape to avoid over spray, I then flash it in the oven for 15 minutes or so to harden it just a tad and stop flowing before I remove the paper/tape. Too much longer though and the tape glues will leave gross glue remnants or the paint will cure to the paper leaving a gross edge once cured.
The best method will depend on the part.
And the hot glue would last through the oven phase without letting loose and dropping the part on the bottom of the oven?