Issue 148. closed direct access to ID in bean classes.

@maxkar , can you please review this?