How to define mappings using Java API