[backend-infinispan-code-generator] Generate cast to AbstractDomainObject when needed

  * Addresses an issue discussed in #128.