Check for entity attachment rather than entity having an id

This commit is contained in:
Olof Larsson 2015-11-23 17:48:46 +01:00
parent 3ae6bee6e5
commit 9c0d9afe19

View File

@ -269,8 +269,7 @@ public class Coll<E extends Entity<E>> extends CollAbstract<E>
{
// Check entity
if (entity == null) return null;
String previousEntityId = entity.getId();
if (previousEntityId != null) return previousEntityId;
if (entity.attached()) return entity.getId();
String id;
// Check/Fix id