Having the commit function in the Repository Factory could cause  a deadlock, because it is the same transaction. Therefore the commit function had to be added to the Repoistory Dao class.

Also made the abstract method getClass concrete.