Fixed wrong ORM mapping, closes #822.
Merge pull request #870 from cmfcmf/patch

Fixed wrong ORM mapping, closes #822.