getId now return null if primary key is empty