lib/transportation-persistence/src/main/java/org/bananaforscale/transportation/jpa/airplane/AirplanePersistenceManager.java
public Integer add(AirplaneBinding airplane) {
        JpaAirplaneBinding jpaBinding = new JpaAirplaneBinding();

        // make sure an ID isn't already set
        airplane.setId(null);

        try {
            beanUtil.copyProperties(jpaBinding, airplane);
        } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException ex) {
            LOGGER.error("An error occurred while transforming to JPA bean", ex);
            return null;
        }
        LOGGER.info("Persisting: " + jpaBinding.toString());
        em.persist(jpaBinding);
        return jpaBinding.getId();
    }
/**
     * Add an airplane into the data source
     *
     * @param airplane
     * @return the identifier within the data source
     */
Add an airplane into the data source
@param airplane
@return the identifier within the data source
Add an airplane into the data source @param airplane @return the identifier within the data source
public Integer add(AirplaneBinding airplane) {
        JpaAirplaneBinding jpaBinding = new JpaAirplaneBinding();
        airplane.setId(null);
        try {
            beanUtil.copyProperties(jpaBinding, airplane);
        } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException ex) {
            LOGGER.error("An error occurred while transforming to JPA bean", ex);
            return null;
        }
        LOGGER.info("Persisting: " + jpaBinding.toString());
        em.persist(jpaBinding);
        return jpaBinding.getId();
    }
public Integer add ( AirplaneBinding airplane ) { JpaAirplaneBinding jpaBinding = new JpaAirplaneBinding ( ) ; airplane . setId ( null ) ; try { beanUtil . copyProperties ( jpaBinding , airplane ) ; } catch ( IllegalAccessException | InvocationTargetException | NoSuchMethodException ex ) { LOGGER . error ( "An error occurred while transforming to JPA bean" , ex ) ; return null ; } LOGGER . info ( "Persisting: " + jpaBinding . toString ( ) ) ; em . persist ( jpaBinding ) ; return jpaBinding . getId ( ) ; }
Add an airplane into the data source
 @param airplane
 @return the identifier within the data source
Add an airplane into the data source @param airplane @return the identifier within the data source
// make sure an ID isn't already set