How can I create lightweight edges using the Java API?

I’m upgrading from Orient v2.2.19 to v3.0.12 and I’m having some trouble with creating edge classes for lightweight edges. I was able to do that in v2.x so I’m assuming I can do that in v3 too. Is that a safe assumption?

I’m also creating the lightweight edge and saving it before both vertices are saved in the DB. This is before the transaction is committed so I think this is ok. Is this wrong?

Last thing, I’m saving the lightweight edge class as a subclass of E. Is this ok?