fixes #143: automatic validation should validate primary key
Merge pull request #265 from chapmandu/master

Automatic validation should validate primary key