app/repository/TreasureHuntRepository.java
public CompletionStage<Optional<Integer>> update(TreasureHunt treasureHunt, Integer id) {
        treasureHunt.setTreasureHuntId(id);
        return supplyAsync(() -> {
            Transaction txn = ebeanServer.beginTransaction();
            Optional<Integer> value = Optional.empty();
            try {
                TreasureHunt targetHunt = ebeanServer.find(TreasureHunt.class).setId(id).findOne();
                if (targetHunt != null) {
                 targetHunt = treasureHunt;
                 targetHunt.update();
                 txn.commit();
                 value = Optional.of(id);
                }
            } finally {
                txn.end();
            }
            return value;
        }, executionContext);
    }
/**
     * Updates a TreasureHunt object in the database by taking in an id of an already existing treasurehunt and a new edited treasure hunt
     * @param treasureHunt New treasure hunt with edited changes
     * @param id Id of the treasureHunt to be updated
     * @return Id of the treasure hunt updated
     */
Updates a TreasureHunt object in the database by taking in an id of an already existing treasurehunt and a new edited treasure hunt
@param treasureHunt New treasure hunt with edited changes
@param id Id of the treasureHunt to be updated
@return Id of the treasure hunt updated
Updates a TreasureHunt object in the database by taking in an id of an already existing treasurehunt and a new edited treasure hunt @param treasureHunt New treasure hunt with edited changes @param id Id of the treasureHunt to be updated @return Id of the treasure hunt updated
public CompletionStage<Optional<Integer>> update(TreasureHunt treasureHunt, Integer id) {
        treasureHunt.setTreasureHuntId(id);
        return supplyAsync(() -> {
            Transaction txn = ebeanServer.beginTransaction();
            Optional<Integer> value = Optional.empty();
            try {
                TreasureHunt targetHunt = ebeanServer.find(TreasureHunt.class).setId(id).findOne();
                if (targetHunt != null) {
                 targetHunt = treasureHunt;
                 targetHunt.update();
                 txn.commit();
                 value = Optional.of(id);
                }
            } finally {
                txn.end();
            }
            return value;
        }, executionContext);
    }
public CompletionStage < Optional < Integer > > update ( TreasureHunt treasureHunt , Integer id ) { treasureHunt . setTreasureHuntId ( id ) ; return supplyAsync ( ( ) -> { Transaction txn = ebeanServer . beginTransaction ( ) ; Optional < Integer > value = Optional . empty ( ) ; try { TreasureHunt targetHunt = ebeanServer . find ( TreasureHunt . class ) . setId ( id ) . findOne ( ) ; if ( targetHunt != null ) { targetHunt = treasureHunt ; targetHunt . update ( ) ; txn . commit ( ) ; value = Optional . of ( id ) ; } } finally { txn . end ( ) ; } return value ; } , executionContext ) ; }
Updates a TreasureHunt object in the database by taking in an id of an already existing treasurehunt and a new edited treasure hunt
 @param treasureHunt New treasure hunt with edited changes
 @param id Id of the treasureHunt to be updated
 @return Id of the treasure hunt updated
Updates a TreasureHunt object in the database by taking in an id of an already existing treasurehunt and a new edited treasure hunt @param treasureHunt New treasure hunt with edited changes @param id Id of the treasureHunt to be updated @return Id of the treasure hunt updated