When importing, if no primary key is defined for an entity always do an insert.

Based upon work by @SergioEstevao in #641.