This needs to be the other way round, the type of the order should match or be a subclass of orderType.getJavaClass()