lib/transportation-persistence/src/main/java/org/bananaforscale/transportation/jpa/airplane/AirplanePersistenceManager.java
public boolean update(Integer id, AirplaneBinding airplane) {
        if (!exists(id)) {
            LOGGER.info("Cannot update airplane with id [" + id + "] because it doesn't exist");
            return false;
        }

        JpaAirplaneBinding jpaBinding = new JpaAirplaneBinding();
        try {
            beanUtil.copyProperties(jpaBinding, airplane);
            jpaBinding.setId(id);
        } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException ex) {
            LOGGER.error("An error occurred while transforming to JPA bean", ex);
            return false;
        }

        LOGGER.info("Updating airplane with id: " + jpaBinding.getId());
        em.merge(jpaBinding);
        return true;
    }
/**
     * Update an airplane within the data source.
     *
     * @param id the id of the existing airplane
     * @param airplane the new airplane
     * @return the result of the operation
     */
Update an airplane within the data source.
@param id the id of the existing airplane
@param airplane the new airplane
@return the result of the operation
Update an airplane within the data source . @param id the id of the existing airplane @param airplane the new airplane @return the result of the operation
public boolean update(Integer id, AirplaneBinding airplane) {
        if (!exists(id)) {
            LOGGER.info("Cannot update airplane with id [" + id + "] because it doesn't exist");
            return false;
        }
        JpaAirplaneBinding jpaBinding = new JpaAirplaneBinding();
        try {
            beanUtil.copyProperties(jpaBinding, airplane);
            jpaBinding.setId(id);
        } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException ex) {
            LOGGER.error("An error occurred while transforming to JPA bean", ex);
            return false;
        }
        LOGGER.info("Updating airplane with id: " + jpaBinding.getId());
        em.merge(jpaBinding);
        return true;
    }
public boolean update ( Integer id , AirplaneBinding airplane ) { if ( ! exists ( id ) ) { LOGGER . info ( "Cannot update airplane with id [" + id + "] because it doesn't exist" ) ; return false ; } JpaAirplaneBinding jpaBinding = new JpaAirplaneBinding ( ) ; try { beanUtil . copyProperties ( jpaBinding , airplane ) ; jpaBinding . setId ( id ) ; } catch ( IllegalAccessException | InvocationTargetException | NoSuchMethodException ex ) { LOGGER . error ( "An error occurred while transforming to JPA bean" , ex ) ; return false ; } LOGGER . info ( "Updating airplane with id: " + jpaBinding . getId ( ) ) ; em . merge ( jpaBinding ) ; return true ; }
Update an airplane within the data source.
Update an airplane within the data source .