Group relation classes and generate relation tables and mapping