changed equals()
added some annotations attributes
made some junittests
made threadsafe
replaced flush() with transaction.commit()
added some new functions