getRelationshipOrder
will be null for a lookup relationship, but will be 0 or 1 for a master-detail relationship.
Edit: I second-guessed myself, as I was mobile, but I have confirmed that getRelationshipOrder
is only populated for master-detail relationships, and null otherwise.
Edit2: Some standard "master-detail" relationships also return null, so you may need a "white-list" of known false negatives.