fixed java part of correct relation ship, need sql code