Fixed MySQL bugs

ixed bugs with joins and reverse joins for MySQL class generation.