@ SuppressWarnings ( { "rawtypes" , "unchecked" } ) @ WithBridgeMethods ( value = SQLUpdateClause . class , castRequired = true ) public < T > C populate ( T obj , Mapper < T > mapper ) { Collection < ? extends Path < ? > > primaryKeyColumns = entity . getPrimaryKey ( ) != null ? entity . getPrimaryKey ( ) . getLocalColumns ( ) : Collections . < Path < ? > > emptyList ( ) ; Map < Path < ? > , Object > values = mapper . createMap ( entity , obj ) ; for ( Map . Entry < Path < ? > , Object > entry : values . entrySet ( ) ) { if ( ! primaryKeyColumns . contains ( entry . getKey ( ) ) ) { set ( ( Path ) entry . getKey ( ) , entry . getValue ( ) ) ; } } return ( C ) this ; }
Populate the UPDATE clause with the properties of the given bean using the given Mapper .