public final <T> T saveObject(final T obj) throws Exception {
        return executeInTransaction(new Runnable<T>() {
            @Override
            public T run(final EntityManager entityManager) {
                return persist(obj, entityManager);
            }
        });
    }
public final < T > T saveObject ( final T obj ) throws Exception { return executeInTransaction ( new Runnable < T > ( ) { @ Override public T run ( final EntityManager entityManager ) { return persist ( obj , entityManager ) ; } } ) ; }
Saves the given object in the database.

@param <T>
type of given object obj
@param obj
object to save
@return saved object
@throws Exception
save objects failed