Added another method to create an entity record in the database.

Method creates a record in the database by a given Java object and returns the
persistant representation. An automatic cast by Template is done here, so the
method becomes more flexible.