I'm trying to upcast or downcast an entity in Java and then commit it to the database. For example, if cat is a specialization of animal:
cat nowCat = (cat)animalParameter1;
nowCat.settailLength(3);
nowCat.setName("persian");
nowCat.commit();
This doesn't work. I get
java.lang.ClassCastException: myfirstmodule.proxies.animal cannot be cast to myfirstmodule.proxies.cat at MyFirstModule.downcast (JavaAction : 'downcast_java')
Thanks for any ideas.